From 2977212c009af5f2420c93b0c6dda9d0e7ec2614 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Jun 2022 18:34:28 -0700 Subject: [PATCH 01/33] =?UTF-8?q?--=20mejora=20en=20emisi=C3=B3n=20usd-mxn?= =?UTF-8?q?,=20complemento=20pago=204.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/CFDITimbre.vb | 4 ++-- App_Code/Timbrado.vb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index c1f2e0bf7..34560682c 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -640,7 +640,7 @@ Public Class CFDIComplementoPago End If Next Next - 'ya generado todos los registros posibles, los agrupo y los sumo + 'ya generado todos los registros posibles, los agrupo y los sumo If tRetorno.Count > 0 Then TTraslados = tRetorno.GroupBy(Function(t) New With {Key t.TipoFactor, Key t.Impuesto, Key t.TasaOCuota}) _ .Select(Function(t) New CFDITraslados With {.Impuesto = t.Key.Impuesto, @@ -648,7 +648,7 @@ Public Class CFDIComplementoPago .TasaOCuota = t.Key.TasaOCuota, .Base = t.Sum(Function(tt) tt.Base), .Importe = t.Sum(Function(tt) tt.Importe), - .BaseMN = t.Sum(Function(tt) tt.BaseMN), + .BaseMN = t.Sum(Function(tt) tt.BaseMN).TruncateDecimal, '' se trunca solo al final, NO EN EL DESGLOSE, .ImporteMN = t.Sum(Function(tt) tt.ImporteMN)}) _ .OrderBy(Function(x) x.Impuesto).ToList diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 94e8e4207..2fea81acd 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -1166,8 +1166,8 @@ Public Class Timbrado .TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal, .Impuesto = drp("TipoImpuesto").ToString, .Importe = drp("Importe").ToString().ToDecimal.RoundSQL, - .BaseMN = Math.Round((drp("Base").ToString.ToDecimal / Equivalencia), 2), - .ImporteMN = Math.Round((drp("Importe").ToString.ToDecimal / Equivalencia), 2) + .BaseMN = Math.Round((drp("Base").ToString.ToDecimal / Equivalencia), 6), + .ImporteMN = Math.Round((drp("Importe").ToString.ToDecimal / Equivalencia), 6) } ) From df63ee6a9cf8620a968421b3eedb30fb220dd665 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 24 Jun 2022 18:46:43 -0700 Subject: [PATCH 02/33] -- mejora en redodneo ieps, comp pago 4.0 --- App_Code/CFDITimbre.vb | 4 ++-- App_Code/Timbrado.vb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index 34560682c..3d8ea68b8 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -619,7 +619,7 @@ Public Class CFDIComplementoPago TRetenciones = tRetorno.GroupBy(Function(t) New With {Key t.Impuesto}) _ .Select(Function(t) New CFDIRetenciones With {.Impuesto = t.Key.Impuesto, .Importe = t.Sum(Function(tt) tt.Importe), - .ImporteMN = t.Sum(Function(tt) tt.ImporteMN)}) _ + .ImporteMN = t.Sum(Function(tt) tt.ImporteMN).TruncateDecimal}) _ .OrderBy(Function(x) x.Impuesto).ToList End If @@ -648,7 +648,7 @@ Public Class CFDIComplementoPago .TasaOCuota = t.Key.TasaOCuota, .Base = t.Sum(Function(tt) tt.Base), .Importe = t.Sum(Function(tt) tt.Importe), - .BaseMN = t.Sum(Function(tt) tt.BaseMN).TruncateDecimal, '' se trunca solo al final, NO EN EL DESGLOSE, + .BaseMN = t.Sum(Function(tt) tt.BaseMN).TruncateDecimal, '' se trunca solo al final, NO EN EL DESGLOSE .ImporteMN = t.Sum(Function(tt) tt.ImporteMN)}) _ .OrderBy(Function(x) x.Impuesto).ToList diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 2fea81acd..8c9a35137 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -1166,8 +1166,8 @@ Public Class Timbrado .TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal, .Impuesto = drp("TipoImpuesto").ToString, .Importe = drp("Importe").ToString().ToDecimal.RoundSQL, - .BaseMN = Math.Round((drp("Base").ToString.ToDecimal / Equivalencia), 6), - .ImporteMN = Math.Round((drp("Importe").ToString.ToDecimal / Equivalencia), 6) + .BaseMN = (drp("Base").ToString.ToDecimal / Equivalencia).RoundSQL(6), + .ImporteMN = (drp("Importe").ToString.ToDecimal / Equivalencia).RoundSQL(6) } ) From a6e151bd767855d4dd9fba1e173ef99920ab8dd6 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jun 2022 08:43:22 -0700 Subject: [PATCH 03/33] -- carga saldos iniciales --- General/SaldosIniciales.aspx.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 687d51bcd..ed3d3f47a 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1712,14 +1712,14 @@ Partial Class General_SaldosIniciales Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) Dim YaExiste As Boolean = False Dim DataTemp As DataTable - + Dim Afectable As Boolean = False Cuenta = Cuenta.Replace(" ", "") - If ObjConta.GetCuentas(-1, Cuenta.Replace("-", "").Trim, 1, UsuarioActual.CveEmpresa) Then + If ObjConta.GetCuentas(-1, Cuenta.Replace("-", "").Trim, -1, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero - 'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo") + Afectable = ObjConta.DtResultados().FiltroPrimeroValor("Afectable") = "True" Else Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe}
") TieneError = True @@ -1746,7 +1746,7 @@ Partial Class General_SaldosIniciales ' CargoAbono = False 'End If - If YaExiste = False Then + If YaExiste = False AndAlso Afectable Then If IdCuenta > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 95, Concepto, Now.ToDate, -1, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then TieneError = True From 2b8c3ec88f490e913a018185e357726b055c7829 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jun 2022 08:43:59 -0700 Subject: [PATCH 04/33] -- combo de subproyectos, solo cuando es sucursal --- Inventarios/CartaPorteManual.aspx | 4 ++-- Inventarios/CartaPorteManual.aspx.vb | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Inventarios/CartaPorteManual.aspx b/Inventarios/CartaPorteManual.aspx index da661ee9e..75ba3ee43 100644 --- a/Inventarios/CartaPorteManual.aspx +++ b/Inventarios/CartaPorteManual.aspx @@ -170,7 +170,7 @@
- +
@@ -205,7 +205,7 @@ diff --git a/Inventarios/CartaPorteManual.aspx.vb b/Inventarios/CartaPorteManual.aspx.vb index 35b0da212..6369d50dd 100644 --- a/Inventarios/CartaPorteManual.aspx.vb +++ b/Inventarios/CartaPorteManual.aspx.vb @@ -294,8 +294,10 @@ Partial Class Inventarios_CartaPorteManual Private Sub CargaCombos() - CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, AplicaTodos:="") + 'CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, AplicaTodos:="") + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1).FiltraParametros("EsSucursal = True ") + DdlSubProyecto.DataBind() DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa) From 9adecc641cce8fc1661489d9d283b22b21c4bbbc Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 25 Jun 2022 08:44:31 -0700 Subject: [PATCH 05/33] -- tipodocto: RNC, que se active el popupauxiliar --- Ventas/Ventas.aspx.vb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 0bb525ab2..7311271b1 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4581,6 +4581,11 @@ Partial Class Ventas End If DiasCredito = DbRowVenta("DiasCredito").ToString().ToEntero() EsDiasCreditoFijo = CBool(DbRowVenta("EsDiasCreditoFijo").ToString()) + Case "RNC" + Trsaldo.Visible = True + HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta")) + Case "OP" TdOrdenPago.Visible = True DdlOrdenPago.SelectedValue = DbRowVenta("Num3").ToString() From 7df6315e507888f03f1396ebcaec3531ea9a7ea9 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 27 Jun 2022 11:12:48 -0700 Subject: [PATCH 06/33] Reg RSCO, Rep RSCO --- App_Code/ClsInventarios.vb | 158 ++++++++++++++++++++++++ App_Code/ClsPaginas.vb | 2 + Inventarios/RegRSCO.aspx | 187 +++++++++++++++++++++++++++++ Inventarios/RegRSCO.aspx.vb | 232 ++++++++++++++++++++++++++++++++++++ Inventarios/RepRSCO.aspx | 154 ++++++++++++++++++++++++ Inventarios/RepRSCO.aspx.vb | 150 +++++++++++++++++++++++ 6 files changed, 883 insertions(+) create mode 100644 Inventarios/RegRSCO.aspx create mode 100644 Inventarios/RegRSCO.aspx.vb create mode 100644 Inventarios/RepRSCO.aspx create mode 100644 Inventarios/RepRSCO.aspx.vb diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 926d626e3..8675d287e 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5903,6 +5903,164 @@ Public Class ClsInventarios End Function #End Region + + +#Region "VIGENCIA COMPUESTOS" + + + Public Function AddCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, RegistroRSCO As String, FechaVigencia As Date, VigenciaIndeterminada As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_CompuestosVigenciaAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@RegistroRSCO", SqlDbType.VarChar).Value = RegistroRSCO + .Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia + .Add("@VigenciaIndeterminada", SqlDbType.Bit).Value = VigenciaIndeterminada + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("IX_Inv_CveCompuestoCveProveedorFechaVigneciaCveEmpresa") Then + Alert($"Ya existe un RSCO con los datos especificados (proveedor, compuesto, Fecha de vigencia).", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("UNIX_Inv_RegistroRSCO") Then + Alert($"El RSCO {RegistroRSCO} ya se encuentra registrado.", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar la vigencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al guardar la vigencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateCompuestosVigencia(CveCompuestoVigencia As Integer, CveCompuesto As Integer, CveProveedor As Integer, RegistroRSCO As String, FechaVigencia As Date, VigenciaIndeterminada As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_CompuestosVigenciaUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompuestoVigencia", SqlDbType.Int).Value = CveCompuestoVigencia + .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@RegistroRSCO", SqlDbType.VarChar).Value = RegistroRSCO + .Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia + .Add("@VigenciaIndeterminada", SqlDbType.Bit).Value = VigenciaIndeterminada + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("IX_Inv_CveCompuestoCveProveedorFechaVigneciaCveEmpresa") Then + Alert($"Ya existe un RSCO con los datos especificados (proveedor, compuesto, Fecha de vigencia).", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("UNIX_Inv_RegistroRSCO") Then + Alert($"El RSCO {RegistroRSCO} ya se encuentra registrado.", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al actualizar la vigencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al actualizar el RSCO.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function RemoveCompuestosVigencia(CveCompuestoVigencia As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_CompuestosVigenciaRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompuestoVigencia", SqlDbType.Int).Value = CveCompuestoVigencia + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar el RSCO.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + Catch ex As Exception + OnError("Ocurrió un error al eliminar el RSCO.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function GetCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, VigenciaIndeterminada As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_CompuestosVigenciaGet") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@VigenciaIndeterminada", SqlDbType.Int).Value = VigenciaIndeterminada + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener los RSCO", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener los RSCO.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function RepCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, VigenciaIndeterminada As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_CompuestosVigenciaRep") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@VigenciaIndeterminada", SqlDbType.Int).Value = VigenciaIndeterminada + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener los RSCO", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener los RSCO.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + +#End Region + #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b7cf23d3c..452aab6f8 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5603,6 +5603,8 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1) PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326) + PaginaDict.Add("/Inventarios/RegRSCO.aspx".ToUpper(), 1327) + PaginaDict.Add("/Inventarios/RepRSCO.aspx".ToUpper(), 1328) PaginaDict.Add("/testApi.aspx".ToUpper(), -1) diff --git a/Inventarios/RegRSCO.aspx b/Inventarios/RegRSCO.aspx new file mode 100644 index 000000000..443e08081 --- /dev/null +++ b/Inventarios/RegRSCO.aspx @@ -0,0 +1,187 @@ +<%@ Page Title="Reg RSCO" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RegRSCO.aspx.vb" Inherits="Inventarios_RegRSCO" EnableEventValidation="false" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + Reg RSCO + + + + + + +
  • + +
  • +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Inventarios/RegRSCO.aspx.vb b/Inventarios/RegRSCO.aspx.vb new file mode 100644 index 000000000..c55676cf8 --- /dev/null +++ b/Inventarios/RegRSCO.aspx.vb @@ -0,0 +1,232 @@ +Imports Extensiones +Partial Class Inventarios_RegRSCO + Inherits ClsPaginas + + Private Property CveCompuestoVigencia As Integer + Get + + If ViewState("CveCompuestoVigencia") Is Nothing Then + Return -1 + Else + Return ViewState("CveCompuestoVigencia").ToString().ToEntero() + End If + End Get + Set(ByVal value As Integer) + ViewState("CveCompuestoVigencia") = value + End Set + End Property + + Private Sub Inventarios_RegRSCO_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + + CargaDatos() + End If + End Sub + + + + + + + Public Sub CargaDatos() + + + Dim ObjInventarios As New ClsInventarios + + If ObjInventarios.GetCompuestosVigencia(-1, -1, MinFecha, MaxFecha, 1, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjInventarios.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjInventarios.Dispose() + GvDatos.DataBind() + UpDatos.Update() + + + End Sub + + Private Sub CargaCombos() + + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Seleccione Uno" + DdlProveedores.SelectedValue = "-1" + + + Dim ObjPS As New ClsProductosServicios + + If ObjPS.GetCompuestosActivos(UsuarioActual.CveEmpresa) Then + DdlCompuesto.DataSource = ObjPS.DtResultados + Else + DdlCompuesto.DataSource = Nothing + End If + + ObjPS.Dispose() + DdlCompuesto.DataBind() + DdlCompuesto.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + + + + UpModalRSCO.Update() + + End Sub + + Private Sub LimpiarModalDivAgregarRSCO() + CveCompuestoVigencia = -1 + + BtnAgregarRSCO.Text = "Agregar" + + DdlProveedores.txtValue.Value = "-1" + DdlProveedores.txtText.Value = "" + + DdlCompuesto.SelectedValueExist(-1) + + TxtFechaVigencia.Text = "" + TxtRegistroRSCO.Text = "" + ChkFechaIndeterminada.Checked = False + + LtlTituloModal.Text = "Agregar RSCO" + + DivModalContinuarAgregando.Visible = True + ChkModalContinuarAgregando.Checked = True + + UpModalRSCO.Update() + End Sub + + Protected Sub LnkAgregarRSCO_Click(sender As Object, e As EventArgs) + + LimpiarModalDivAgregarRSCO() + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarRSCO")) + + End Sub + + Protected Sub LnkEditar_Click(sender As Object, e As EventArgs) + + BtnAgregarRSCO.Text = "Actualizar" + Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) + + CveCompuestoVigencia = GvRow.DataKey("CveCompuestoVigencia").ToEntero() + + + + DdlProveedores.txtValue.Value = GvRow.DataKey("CveProveedor") + DdlProveedores.txtText.Value = GvRow.DataKey("NombreComercial") + + + DdlCompuesto.SelectedValueExist(GvRow.DataKey("CveCompuesto")) + TxtFechaVigencia.Text = GvRow.DataKey("FechaVigencia").ToDate.ToString("dd/MM/yyyy") + TxtRegistroRSCO.Text = GvRow.DataKey("RegistroRSCO") + ChkFechaIndeterminada.Checked = Boolean.Parse(GvRow.DataKey("VigenciaIndeterminada")) + + LtlTituloModal.Text = "Actualizar RSCO" + + DivModalContinuarAgregando.Visible = False + ChkModalContinuarAgregando.Checked = False + + + If ChkFechaIndeterminada.Checked Then + DvFechaVijencia.Visible = False + TxtFechaVigencia.Text = "01/01/1900" + Else + DvFechaVijencia.Visible = True + End If + + + + + UpModalRSCO.Update() + + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarRSCO")) + End Sub + + Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) + + Dim ErrorAlElimiar As Boolean = False + + Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) + + Dim CveCompuestoVigenciaEliminar = GvRow.DataKey("CveCompuestoVigencia").ToEntero() + + Using ObjInventarios As New ClsInventarios + + If (ObjInventarios.RemoveCompuestosVigencia(CveCompuestoVigenciaEliminar, UsuarioActual.CveEmpresa)) Then + + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarRSCO")) + Alert("RSCO Eliminado Correctamente.") + Else + ErrorAlElimiar = True + End If + End Using + + + If Not ErrorAlElimiar Then + GlobalDTInvCamiones(UsuarioActual.CveEmpresa) = Nothing + CargaDatos() + End If + + End Sub + + Protected Sub BtnAgregarRSCO_Click(sender As Object, e As EventArgs) + + Dim ErrorPrceso As Boolean = False + + + If DdlProveedores.SelectedValue.ToEntero <= 0 Then + Alert("Debe de seleccionar un proveedor.") + Exit Sub + End If + + Using ObjInventarios As New ClsInventarios + + If CveCompuestoVigencia <= 0 Then + If ObjInventarios.AddCompuestosVigencia(DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, TxtRegistroRSCO.Text, TxtFechaVigencia.Text.ToDate, ChkFechaIndeterminada.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert("RSCO agregado correctamente") + Else + ErrorPrceso = True + End If + Else + If ObjInventarios.UpdateCompuestosVigencia(CveCompuestoVigencia, DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, TxtRegistroRSCO.Text, TxtFechaVigencia.Text.ToDate, ChkFechaIndeterminada.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert("RSCO actualizado correctamente") + Else + ErrorPrceso = True + End If + End If + End Using + + + If Not ErrorPrceso Then + GlobalDTInvCamiones(UsuarioActual.CveEmpresa) = Nothing + CargaDatos() + + If Not ChkModalContinuarAgregando.Checked Then + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarRSCO")) + Else + LimpiarModalDivAgregarRSCO() + End If + + UpDatos.Update() + End If + + + + End Sub + + + + Protected Sub ChkFechaIndeterminada_CheckedChanged(sender As Object, e As EventArgs) + + If ChkFechaIndeterminada.Checked Then + DvFechaVijencia.Visible = False + TxtFechaVigencia.Text = "01/01/1900" + Else + DvFechaVijencia.Visible = True + TxtFechaVigencia.Text = "" + End If + + UpModalRSCO.Update() + + End Sub +End Class diff --git a/Inventarios/RepRSCO.aspx b/Inventarios/RepRSCO.aspx new file mode 100644 index 000000000..c7a13b4d0 --- /dev/null +++ b/Inventarios/RepRSCO.aspx @@ -0,0 +1,154 @@ +<%@ Page Title="Rep RSCO" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepRSCO.aspx.vb" Inherits="Inventarios_RepRSCO" EnableEventValidation="false" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + Rep RSCO + + + + + + +
  • + +
  • +
    + + + +
    +
    + + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    Proveedor:
    +
    + +
    +
    Compuesto:
    +
    + + +
    + +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: + +
    +
    +
    + + + + +
    + + + + + + +
    + + + + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + --%> + + + + + + + + + + + + + +
    + + + diff --git a/Inventarios/RepRSCO.aspx.vb b/Inventarios/RepRSCO.aspx.vb new file mode 100644 index 000000000..ddd0ca648 --- /dev/null +++ b/Inventarios/RepRSCO.aspx.vb @@ -0,0 +1,150 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class Inventarios_RepRSCO + Inherits ClsPaginas + + Private Property DTDatos As DataTable + Get + + If ViewState("DTDatos") Is Nothing Then + + ViewState("DTDatos") = New DataTable + End If + + Return DirectCast(ViewState("DTDatos"), DataTable) + + End Get + Set(ByVal value As DataTable) + ViewState("DTDatos") = value + End Set + End Property + + Private Sub Inventarios_RepRSCO_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + + End If + End Sub + + + Public Sub CargaDatos() + + + Dim ObjInventarios As New ClsInventarios + + LnkDescargaExcel.Visible = False + + If ObjInventarios.RepCompuestosVigencia(DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then + + DTDatos = ObjInventarios.DtResultados + GvDatos.DataSource = DTDatos + If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then + LnkDescargaExcel.Visible = True + UpAcciones.Update() + End If + Else + GvDatos.DataSource = Nothing + End If + + ObjInventarios.Dispose() + GvDatos.DataBind() + UpDatos.Update() + + + End Sub + + Private Sub CargaCombos() + + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Todos" + DdlProveedores.SelectedValue = "-1" + + + Dim ObjPS As New ClsProductosServicios + + If ObjPS.GetCompuestosActivos(UsuarioActual.CveEmpresa) Then + DdlCompuesto.DataSource = ObjPS.DtResultados + Else + DdlCompuesto.DataSource = Nothing + End If + + ObjPS.Dispose() + DdlCompuesto.DataBind() + DdlCompuesto.Items.Insert(0, New ListItem("Todos", "-1")) + + + txtFechaF.Text = Now.ToString("dd/MM/yyyy") + txtFechaI.Text = txtFechaF.Text.ToDate.AddMonths(-2).ToString("dd/MM/yyyy") + + + + End Sub + + + + + + + Protected Sub LnkDescargaExcel_Click(sender As Object, e As EventArgs) + ImprimirReporte("EXCEL") + End Sub + + + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + + Dim ObjTareas As New ClsOIEventos + Dim params As New List(Of ReportParameter) + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim FechaI, FechaF As String + FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) + FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) + + + params.Add(New ReportParameter("Filtros", FiltrosUsados())) + 'params.Add(New ReportParameter("GPO", DdlGrupo.SelectedItem.Text)) + params.Add(New ReportParameter("Titulo", "Reporte RSCO")) + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("FechaInicio", FechaI)) + params.Add(New ReportParameter("FechaFin", FechaF)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + + ImprimirPDF("Empresas\Grales\Formatos\RepRSCO.rdlc", DTDatos, params, "RepRSCO" & Now.ToString("yyyyMMddmmss"), Formato:=Formato) + + End Sub + + Private Function FiltrosUsados() As String + Dim Filtros As String = "" + + If DdlProveedores.SelectedValue.ToEntero > 0 Then + Filtros = $"Proveedor: {DdlProveedores.txtText.Value}, " + End If + + If DdlCompuesto.SelectedValue.ToEntero > 0 Then + Filtros = Filtros & $"Compuesto: {DdlProveedores.txtText.Value}, " + End If + + + Filtros = Filtros & $"Fecha Inicio: {txtFechaI.Text}, Fecha Fin: {txtFechaF.Text}" + + Return Filtros + + End Function + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub +End Class From b7864616887411690496a1ec19e3c8ba7276d061 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Jun 2022 17:33:11 -0700 Subject: [PATCH 07/33] -- mejora en prepolizas --- Ventas/Ventas.aspx.vb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7311271b1..d429a72fd 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -20210,7 +20210,6 @@ Partial Class Ventas For Each RowInv As DataRow In DtCostosDistinct.Rows ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() - CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() TotalCostoAcumulado += ValorInventario 'cuando es el último movimiento y hay diferencias en los importes @@ -20220,7 +20219,7 @@ Partial Class Ventas Try 'If ValorInventario <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then OcurrioError = True Exit For End If @@ -20234,7 +20233,7 @@ Partial Class Ventas If Not OcurrioError Then IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then OcurrioError = True End If End If @@ -20244,18 +20243,14 @@ Partial Class Ventas End If End If - 'VALIDA QUE SE HALLAN AGREGADO DETALLES AL MOVIMIENTO If ContadorMovtosDetalles = 0 Then OcurrioError = True End If - Else OcurrioError = True End If - - If OcurrioError Then Return -1 Else @@ -34454,7 +34449,7 @@ Partial Class Ventas Dim Distancia As Integer = TxtDistancia.Text.ToEntero() - Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(DdlSubProyectoDatos.SelectedValue.ToEntero, CveDireccionOrigen, CveDireccionDestino, -1, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, FechaEntrega, Fechallegada, "T", "-1", "-1", Fechallegada, 1, 1, Distancia, + Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(DdlSubProyectoDatos.SelectedValue.ToEntero, CveDireccionOrigen, CveDireccionDestino, -1, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, FechaEntrega, Fechallegada, "I", "-1", "-1", Fechallegada, 1, 1, Distancia, CveConfigAutoTransporte:=DdlConfigAuto.SelectedValue.ToEntero, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero) If CveEntregaAlmacen > 0 Then From d462bafc192defa1ed574da792929c1b9e1c7489 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 27 Jun 2022 17:33:23 -0700 Subject: [PATCH 08/33] =?UTF-8?q?--=20generar=20registro=20de=20prep=C3=B3?= =?UTF-8?q?liza-almacen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/Modelos.vb | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 37ac787cc..ed3b8cc3f 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2213,11 +2213,12 @@ Namespace Modelos End Function - Private Function CancelarInventarioUsado(factura As Modelos.Factura, CveAlmacenUsado As Integer, CveMovimientoEntrada As Integer, ByRef ObjInventario As ClsInventarios) As Integer + Private Function CancelarInventarioUsado(factura As Modelos.Factura, CveAlmacenUsado As Integer, CveMovimientoEntrada As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Integer Dim CveMovimiento As Integer = -1 Try Dim CveConceptoSalidaUsado As Integer = 45 - CveMovimiento = ObjInventario.AddMovimiento(CveAlmacenUsado, CveConceptoSalidaUsado, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, factura.CveVenta, + Dim tFecha As DateTime = Now + CveMovimiento = ObjInventario.AddMovimiento(CveAlmacenUsado, CveConceptoSalidaUsado, 1, tFecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, factura.CveVenta, factura.CveSubProyecto, CveActivoFijo:=-1, Guia:="", Observaciones:="", CvePersonal:=-1, CveCliente:=factura.CveCliente, CveClienteSucursal:=-1, Modulo:="M/CU") If CveMovimiento <= 0 Then CveMovimiento = -1 @@ -2229,11 +2230,34 @@ Namespace Modelos If DtMovimientosEntrada IsNot Nothing Then For Each Dr As DataRow In DtMovimientosEntrada.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then CveMovimiento = -1 Exit For End If Next + + If CveMovimiento > 0 Then + Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio + Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero + Dim tCveConcepto As Integer = 278 + Dim ValorInventario As Decimal = 0 + Dim MovAlmacen As Boolean = False 'debe quedar como el anterior, pero negativo + + For Each RowInv As DataRow In DtMovimientosEntrada.Rows + ValorInventario = DtMovimientosEntrada.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, -ValorInventario, Concepto, tCveConcepto, Concepto, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + CveMovimiento = -1 + Exit For + End If + Next + + If CveMovimiento > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, -DtMovimientosEntrada.SUMD("Total").RoundSQL, Concepto, 68, Concepto, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-DtMovimientosEntrada.SUMD("Total").RoundSQL) Then + CveMovimiento = -1 + End If + End If + DtMovimientosEntrada.Dispose() DtMovimientosEntrada = Nothing End If @@ -2470,7 +2494,7 @@ Namespace Modelos Dim TipoMovto68 = TipoMovimiento 'SI ES CANCELACION DEBE GENERAR EL MOVIMIENTO DE SALIDA DE USADOS If ValorMultiplicador = -1 Then - CveMovimientoReferencia = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario) + CveMovimientoReferencia = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario, ObjConta) Else CveMovimientoReferencia = CveMovimiento End If @@ -5585,7 +5609,7 @@ Namespace Modelos End If If Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then - If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario) <= 0 Then + If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario, ObjConta) <= 0 Then ErrorCancelar = True MensajeError = "Ocurrió un error al cancelar los usados. Por favor vuelva a intentar." End If @@ -5691,7 +5715,7 @@ Namespace Modelos 'CANCELAR MOVIMIENTOS DE USADOS SI TIENE If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then - If CancelarInventarioUsado(ObjFactura, CveAlmacenUsado, CveMovimientoUsado, ObjInventario) <= 0 Then + If CancelarInventarioUsado(ObjFactura, CveAlmacenUsado, CveMovimientoUsado, ObjInventario, ObjConta) <= 0 Then ErrorCancelar = True MensajeError = "Ocurrió un error al cancelar los movimientos de usados." End If From d918a76ad371abe74766eba3de2822c50bda40dd Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Jun 2022 09:26:52 -0700 Subject: [PATCH 09/33] Concepto de entrada ExA al generar la prepoliza --- App_Code/Modelos.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 37ac787cc..e60e23e27 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4305,7 +4305,7 @@ Namespace Modelos Dim TipoMovto68 As Boolean = True Dim TipoMovto69 As Boolean = False - If CveConcepto.Contiene(18) Then + If CveConcepto.Contiene(18, 9) Then TipoMovto68 = False TipoMovto69 = True End If From a929cb71396e915ed71056e5ae2d213f19268f76 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Jun 2022 09:27:19 -0700 Subject: [PATCH 10/33] Cambio de nombre metodo BASF_POG40 --- Ashx/E119.ashx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx index 2c1abbc0b..782584b41 100644 --- a/Ashx/E119.ashx +++ b/Ashx/E119.ashx @@ -100,7 +100,7 @@ Public Class E119 : Implements IHttpHandler Try Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString()) 'OBTENER EXISTENCIAS - If Metodo = "ConsultaBASF_POG" Then + If Metodo = "BASF_POG40" Then context.Response.ContentType = "application/json" Dim Auth = ValidarSolicitud(context) From ee75258ef23edd15940e02d89b8600b3fcd13c80 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Jun 2022 09:28:18 -0700 Subject: [PATCH 11/33] Optimizacion de carga de obj factura en ventas --- Ventas/Ventas.aspx.vb | 148 ++++++++++++++++++++++++------------------ 1 file changed, 84 insertions(+), 64 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 0bb525ab2..c2dbb51a0 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9578,7 +9578,7 @@ Partial Class Ventas Try 'MANDA CORREO Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) - Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False) + Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST)) Hilo.Start() Catch ex As Exception @@ -15195,7 +15195,7 @@ Partial Class Ventas End Try If CveVenta > 0 Then - ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False) + ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False) End If LocalSerieFolio = ObjFactura.SerieFolio @@ -16433,7 +16433,7 @@ Partial Class Ventas Try 'MANDA CORREO Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) - Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False) + Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST)) Hilo.Start() Catch ex As Exception @@ -23693,7 +23693,7 @@ Partial Class Ventas End Function Public Sub EnviarPDFCancelacion(CveVenta As Integer) - Dim FacturaRef As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa) + Dim FacturaRef As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, CargaDTDetalle:=False, CargaDatosRelacionados:=False) If FacturaRef IsNot Nothing Then Dim ObjetoPDF As Byte() = DescargarPDF(Encripta(String.Format("OP=CAN&CVEVTA={0}", CveVenta))) @@ -26942,10 +26942,20 @@ Partial Class Ventas If CveVentaUsado > 0 Then DivSMU.Visible = True - Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa) - Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal() - HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() - LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) + 'Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) + Dim DtDetalleUsado As DataTable = Nothing + Using ObjVentas As New ClsVentas + If ObjVentas.GetVentaDetalle(CveVentaUsado) Then + DtDetalleUsado = ObjVentas.DtResultados.Copy() + End If + End Using + + If DtDetalleUsado IsNot Nothing Then + Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) + End If + Else If CargarSoloGarantias Then Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") @@ -27062,17 +27072,27 @@ Partial Class Ventas If CveVentaUsado > 0 Then DivSMU.Visible = True - Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa) - Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + 'Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa) + Dim DtDetalleUsado As DataTable = Nothing + Using ObjVentas As New ClsVentas + If ObjVentas.GetVentaDetalle(CveVentaUsado) Then + DtDetalleUsado = ObjVentas.DtResultados.Copy() + End If + End Using - If SaldoMaximoUsados > 0 Then - HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() - LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) - Else - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" + If DtDetalleUsado IsNot Nothing Then + Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + + If SaldoMaximoUsados > 0 Then + HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) + Else + HdnSaldoMaximoUsados.Value = "0" + LtlSMU.Text = "0" + End If End If + Else If CargaSoloGarantias Then Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1") @@ -30196,59 +30216,59 @@ Partial Class Ventas UpParametros.Update() End Sub - Private Function AjustarTotalCotizacionFacturada(CveCotizacion As Integer, TotalAjustar As Decimal) As Boolean - Dim ErrorAjuste As Boolean = False + 'Private Function AjustarTotalCotizacionFacturada(CveCotizacion As Integer, TotalAjustar As Decimal) As Boolean + ' Dim ErrorAjuste As Boolean = False - Dim ObjCotizacion As New Modelos.Factura(UsuarioActual, CveCotizacion, UsuarioActual.CveEmpresa) + ' Dim ObjCotizacion As New Modelos.Factura(UsuarioActual, CveCotizacion, UsuarioActual.CveEmpresa) - If ObjCotizacion.CveMoneda = 1 Then - Dim TotalNuevoDocumento As Decimal = TotalAjustar + ' If ObjCotizacion.CveMoneda = 1 Then + ' Dim TotalNuevoDocumento As Decimal = TotalAjustar - Dim Diferencia As Decimal = (ObjCotizacion.Total - TotalNuevoDocumento) + ' Dim Diferencia As Decimal = (ObjCotizacion.Total - TotalNuevoDocumento) - If Diferencia <> 0 Then - 'AJUSTAR EN EL IVA - For Each RowNuevoDocumento As DataRow In TmpDT.Rows - Dim CveVentaDetalleCotizacion As Integer = RowNuevoDocumento("CveVentaDetalleCotizacion").ToString().ToEntero() + ' If Diferencia <> 0 Then + ' 'AJUSTAR EN EL IVA + ' For Each RowNuevoDocumento As DataRow In TmpDT.Rows + ' Dim CveVentaDetalleCotizacion As Integer = RowNuevoDocumento("CveVentaDetalleCotizacion").ToString().ToEntero() - Dim ImporteIVANuevoDocumento As Decimal = RowNuevoDocumento("ImporteIVA").ToString().ToDecimal() - Dim ImporteIEPSNuevoDocumento As Decimal = RowNuevoDocumento("ImporteIEPS").ToString().ToDecimal() + ' Dim ImporteIVANuevoDocumento As Decimal = RowNuevoDocumento("ImporteIVA").ToString().ToDecimal() + ' Dim ImporteIEPSNuevoDocumento As Decimal = RowNuevoDocumento("ImporteIEPS").ToString().ToDecimal() - If CveVentaDetalleCotizacion > 0 Then - 'AJUSTAR IVA - If ImporteIVANuevoDocumento > 0 Then - Dim ImporteIVACotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIVA", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal + ' If CveVentaDetalleCotizacion > 0 Then + ' 'AJUSTAR IVA + ' If ImporteIVANuevoDocumento > 0 Then + ' Dim ImporteIVACotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIVA", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal - If ImporteIVANuevoDocumento <> ImporteIVACotizacion Then - RowNuevoDocumento("ImporteIVA") = ImporteIVACotizacion - End If - End If + ' If ImporteIVANuevoDocumento <> ImporteIVACotizacion Then + ' RowNuevoDocumento("ImporteIVA") = ImporteIVACotizacion + ' End If + ' End If - 'AJUSTAR IEPS - If ImporteIEPSNuevoDocumento > 0 Then - Dim ImporteIEPSCotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIEPS", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal + ' 'AJUSTAR IEPS + ' If ImporteIEPSNuevoDocumento > 0 Then + ' Dim ImporteIEPSCotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIEPS", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal - If ImporteIEPSNuevoDocumento <> ImporteIEPSCotizacion Then - RowNuevoDocumento("ImporteIEPS") = ImporteIEPSCotizacion - End If - End If + ' If ImporteIEPSNuevoDocumento <> ImporteIEPSCotizacion Then + ' RowNuevoDocumento("ImporteIEPS") = ImporteIEPSCotizacion + ' End If + ' End If - End If - Next - End If + ' End If + ' Next + ' End If - CalculaTotalesVenta(RecalculaImpuestosLocales:=False) + ' CalculaTotalesVenta(RecalculaImpuestosLocales:=False) - If Math.Abs(ObjCotizacion.Total - TotalAjustar) > 0 OrElse Math.Abs(TxtTotal.Text.ToDecimal - TotalAjustar) > 0 Then - ErrorAjuste = True - End If + ' If Math.Abs(ObjCotizacion.Total - TotalAjustar) > 0 OrElse Math.Abs(TxtTotal.Text.ToDecimal - TotalAjustar) > 0 Then + ' ErrorAjuste = True + ' End If - End If - ObjCotizacion.Dispose() + ' End If + ' ObjCotizacion.Dispose() - Return Not ErrorAjuste - End Function + ' Return Not ErrorAjuste + 'End Function Private Class MVentaDetalleCotizacion Public Property CveVentaDetalle As Integer @@ -32135,7 +32155,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows @@ -32191,7 +32211,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRemisionesNC.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() 'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero() @@ -32255,7 +32275,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvRemisionesNCBonDetalle.Rows @@ -32311,7 +32331,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -32436,7 +32456,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvDescNCCargosDetalle.Rows @@ -32507,7 +32527,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCCargos.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -32591,7 +32611,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCBonificacionDetalleSeleccionadas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvDescNCBonDetalle.Rows @@ -32647,7 +32667,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCBonificaciones.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -32669,7 +32689,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCBonificaciones.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -33915,7 +33935,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRNCDevoluciones.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() TotalRemNCAplicado += RemNC.TotalRemNCAplicado From f28317c346df4aba995eacc3f38e281e24abe8f1 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 29 Jun 2022 10:07:33 -0700 Subject: [PATCH 12/33] Reportes Cambiar Cliente y proveedor a dropdown lost, Compras Editar Fecha de compra, reg prepolizas s agregar IE cuando ya esta creada la poliza --- App_Code/ClsCompras.vb | 19 +- App_Code/ClsContabilidad.vb | 4 +- App_Code/ClsGenerales.vb | 2 +- Compras/Compras.aspx | 66 ++++--- Compras/Compras.aspx.vb | 27 +++ Compras/RepPagado.aspx | 3 +- Compras/RepPagado.aspx.cs | 16 +- Compras/RepPagadoDetalle.aspx | 3 +- Compras/RepPagadoDetalle.aspx.cs | 9 +- Compras/RepPagadoPeriodo.aspx | 6 +- Compras/RepPagadoPeriodo.aspx.cs | 13 +- Compras/eFacturas.aspx | 67 ++++++- Compras/eFacturas.aspx.vb | 73 ++++++-- Contabilidad/RegPrePolizaS.aspx | 2 +- Contabilidad/RegPrePolizaS.aspx.vb | 60 ++++++- Empresas/Grales/Formatos/RepFacturas.rdlc | 190 +++++++++++++++----- General/SaldosIniciales.aspx.vb | 3 +- Inventarios/RepEntregaAlmacenRuta.aspx.cs | 37 +++- Ventas/RepProductosServiciosPeriodo.aspx | 6 +- Ventas/RepProductosServiciosPeriodo.aspx.cs | 24 +-- Ventas/RepRecuperacionPeriodo.aspx | 5 +- Ventas/RepRecuperacionPeriodo.aspx.cs | 9 +- Ventas/RepVentasPeriodo.aspx | 6 +- Ventas/RepVentasPeriodo.aspx.vb | 38 ++-- 24 files changed, 536 insertions(+), 152 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 5750cf281..5c4bd2ae9 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -3182,6 +3182,24 @@ Public Class ClsCompras Return Retorno End Function + + Public Function UpdateFechaCompra(CveCompra As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasFechaUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la fecha de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetRepEvaluacionesProveedores(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, Evaluado As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_RepEvaluacionesProveedoresGet") @@ -3338,7 +3356,6 @@ Public Class ClsCompras End Function - End Class diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e14cd2203..fb3ada64a 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -291,7 +291,7 @@ Public Class ClsContabilidad Public Function UpdatePrePolizasDetalle(CvePrePolizaDetalle As Integer, Concepto As String, CveSubProyecto As Integer, IdCtaContable As Integer, TipoMovto As Boolean, ImporteMN As Decimal, Optional CveTipoGasto As Integer = -1, Optional CveConceptoContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVenta As Integer = -1, - Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1) As Boolean + Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1, Optional CveIE As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -316,6 +316,8 @@ Public Class ClsContabilidad .Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta + .Add("@CveIE", SqlDbType.Int).Value = CveIE + End With Try diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 8d10ef979..90c5be8f7 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -4059,7 +4059,7 @@ Public Class ClsGenerales Dim Retorno As Boolean = False - DataAdapter("PA_Inv_EntregaAlmacenRutaRepGet") + DataAdapter("PA_Inv_EntregaAlmacenRutaRepGet2") With SqlAdapter.SelectCommand.Parameters diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 198291fb2..7339893cb 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -288,32 +288,50 @@
    -
    - Fecha Factura: -
    -
    + + + +
    - +
    + + + + + +
    Fecha Factura: + - - - - - - - - - - - - - + +
    + + + + + +
    Descripción:
    diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 1d54b6c32..3de4b8463 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1899,6 +1899,8 @@ Partial Class Compras_Compras ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216) CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216) + + TxtSubTotal.Enabled = False TxtDescuento.Enabled = False TxtSubTotal2.Enabled = False @@ -2901,6 +2903,16 @@ Partial Class Compras_Compras ImgFecha.Enabled = False CEFecha.Enabled = False + + If UsuarioActual.TienePermisoProceso(342) Then + TxtFecha.Enabled = True + ImgFecha.Enabled = True + CEFecha.Enabled = True + LnkActualziarFechadecompra.Visible = True + End If + + + DdlProveedor.Enabled = False DdlProveedorSucursal.Enabled = False DdlEstatus.Enabled = False @@ -21142,6 +21154,21 @@ Partial Class Compras_Compras Private Sub ChkAliasFlexible_CheckedChanged(sender As Object, e As EventArgs) Handles ChkAliasFlexible.CheckedChanged TxtPSAlias.Enabled = ChkAliasFlexible.Checked End Sub + + Protected Sub LnkActualziarFechadecompra_Click(sender As Object, e As EventArgs) + + + Dim ObjCompra As New ClsCompras + + + If ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then + Alert("Fecha Actualizada Correctamente") + End If + + + ObjCompra.Dispose() + + End Sub End Class Public Class MMensajeDevolucion diff --git a/Compras/RepPagado.aspx b/Compras/RepPagado.aspx index b5dfcc606..621d4d3ec 100644 --- a/Compras/RepPagado.aspx +++ b/Compras/RepPagado.aspx @@ -61,8 +61,7 @@
    Proveedor:
    - - +
    Fecha Inicial:
    diff --git a/Compras/RepPagado.aspx.cs b/Compras/RepPagado.aspx.cs index b5dafa73c..5a0ea0a4f 100644 --- a/Compras/RepPagado.aspx.cs +++ b/Compras/RepPagado.aspx.cs @@ -42,9 +42,10 @@ public partial class Compras_RepPagado : ClsPaginas DdlMoneda.DataBind(); //Carga Proveedor - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.Items.Insert(0, new ListItem("Todos", "-1")); - DdlProveedor.DataBind(); + DdlProveedores.setEsWebService(true); + DdlProveedores.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedores.SelectedText = "Todos"; + DdlProveedores.SelectedValue = "-1"; //Carga Usuarios DdlUsuario.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); @@ -163,7 +164,7 @@ public partial class Compras_RepPagado : ClsPaginas private void CargaDatos() { ClsCompras ObjComp = new ClsCompras(); - if (ObjComp.GetRepPagado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedor.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), + if (ObjComp.GetRepPagado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedores.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), DdlUsuario.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero(), DdlResponsable.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, DdlBanco.SelectedValue.ToEntero(), DdlCuentaBancaria.SelectedValue.ToEntero(), DdlMoneda.SelectedValue.ToEntero(),TxtFechaICompra.Text.ToDate(),TxtFechaFCompra.Text.ToDate(),CveTipoProveedor: DdlTipoProveedor.SelectedValue.ToEntero(), @@ -229,8 +230,8 @@ public partial class Compras_RepPagado : ClsPaginas StrFiltro.AppendFormat(" SubProyecto: {0}", DdlSubProyecto.SelectedItem.Text); if (DdlGrupo.SelectedValue != "-1") StrFiltro.AppendFormat(" Grupo: {0}", DdlGrupo.SelectedItem.Text); - if (DdlProveedor.SelectedValue != "-1") - StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedor.SelectedItem.Text); + if (DdlProveedores.SelectedValue != "-1") + StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedores.txtText.Value); if (DdlUsuario.SelectedValue != "-1") StrFiltro.AppendFormat(" Registro: {0}", DdlUsuario.SelectedItem.Text); if (DdlResponsable.SelectedValue != "-1") @@ -251,12 +252,14 @@ public partial class Compras_RepPagado : ClsPaginas } System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); List para = new List(); para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString())); para.Add(new ReportParameter("Filtros", StrFiltro.ToString())); + if (Imagen.Exists) { para.Add(new ReportParameter("LogoPath", logouri)); @@ -265,6 +268,7 @@ public partial class Compras_RepPagado : ClsPaginas { para.Add(new ReportParameter("LogoPath", "")); } + ImprimirPDF(RutaPDF,DtPagado, para, "RepPagado" + DateTime.Now.ToString("yyyyMMddhhmmss"), Opcion); } diff --git a/Compras/RepPagadoDetalle.aspx b/Compras/RepPagadoDetalle.aspx index 4a831abc4..cea78df58 100644 --- a/Compras/RepPagadoDetalle.aspx +++ b/Compras/RepPagadoDetalle.aspx @@ -48,8 +48,7 @@
    Proveedor:
    - - +
    Fecha Inicial:
    diff --git a/Compras/RepPagadoDetalle.aspx.cs b/Compras/RepPagadoDetalle.aspx.cs index 326d99ed8..1ad46e4ff 100644 --- a/Compras/RepPagadoDetalle.aspx.cs +++ b/Compras/RepPagadoDetalle.aspx.cs @@ -47,9 +47,10 @@ public partial class Compras_RepPágadoDetalle : ClsPaginas DdlMoneda.DataBind(); //Carga Proveedor - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.Items.Insert(0, new ListItem("Todos", "-1")); - DdlProveedor.DataBind(); + DdlProveedores.setEsWebService(true); + DdlProveedores.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedores.SelectedText = "Todos"; + DdlProveedores.SelectedValue = "-1"; //Carga Usuarios DdlUsuario.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); @@ -87,7 +88,9 @@ public partial class Compras_RepPágadoDetalle : ClsPaginas DdlGrupo.SelectedValueExist(Request["Grupo"] == null ? "-1" : Request["Grupo"].ToString()); DdlProyecto.SelectedValueExist(Request["CveProyecto"] == null ? "-1" : Request["CveProyecto"].ToString()); DdlSubProyecto.SelectedValueExist(Request["CveSubProyecto"] == null ? "-1" : Request["CveSubProyecto"].ToString()); + DdlProveedor.SelectedValueExist(Request["CveProveedor"] == null ? "-1" : Request["CveProveedor"].ToString()); + DdlUsuario.SelectedValueExist(Request["CveUsuario"] == null ? "-1" : Request["CveUsuario"].ToString()); DdlResponsable.SelectedValueExist(Request["CveResponsable"] == null ? "-1" : Request["CveResponsable"].ToString()); DdlBanco.SelectedValueExist(Request["CveBanco"] == null ? "-1" : Request["CveBanco"].ToString()); diff --git a/Compras/RepPagadoPeriodo.aspx b/Compras/RepPagadoPeriodo.aspx index 3cc0b24ea..1b9988cdc 100644 --- a/Compras/RepPagadoPeriodo.aspx +++ b/Compras/RepPagadoPeriodo.aspx @@ -64,8 +64,10 @@
    Proveedor:
    - - + <%-- + --%> + +
    Fecha Inicial:
    diff --git a/Compras/RepPagadoPeriodo.aspx.cs b/Compras/RepPagadoPeriodo.aspx.cs index c514e6827..89e3b951d 100644 --- a/Compras/RepPagadoPeriodo.aspx.cs +++ b/Compras/RepPagadoPeriodo.aspx.cs @@ -50,9 +50,10 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas DdlMoneda.DataBind(); //Carga Proveedor - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.Items.Insert(0, new ListItem("Todos", "-1")); - DdlProveedor.DataBind(); + DdlProveedores.setEsWebService(true); + DdlProveedores.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedores.SelectedText = "Todos"; + DdlProveedores.SelectedValue = "-1"; //Carga Usuarios DdlUsuario.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); @@ -278,8 +279,8 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas StrFiltro.AppendFormat(" SubProyecto: {0}", DdlSubProyecto.SelectedItem.Text); if (DdlGrupo.SelectedValue != "-1") StrFiltro.AppendFormat(" Grupo: {0}", DdlGrupo.SelectedItem.Text); - if (DdlProveedor.SelectedValue != "-1") - StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedor.SelectedItem.Text); + if (DdlProveedores.SelectedValue != "-1") + StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedores.txtText.Value); if (DdlUsuario.SelectedValue != "-1") StrFiltro.AppendFormat(" Registro: {0}", DdlUsuario.SelectedItem.Text); if (DdlResponsable.SelectedValue != "-1") @@ -332,7 +333,7 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas { if (RblTipoCambio.SelectedValue.ToEntero() == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; } ClsCompras ObjCompras = new ClsCompras(); - if(ObjCompras.GetRepPagadoPeriodo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedor.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), + if(ObjCompras.GetRepPagadoPeriodo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedores.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), DdlUsuario.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero(), DdlResponsable.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, DdlBanco.SelectedValue.ToEntero(), DdlCuentaBancaria.SelectedValue.ToEntero(), DdlMoneda.SelectedValue.ToEntero(), TxtFechaICompra.Text.ToDate(), TxtFechaFCompra.Text.ToDate(), TipoCambio, TCEspecifico)){ diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx index d0a48c42f..153b98772 100644 --- a/Compras/eFacturas.aspx +++ b/Compras/eFacturas.aspx @@ -69,9 +69,16 @@
  • Bitácora Facturas
  • -
  • +
  • Vinculación Masiva Complementos
  • + +
  • + Personalizar +
  • + + + @@ -196,6 +203,7 @@ + @@ -260,6 +268,14 @@ + + <%--Folio Fiscal 11--%> + + + + + + <%----%> @@ -372,6 +388,13 @@ + + <%-- Folio Fiscal 9 --%> + + + + + @@ -485,6 +508,12 @@ + + <%-- Folio Fiscal 9 --%> + + + + @@ -898,6 +927,36 @@
    + + + + + + +