From 093d511a6caec84838698b38e36bed20766f03b4 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 31 Dec 2020 14:17:32 -0700 Subject: [PATCH 01/30] cuentas de bancos se actualizan con estatus del banco --- App_Code/ClsBancos.vb | 15 +++++++++++++++ Bancos/CatBancos.aspx.vb | 25 ++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index a2129f8a1..4e3b0b213 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4463,6 +4463,21 @@ Public Class ClsBancos Return Retorno End Function + Public Function InhabilitarCuentasBancos(CveBanco As Integer, Estatus As Boolean) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_InhabilitarCuentas") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveBanco", SqlDbType.Int).Value = CveBanco + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al inhabilitar las Cuentas Bancarias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function Public Function GetBancosSAT() As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_Sat_BancosGet") diff --git a/Bancos/CatBancos.aspx.vb b/Bancos/CatBancos.aspx.vb index 9a57ab193..0aee43f9b 100644 --- a/Bancos/CatBancos.aspx.vb +++ b/Bancos/CatBancos.aspx.vb @@ -119,6 +119,7 @@ Partial Class Bancos_CatBancos Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating Dim ObjBancos As New ClsBancos + ObjBancos.IniciaTransacSQL() Dim Banco As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtBanco"), TextBox).Text.Trim Dim Ejecutivo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEjecutivo"), TextBox).Text.Trim @@ -126,13 +127,27 @@ Partial Class Bancos_CatBancos Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked Dim CveBanco As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero + Dim TieneError As Boolean = False If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then - GvDatos.EditIndex = -1 - ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTBancos = ObjBancos.DtResultados - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + If ObjBancos.InhabilitarCuentasBancos(CveBanco, Estatus) Then + GvDatos.EditIndex = -1 + ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTBancos = ObjBancos.DtResultados + Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + Else + TieneError = True + End If + Else + TieneError = True + End If + + If TieneError Then + ObjBancos.RollBack() + Else + ObjBancos.Commit() + GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing End If ObjBancos.Dispose() From 40ba9adc0f10b6984bf7701c24bbfdb17155405b Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Jan 2021 11:59:23 -0700 Subject: [PATCH 02/30] --- correccion de campos, y de diferencia recibida por oc --- OC/OC.aspx | 4 ++-- OC/OC.aspx.vb | 28 ++++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/OC/OC.aspx b/OC/OC.aspx index a5c5ecb11..e622ac180 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -941,7 +941,7 @@ - + @@ -1961,7 +1961,7 @@ Cantidad - + diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 440141f5c..3b6988841 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -2761,7 +2761,7 @@ Partial Class OC For Each DrInv As DataRow In DtInvOC.FiltraParametros($"CveOrdenCompraDetalle = {dr("CveOrdenCompraDetalle").ToString.ToEntero} AND CveCompraDetalle < 1").Rows DrInvOCDiferencias = DtInvOCDiferencias.NewRow DrInvOCDiferencias("TipoCambioAjuste") = DrInv("TipoCambioAjuste").ToString.ToDouble - DrInvOCDiferencias("Diferencia") = ((dr("Importe").ToString.ToDouble * DrInv("TipoCambioAjuste").ToString.ToDouble) - DrInv("PU").ToString.ToDouble) * DrInv("Cantidad").ToString.ToDouble + DrInvOCDiferencias("Diferencia") = ((dr("Importe").ToString.ToDouble * DrInv("TipoCambioAjuste").ToString.ToDouble) - DrInv("PUOriginal").ToString.ToDouble) * DrInv("Cantidad").ToString.ToDouble DrInvOCDiferencias("CveAlmacen") = DrInv("CveAlmacen").ToString.ToEntero DrInvOCDiferencias("CveOrdenCompraDetalle") = DrInv("CveOrdenCompraDetalle").ToString.ToEntero DrInvOCDiferencias("ImporteMovto") = dr("Importe").ToString.ToDouble * DrInv("TipoCambioAjuste").ToString.ToDouble @@ -2853,14 +2853,11 @@ Partial Class OC IdCtaContableAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero If DiferenciaInvOC.RoundSQL() <> 0 Then + Dim tCveSubProyecto As Integer = 0 If CvePrePoliza > 0 Then - If DdlSubProyecto.SelectedValue <= 0 Then - Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia) - TieneError = True - Exit For - End If + tCveSubProyecto = DtDetalle.FiltroPrimeroValor("CveSubProyecto", "CveOrdenCompraDetalle =" & CveOCDetalle).ToEntero If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL() @@ -2877,7 +2874,7 @@ Partial Class OC ' Exit For 'End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=tCveSubProyecto) Then TieneError = True Exit For End If @@ -2895,7 +2892,7 @@ Partial Class OC '2018.11.24 se cambia concepto 176, de cargo a abono negativo., petición MALL '2019.03.26 se cambia concepto 177, de abono a cargo., petición MALL '2019.04.10 se cambia concepto 177, de cargo a abono., petición MALL - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, If(ConceptoSalida = 0, 177, 177), SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=tCveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, SerieFolio, 176, SerieFolio, Fecha, IdCtaContableRecepcionOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DiferenciaInvOC, CveOCDetalle:=CveOCDetalle) Then TieneError = True Exit For @@ -3551,8 +3548,11 @@ Partial Class OC If e.Row.RowType = DataControlRowType.DataRow Then Try - e.Row.FCLabel("LtlCantidad").Attributes.Add("data-toggle", "tooltip") - e.Row.FCLabel("LtlCantidad").Attributes.Add("Title", e.Row.DataKey("CveOrdenCompraDetalle")) + If e.Row.FCLabel("LtlCantidad") IsNot Nothing Then + e.Row.FCLabel("LtlCantidad").Attributes.Add("data-toggle", "tooltip") + e.Row.FCLabel("LtlCantidad").Attributes.Add("Title", e.Row.DataKey("CveOrdenCompraDetalle")) + End If + Catch ex As Exception End Try @@ -3749,7 +3749,7 @@ Partial Class OC - If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then + If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then 'empresa agricola e.Row.FCDropDownList("DdlCultivosCuadroEdit").Visible = True e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto").ToEntero}") e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataBind() @@ -3871,7 +3871,11 @@ Partial Class OC CveCultivoCuadroDetalle = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedValue.ToEntero - Cuadro = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedItem.Text + Cuadro = "" + If CveCultivoCuadroDetalle > 0 Then + Cuadro = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedItem.Text + End If + If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then From 029557c9496f73c269a019baffbaf18f176d6244 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Jan 2021 11:59:47 -0700 Subject: [PATCH 03/30] coreccion de proyecto asignado --- Contratos/Contrato.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index fb51b55b5..1653e71d9 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -1048,7 +1048,7 @@ Partial Class Contratos_Default TxtPorAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero TxtPorAmortizacionAnticipo.Text = ObjContratos.PorAmortizacionAnticipo.FormatoNumero TxtPorGarantia.Text = ObjContratos.PorGarantia.FormatoNumero - DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString + 'DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero) DdlSubProyectoContrato.SelectedValue = ObjContratos.CveSubProyecto.ToString TxtPorIVA.Text = ObjContratos.PorIVA.ToString From 19d906446858493f1d2fa5ff2b9eab2a05fa7eeb Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Jan 2021 12:00:12 -0700 Subject: [PATCH 04/30] contabilizacion de movimietnos --- Inventarios/ResguardoMaterial.aspx.vb | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 320899cee..95743d634 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -802,6 +802,7 @@ Partial Class Inventarios_ResguardoMaterial Private Sub Guardar(Concepto As Integer) Dim ObjInventario As New ClsInventarios Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL()) 'Inicia la transacción + Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim TieneError = False Dim MensajeError As String = "" Dim ImporteConcepto = 0.0 @@ -854,6 +855,7 @@ Partial Class Inventarios_ResguardoMaterial If Not TieneError Then CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenDestino.SelectedValue.ToEntero, 2, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservaciones.Text, CvePersonal:=CvePersonal, CveMovimientoRelacionado:=CveMovimientoSalida, CveCliente:=CveCliente, CveProveedor:=CveProveedor, Modulo:="ResgMat2") FolioEntrada = ObjInventario.Folio + Dim Importe As Decimal = 0 If CveMovimientoEntrada <= 0 Then MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar." @@ -862,6 +864,7 @@ Partial Class Inventarios_ResguardoMaterial If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim CveSeccionAlmacen As Integer = 0 + Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL For Each Dr As DataRow In ObjInventario.DtResultados.Rows If CBool(Dr("AplicaSeccion")) Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestino.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero @@ -880,6 +883,10 @@ Partial Class Inventarios_ResguardoMaterial Next End If End If + + 'registra la prepoliza + + ContabilizaMovimientoAlmacen(ObjConta, Fecha, "Resguardo", "ResgMat", CveMovimientoSalida, CveMovimientoEntrada, Importe, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) End If Case 24 'LIBERACION @@ -914,6 +921,7 @@ Partial Class Inventarios_ResguardoMaterial If Not TieneError Then CveMovimientoEntrada = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberacion.SelectedValue.ToEntero, 23, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Observaciones:=TxtObservacionesLiberacion.Text, CvePersonal:=CvePersonalLiberacion, CveMovimientoRelacionado:=CveMovimientoSalida, CveProveedor:=CveProveedorLiberacion, CveCliente:=CveClienteLiberacion, MovimientoFijo:=True, Modulo:="ResgMat4") FolioEntrada = ObjInventario.Folio + Dim Importe As Decimal = 0 If CveMovimientoEntrada <= 0 Then MensajeError = "Ocurrió un error al guardar el movimiento de entrada correctamente. Por favor vuelva a intentar." @@ -921,6 +929,7 @@ Partial Class Inventarios_ResguardoMaterial Else If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Cont = 0 + Importe = ObjInventario.DtResultados.SUMD("Total").RoundSQL For Each Dr As DataRow In ObjInventario.DtResultados.Rows Dim CveSeccionAlmacen As Integer = DiccionarioSecciones(Dr("CveMovimientoDetalle").ToString.ToEntero).ToString.ToEntero If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString) Then @@ -932,6 +941,9 @@ Partial Class Inventarios_ResguardoMaterial Cont += 1 Next End If + + ContabilizaMovimientoAlmacen(ObjConta, Fecha, "Resguardo", "ResgMat", CveMovimientoSalida, CveMovimientoEntrada, Importe, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) + End If End If @@ -981,6 +993,25 @@ Partial Class Inventarios_ResguardoMaterial ObjInventario.Dispose() ObjEventos.Dispose() End Sub + + Public Function ContabilizaMovimientoAlmacen(ByRef ObjConta As ClsContabilidad, Fecha As Date, Concepto As String, Modulo As String, CveMovimientoSalida As Integer, CveMovimientoEntrada As Integer, Importe As Decimal, CveUsuario As Integer, CveEmpresa As Integer, Contabilizable As Boolean) As Integer + Dim Retorno As Integer = -1 + Dim ErrorMovInv As Boolean = False + + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas(Modulo, 53, 0, 0, 1, Fecha, Concepto, CveUsuario, CveEmpresa) + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ErrorMovInv = True + End If + + If Not ErrorMovInv Then Retorno = CvePrePoliza + + Return Retorno + End Function + Private Function AgregarAgenda(ByRef ObjEventos As ClsOIEventos, FolioEntrada As Integer, FolioSalida As Integer) As Boolean Dim TieneError As Boolean = False Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1", CveAgendaTipo = 4, Prioridad = 3, CveTipoEvento = 2, Importe = -1 From 9441439c852cb5f71ce2e1dbcb15a654ef722d74 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Jan 2021 12:00:43 -0700 Subject: [PATCH 05/30] -- cambios temporales --- App_Code/ClsInventarios.vb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index b89221914..e4bdd741e 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5252,6 +5252,30 @@ Public Class ClsInventarios Return Retorno End Function + + 'Public Function GetMovimientosDetalleTransitorio(CveMovimiento As Integer, CveEmpresa As Integer) As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter(" + ' select t.FechaMovto, t.CveMovimiento, d.CvePS, d.Cantidad, d.PUOriginal,d.CveUM, dm.CveMovimiento, db.CveMovimientoDetalle from ( + ' select * from Inv_Movimientos m where CveConcepto = 27 and CveEmpresa = @CveEmpresa and + ' m.FechaMovto > '2020/10/01' and m.CveMovimiento = @CveMovimiento and not exists (select * from Conta_PrePolizasDetalle dd where dd.CveMovimientoAlmacen = m.CveMovimiento) + ' ) t left join Inv_MovimientosDetalle d on d.CveMovimiento = t.CveMovimiento left join Inv_MovimientosDetalle dm on dm.CveMovimientoDetalle = d.CveMovimientoDetalleEntrada + ' left join Inv_MovimientosDetalle db on db.CveMovimientoDetalleEntrada = dm.CveMovimientoDetalle and db.CveMovimiento = dm.CveMovimiento + 1 order by db.CveMovimientoDetalle ", CommandType.Text) + + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener los movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try + + ' Return Retorno + 'End Function + #Region "Proyeccion" Public Function AddMovimientosProyectados(CvePS As Integer, Cantidad As Decimal, TipoMovto As Integer) As Boolean Dim Retorno As Boolean = False From 3f05fa31b35ef55507e6ab3650ca07a1a881ec12 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Jan 2021 13:23:54 -0700 Subject: [PATCH 06/30] -- cambios en recepcion de traspaso --- Inventarios/TraspasoAlmacen.aspx | 2 +- Inventarios/TraspasoAlmacen.aspx.vb | 45 +++++++++++++++-------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 06766458f..eaf48f3d2 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -650,7 +650,7 @@
- + <%-- diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 5146a4a86..69e440040 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1532,7 +1532,7 @@ Partial Class Inventarios_TraspasoAlmacen If Dtt IsNot Nothing Then If TxtFolioRecepcion.Text.Trim <> "" Then - CveMovimientoSalida = ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimiento", "").ToEntero + CveMovimientoSalida = Dtt.FiltroPrimeroValor("CveMovimiento", "").ToEntero End If CveAlmacenDestino = DdlAlmacenRecepcion.SelectedValue.ToEntero @@ -1810,6 +1810,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim ObjInventario As New ClsInventarios Dim Dtt As DataTable = Nothing Dim CveMovimientoEntrada As Integer = 0 + Dim CveMovimientoSalidaTransitorio As Integer = 0 Dim Folio = 0 Dim ErrorMovInv As Boolean = False Dim TextoError = "" @@ -1845,15 +1846,15 @@ Partial Class Inventarios_TraspasoAlmacen 'AGREGAMOS LA SALIDA - 'CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, - ' Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11") + CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, + Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11") 'AGREGAMOS LA ENTRADA CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1") Folio = ObjInventario.Folio - If CveMovimientoSalida <= 0 Then + If CveMovimientoSalidaTransitorio <= 0 Then TextoError = "No se pudo generar el movimiento de salida correctamente" ErrorMovInv = True Else @@ -1887,12 +1888,12 @@ Partial Class Inventarios_TraspasoAlmacen TextoError = "Ocurrió un error al guardar los movimientos de salida" Exit For End If - ''MOV, Alm, Transito - 'If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then - ' ErrorMovInv = True - ' TextoError = "Ocurrió un error al guardar los movimientos de salida" - ' Exit For - 'End If + 'MOV, Alm, Transito + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then + ErrorMovInv = True + TextoError = "Ocurrió un error al guardar los movimientos de salida" + Exit For + End If ElseIf cantidadDisponibleValidacion < 0 Then TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString) @@ -1903,21 +1904,21 @@ Partial Class Inventarios_TraspasoAlmacen If Not ErrorMovInv Then Dim Concepto As String = TxtObservacionesRecepcion.Text If Concepto = "" Then Concepto = "Recepción Traspaso" - 'Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - 'If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then + Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then - ' Dim resultado As DataTable = ObjInventario.DtResultados - ' Dim importe As Decimal = resultado.SUMD("Total").RoundSQL - ' Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero + Dim resultado As DataTable = ObjInventario.DtResultados + Dim importe As Decimal = resultado.SUMD("Total").RoundSQL + Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then - ' ErrorMovInv = True - ' End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=importe, Contabilizable:=False) Then + ErrorMovInv = True + End If - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then - ' ErrorMovInv = True - ' End If - 'End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then + ErrorMovInv = True + End If + End If End If End If From a7c294374b4394b66e185fe588225cdc26ff1ade Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 5 Jan 2021 10:43:09 -0700 Subject: [PATCH 07/30] Pendientes BDH --- App_Code/Modelos.vb | 7 + Inventarios/RecepcionAlmacen.aspx.vb | 33 +++++ Ventas/Clientes.aspx | 2 +- Ventas/Clientes.aspx.vb | 2 +- Ventas/Ventas.aspx | 10 +- Ventas/Ventas.aspx.vb | 204 +++++++++++++++++++++------ 6 files changed, 210 insertions(+), 48 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index a01edf317..68dbd2bec 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -520,6 +520,11 @@ Namespace Modelos Me.DtOtrosConceptos = ObjVentas.DtResultados.Copy() End If + 'CARGA REMISIONES RELACIONADAS + If ObjVentas.GetRemisionesRelacionadas(CveVenta, TipoDocto) Then + Me.DtRemisionesDocumentosRelacionados = ObjVentas.DtResultados.Copy() + End If + ObjVentas.Dispose() If Me.RealizarDevolucionAlmacen Then @@ -5806,6 +5811,8 @@ Namespace Modelos Public Property DtDocumentacionCliente As Data.DataTable Public Property DtContratosSerieDetalle As Data.DataTable Public Property DtOtrosConceptos As Data.DataTable + + Public Property DtRemisionesDocumentosRelacionados As Data.DataTable Public Property DtInventario As Data.DataTable 'Public Property DtAnticipoAmortizacion As Data.DataTable Public Property DtRemConceptosSurtidos As Data.DataTable diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 097e61ba0..e45b5635f 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -2307,6 +2307,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) Dim ObjOC As New ClsOC(ObjInventario.IniciaTransacSQL()) Dim ObjAcum As New ClsAcumuladores(ObjInventario.IniciaTransacSQL()) + Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL()) Dim ObjContaAC As ClsContPAQi = Nothing Dim ObjContaContPAQ As ClsContPAQi = Nothing @@ -2629,6 +2630,36 @@ Partial Class Inventarios_RecepcionAlmacen If Not ErrorMovInv Then MovtosEntradaExA.Add(MovEntradaExA.CveMovimiento) FoliosEntradaExA.Add(MovEntradaExA.Folio) + + 'SI LA REMISION FUE FACTURADA GENERA EL MOVIMIENTO DE SALIDA DIRECTA + If ObjFactura.DtRemisionesDocumentosRelacionados.Rows.Count > 0 Then + If ObjVentas.VerificarRemisionFacturada(ObjFactura.CveVenta) Then + + Dim dttsalida As DataTable = dttexa.Copy + 'se limpia la seccion, para que lo tome automaticamente + For Each drr As DataRow In dttsalida.Rows + Dim RowFactura As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVentaDetalleRemision={drr("CveVentaDetalle")}") + drr("CveVentaDetalle") = RowFactura("CveVentaDetalleFacturada") + drr("CveVenta") = RowFactura("CveVenta") + Next + + For Each DrFactura As DataRow In Dt.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows + Dim dtSalidaFactura As DataTable = dttsalida.FiltraParametros($"CveVenta={DrFactura("CveVenta")}") + Dim MovSalidaDirectaExA = GenerarMovimientoAlmacenVenta(ObjFactura.CveAlmacenTraspasoDestino, 40, DrFactura("CveVenta").ToString().ToEntero(), MovEntradaExA.CveMovimiento, dtSalidaFactura, ObjInventario, ObjConta, ObjContaContPAQ, False, "RA/G2R3") + + ErrorMovInv = MovSalidaDirectaExA.CveMovimiento <= 0 + + If ErrorMovInv Then + Exit For + Else + MovtosSalidaDirecta.Add(MovSalidaDirectaExA.CveMovimiento) + FoliosSalidaDirecta.Add(MovSalidaDirectaExA.Folio) + End If + + Next + + End If + End If End If End If @@ -3459,6 +3490,8 @@ Partial Class Inventarios_RecepcionAlmacen link = String.Format("{1}", MovtosSalidaDirecta(index), FoliosSalidaDirecta(index)) Msg.AppendFormat("
Movimiento de Salida Folio: {0}", link) Next + + End If 'APARTADO diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index e64276495..8cb66d465 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -4281,7 +4281,7 @@ - + diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index a01b7bf92..c45fbd652 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -9143,7 +9143,7 @@ Partial Class Clientes Dim ImporteBonificacion As Decimal = 0 If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count >= 4 Then GvUsadosResumen.DataSource = ObjAcum.DtResultados - ImporteBonificacion = ObjAcum.DtResultados.Rows(4)("Valor").ToString().ToDecimal() + ImporteBonificacion = ObjAcum.DtResultados.Rows(5)("Valor").ToString().ToDecimal() End If GvUsadosResumen.DataBind() diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 13e2eaef7..3ea56173b 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1371,16 +1371,16 @@ - Total NC: + Pronto Pago: - +   - Pronto Pago: + Total a Pagar: - +   @@ -6340,8 +6340,8 @@
- +
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1fc944559..1af853887 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2582,7 +2582,7 @@ Partial Class Ventas 'DdlEstatus.SelectedValueExist("2") ConfiguraTipoDocto() - CargaFolios() + BtnEmitirImprimir.Text = "Facturar" BtnEmitirImprimir.Visible = True @@ -2615,6 +2615,7 @@ Partial Class Ventas End If If Not ExFolioFactura Then SetPermisos() + If CveVenta < 1 Then CargaFolios() 'SELECCIONA VENDEDOR DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE If UsuarioActual.CveVendedor > 0 Then @@ -4819,7 +4820,8 @@ Partial Class Ventas Else BtnGenerarRemision.Visible = False End If - BtnsFacturar.Visible = True + If UsuarioActual.TienePermisoProceso(60) Then BtnsFacturar.Visible = True 'puede facturar + LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274) End If End If @@ -5895,7 +5897,7 @@ Partial Class Ventas LnkCotizaciones.Visible = False End If UPCondicionesPago.Update() - ElseIf UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then + ElseIf UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 146, 158, 140) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then RBLPago.SelectedValue = "1" RBLPago_SelectedIndexChanged(Nothing, Nothing) UPCondicionesPago.Update() @@ -5969,7 +5971,7 @@ Partial Class Ventas End If If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) Else - If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) + If Alertas AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) End If 'RBLPago.SelectedValue = "2" @@ -5990,6 +5992,9 @@ Partial Class Ventas LnkPedido2SinFacturar.Visible = False LnkCotizaciones.Visible = False LnkOCs.Visible = False + + Else + If Alertas AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) End If End If UPPCreditoDisponible.Update() @@ -10795,19 +10800,30 @@ Partial Class Ventas End Try 'SI SE FACTURA UNA RNC SE MUESTRA - If UsuarioActual.CveEmpresa = 140 AndAlso factura.TipoDocto = "Egs" Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso factura.TipoDocto = "Egs" Then If Row("CveVentaDetalleRNC").ToString().ToEntero() > 0 Then If Not ObjVentas.AddVentaDetalleRNCFacturada(Row("CveVentaDetalleRNC").ToString().ToEntero(), ObjVentas.CveVentaDetalle, Row("Cantidad").ToString().ToDecimal()) Then ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.") End If + Dim EsCargo As Boolean = False + Dim ListaRNC As List(Of Modelos.Factura) = Nothing + + If NCDescuento Then + EsCargo = (Not ListaNCDescuento.Any(Function(RNC) RNC.Num2 = 1)) + ListaRNC = ListaNCDescuento + Else + EsCargo = RblRNCTipo.SelectedValue = "1" + ListaRNC = ListaRemisionesNC + End If + 'SI SE FACTURAN RNC DE CARGO, SE AGREGA EL CONCEPTO DE ACREDITAMIENTO - If ClienteEsDistribuidor AndAlso RblRNCTipo.SelectedValue = "1" Then + If ListaRNC IsNot Nothing AndAlso ClienteEsDistribuidor AndAlso EsCargo Then Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL()) Dim CvePSCargo As Integer = -1 - For Each RNC In ListaRemisionesNC + For Each RNC In ListaRNC CvePSCargo = RNC.DtDetalle.FiltroPrimeroValor("CvePS", $"CveVentaDetalle={Row("CveVentaDetalleRNC").ToString()}").ToEntero() If CvePSCargo > 0 Then Exit For @@ -15870,13 +15886,13 @@ Partial Class Ventas If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 AndAlso (Not CveVenta > 0 Or EsCreaApartirDe Or CveDevolucion > 0) Then RecalculaIVA() 'ViewState("SubProyectoPorcentajeIVA") = dr("IVA") ViewState("TipoFormato") = dr("TipoFormato") - ViewState("Serie") = dr("Serie") + 'ViewState("Serie") = dr("Serie") - If UsuarioActual.CveEmpresa = 140 AndAlso Me.CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then - LblSerie.Text = SerieVenta - Else - LblSerie.Text = dr("Serie").ToString() - End If + 'If UsuarioActual.CveEmpresa = 140 AndAlso Me.CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then + ' LblSerie.Text = SerieVenta + 'Else + ' LblSerie.Text = dr("Serie").ToString() + 'End If If SerieXML <> "" Then LblSerie.Text = SerieXML Dim CveSubProyecto As Integer = GetSubProyectoSucursal() @@ -16274,7 +16290,7 @@ Partial Class Ventas End If 'SI TIENE PRONTO PAGO CALCULA EL IMPORTE - If RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then + If DdlTipoComprobante.SelectedValue = "Ing" AndAlso RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then Dim TotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D @@ -17376,6 +17392,11 @@ Partial Class Ventas TotalAmortizacion = 0 End If + Dim TotalRemNCAplicado As Decimal = 0 + + If TbDescuentosRNC.Visible AndAlso ListaNCDesc IsNot Nothing Then + TotalRemNCAplicado = ListaNCDesc.Sum(Function(RNC) RNC.TotalRemNCAplicado) + End If Total = (TotalSubTotal - TotalDescuentos - TotalAmortizacion + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales) LblSubTotal1.Text = TotalSubTotal.FormatoNumero(2) @@ -17391,6 +17412,8 @@ Partial Class Ventas HdnProntoPago.Value = TotalProntoPago.ToString() LblProntoPago.Text = TotalProntoPago.FormatoNumero(2) + LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero + LblAmort.Text = TxtSubTotal.Text If CveVenta <= 0 OrElse (CveDevolucion > 0 And NuevaFactura = 1) Then HdnVentaSaldo.Value = Total.ToString() @@ -20111,7 +20134,7 @@ Partial Class Ventas End If If UsuarioActual.Empresa.Funcionalidad(572) = "1" Then - Dim TotalNC As Decimal = If((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0), LblTotalNC.Text.Trim().ToDecimal(), 0) + Dim TotalNC As Decimal = If((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0), LblTotalAPagar.Text.Trim().ToDecimal(), 0) If TotalNC > 0 Then If (DtPagos.SUM("Importe").ToString().ToDecimal() + AmortizacionNC + Total - TxtCambio.Text.ToDecimal) > TotalNC Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) @@ -24204,7 +24227,8 @@ Partial Class Ventas Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer)) If CargarBonificaciones Then - Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy() + 'Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy() + CargaBonificaciones(-1, True) End If If CargarSoloGarantias Then @@ -24212,10 +24236,10 @@ Partial Class Ventas Else GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False") End If - GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas - GvRemisionesNC.DataBind() - GvRemisionesNCBon.DataBind() + + 'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas + 'GvRemisionesNCBon.DataBind() If CveVentaUsado > 0 Then DivSMU.Visible = True @@ -24344,6 +24368,11 @@ Partial Class Ventas Dim ChkAplicarRNC As CheckBox = DirectCast(sender, CheckBox) Dim GvRow As GridViewRow = DirectCast(ChkAplicarRNC.NamingContainer, GridViewRow) + CargaBonificacionesDesc(GvRow.DataKey("CveVenta").ToEntero(), ChkAplicarRNC.Checked) + + End Sub + + Private Sub CargaBonificacionesDesc(CveVentaRNCCargo As Integer, AplicarRNC As Boolean) If TmpDTRNCBonificacionesSeleccionadas Is Nothing Then TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone() End If @@ -24353,7 +24382,7 @@ Partial Class Ventas Dim SbFiltro As New StringBuilder() SbFiltro.Append("CveVenta IN(") Using ObjAcum As New ClsAcumuladores - If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then + If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then DtBon = ObjAcum.DtResultados.Copy() End If End Using @@ -24370,7 +24399,7 @@ Partial Class Ventas For Each bon In queryBonificacion SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion) - ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) + ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) Next SbFiltro.Remove(SbFiltro.Length - 1, 1) SbFiltro.Append(")") @@ -24384,9 +24413,9 @@ Partial Class Ventas RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion) RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion) - RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").ToEntero() + RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo - If ChkAplicarRNC.Checked Then + If AplicarRNC Then TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray) Else For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString()) @@ -24410,12 +24439,16 @@ Partial Class Ventas LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()) UpDescNC.Update() - End Sub Protected Sub ChkAplicarNCBon_CheckedChanged(sender As Object, e As EventArgs) Dim ChkAplicarRNC As CheckBox = DirectCast(sender, CheckBox) Dim GvRow As GridViewRow = DirectCast(ChkAplicarRNC.NamingContainer, GridViewRow) + CargaBonificaciones(GvRow.DataKey("CveVenta").ToEntero(), ChkAplicarRNC.Checked) + + End Sub + + Private Sub CargaBonificaciones(CveVentaRNCCargo As Integer, AplicarRNC As Boolean) If TmpDTRNCBonificacionesSeleccionadas Is Nothing Then TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone() End If @@ -24425,16 +24458,18 @@ Partial Class Ventas Dim SbFiltro As New StringBuilder() SbFiltro.Append("CveVenta IN(") Using ObjAcum As New ClsAcumuladores - If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then + If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=CveVentaRNCCargo) Then DtBon = ObjAcum.DtResultados.Copy() End If End Using If DtBon IsNot Nothing Then Dim queryBonificacion = From dr In DtBon - Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero + Where dr("CveVentaBonificacion").ToString().ToEntero > 0 + Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero, CveVenta = dr("CveVenta").ToString().ToEntero Into x = Group Select New With { + .CveVentaRNCCargo = CveVenta, .CveVentaBonificacion = CveVentaBonificacion, .ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal), .IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal) @@ -24442,7 +24477,7 @@ Partial Class Ventas For Each bon In queryBonificacion SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion) - ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) + ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = bon.CveVentaRNCCargo, .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion}) Next SbFiltro.Remove(SbFiltro.Length - 1, 1) SbFiltro.Append(")") @@ -24456,9 +24491,9 @@ Partial Class Ventas RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion) RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion) - RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").ToEntero() + RowBonificacion("CveVentaRNCCargo") = CveVentaRNCCargo - If ChkAplicarRNC.Checked Then + If AplicarRNC Then TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray) Else For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString()) @@ -24482,7 +24517,6 @@ Partial Class Ventas LtlSMUBon.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()) UpModalRemisionesNC.Update() - End Sub Protected Sub GvDescNCCargos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCCargos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -24518,6 +24552,12 @@ Partial Class Ventas End If End If End Sub + Protected Sub GvRemisionesNCBon_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCBon.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);") + e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});") + End If + End Sub Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs) Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0 @@ -24905,7 +24945,7 @@ Partial Class Ventas Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False - For Each RowUsado As DataRow In RNC.DtDetalle.Rows + For Each RowUsado As DataRow In RNC.DtDetalle.FiltraParametros("", Orderby:="PU").Rows Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() @@ -24989,7 +25029,7 @@ Partial Class Ventas Dim TotalAcumuladoRNC As Decimal = 0 Dim Terminar As Boolean = False - For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows + For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}", Orderby:="PU").Rows Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() @@ -25082,7 +25122,7 @@ Partial Class Ventas Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault() - For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows + For Each RowCargo As DataRow In RNCCargo.DtDetalle.FiltraParametros("", Orderby:="PU").Rows Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total) @@ -26494,8 +26534,12 @@ Partial Class Ventas If Not DtCotizaciones.Columns.Contains("Aplicado") Then DtCotizaciones.Columns.Add("Aplicado", Type.GetType("System.Boolean")) End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0 AND EsAcumulador = False") + Else + GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0") + End If - GvCotPS.DataSource = DtCotizaciones.FiltraParametros("Cantidad > 0") End If ObjVentas.Dispose() GvCotPS.DataBind() @@ -26563,6 +26607,11 @@ Partial Class Ventas For Each row As DataRow In DTSeleccionadas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows CotizacionesLista.Add(row("CveVenta").ToString().ToEntero()) Next + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + CalculaUsadosCotizacion(Cves, DTSeleccionadas, DtCotizaciones) + End If + Else For Each row As DataRow In DTSeleccionadas.Rows If CveMetodoPago <> -1 And row("CveMetodoPago33").ToString().ToEntero() <> CveMetodoPago Then @@ -26607,6 +26656,74 @@ Partial Class Ventas UpPS.Update() UpParametros.Update() End Sub + + Private Sub CalculaUsadosCotizacion(ByRef SbVentasDetalle As StringBuilder, ByVal DTSeleccionadas As DataTable, ByVal DtCotizaciones As DataTable) + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Dev") Then + + Dim DTTamanios As DataTable = GlobalDTAcumTamaños() + + Dim DTCvePSCostos As DataTable = DTTamanios.FiltraParametros("", "", {"CvePSCargo"}) + + Dim TmpDTCalculo As DataRow() = DTSeleccionadas.Rows.Cast(Of DataRow).ToArray() + + Dim DTPSTemp As New DataTable '= TmpDT.Clone + + DTPSTemp.Columns.Add("CveVenta", GetType(Integer)) + DTPSTemp.Columns.Add("Cantidad", GetType(Integer)) + DTPSTemp.Columns.Add("CvePS", GetType(Integer)) + DTPSTemp.Columns.Add("PU", GetType(Decimal)) + + For Each DrowPartidas As DataRow In TmpDTCalculo + Dim CveTamanioTemp As Integer = DrowPartidas("CveTamaño").ToString().ToEntero() + Dim CveVenta As Integer = DrowPartidas("CveVenta").ToString().ToEntero() + + If CveTamanioTemp > 0 Then + + Dim DTTamanioTemp As New DataTable + Dim CvePsTemp As Integer = DTTamanios.FiltraParametros($"CveTamaño = { CveTamanioTemp } ").Rows(0)("CvePSCargo").ToString().ToEntero() + + Dim Cargo As Decimal = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { CveTamanioTemp }").ToDecimal + + If DTPSTemp.FiltraParametros($"CvePs = { CvePsTemp }").Rows.Count > 0 Then + + For Each dRowUpdate As DataRow In DTPSTemp.Rows + + If (dRowUpdate("CvePS").ToString().ToEntero() = CvePsTemp) Then + dRowUpdate("Cantidad") = dRowUpdate("Cantidad").ToString().ToDecimal + DrowPartidas("Cantidad").ToString().ToDecimal + dRowUpdate("PU") = Cargo ' dRowUpdate("Total").ToString().ToDecimal + ImporteCargo + dRowUpdate("CveVenta") = CveVenta + End If + Next + + DTPSTemp.AcceptChanges() + + Else + Dim dRowNuevo As DataRow = DTPSTemp.NewRow + + dRowNuevo("CvePS") = CvePsTemp + dRowNuevo("Cantidad") = DrowPartidas("Cantidad").ToString().ToDecimal + dRowNuevo("PU") = Cargo + dRowNuevo("CveVenta") = CveVenta + + DTPSTemp.Rows.Add(dRowNuevo) + DTPSTemp.AcceptChanges() + End If + + End If + Next + + For Each drowPsTamaños As DataRow In DTPSTemp.Rows + + If drowPsTamaños("PU").ToString().ToDecimal > 0 Then + + Dim CveVentaDetalleUsado = DtCotizaciones.FiltroPrimeroValor("CveVentaDetalle", $"CveVenta = {drowPsTamaños("CveVenta")} AND CvePS = {drowPsTamaños("CvePS")}").ToEntero() + SbVentasDetalle.AppendFormat("{0},", CveVentaDetalleUsado) + + End If + Next + + End If + End Sub Private Sub VerificaCotizaciones(ByRef dt As DataTable) If ChkCotProductos.Checked Then For Each Gvr As GridViewRow In GvCotPS.Rows @@ -28377,13 +28494,15 @@ Partial Class Ventas End Sub Protected Sub BtnAplicarDesc_Click(sender As Object, e As EventArgs) Try - Dim CveSATNC = "84111506" - Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0) + Dim DrPS As DataRow = Nothing Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray()) - If ArrayNC.Length > 0 Then - Dim CvePSNC As Integer = ArrayNC(0).ToEntero() + If ArrayNC.Length >= 4 Then + Dim CvePSNC As Integer = ArrayNC(3).ToEntero() DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSNC, AplicaParaVenta:=1).Rows(0) + Else + Dim CveSATNC = "84111506" + DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0) End If If DrPS Is Nothing Then @@ -28426,7 +28545,7 @@ Partial Class Ventas 'SI TIENE ALGUN AJUSTE O GARANTIA If ListaNCDesc.Any(Function(RNC) RNC.Num2 = 1) Then - For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1) + For Each RNC In ListaNCDesc.Where(Function(x) x.Num2 = 1) Dim Salir As Boolean = False Dim NCAjuste As Integer = -1 @@ -28491,9 +28610,12 @@ Partial Class Ventas ListaNCDesc.Clear() Exit Sub End If + + Dim TotalProntoPago As Decimal = TmpDT.SUM("ImporteProntoPago").ToDecimal + HdnTotalRNC.Value = TotalRemNCAplicado.ToString() LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero - LblTotalNC.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado).FormatoNumero + LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero Dim CvePS = DrPS("CvePS").ToString().ToEntero() @@ -29410,7 +29532,7 @@ Partial Class Ventas DtImpuestos.AcceptChanges() Dim AcumuladoNC As Decimal = 0 - DtImpuestos.Merge(CargaDtImpuestosNC(ObjFactura.CveVenta, ObjFactura.DescuentoProntoPago), True, MissingSchemaAction.Ignore) + DtImpuestos.Merge(CargaDtImpuestosNCProntoPago(ObjFactura.CveVenta, ObjFactura.DescuentoProntoPago), True, MissingSchemaAction.Ignore) DtImpuestos = CargaTotalesImpuestosProntoPago(DtImpuestos) From 5fe0c8622f3c4bb0f21c592f5f9ca06869944a46 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 5 Jan 2021 14:24:42 -0700 Subject: [PATCH 08/30] bandera de cancelacion --- Bancos/IE.aspx.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 15833e3e0..7c6dcf10c 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1118,8 +1118,9 @@ Partial Class Bancos_IE End If + 'DATOS DE CANCELACION - If ObjIE.CveEstatusIE = 2 Then + If ObjIE.CveEstatusIE = 2 OrElse (ObjIE.CveEstatusIE = 1 AndAlso ObjIE.CveIECancelacion > 0) Then TabCancelacion.Visible = True LbUsuarioCancelacion.Text = ObjIE.UsuarioCancelacion LbFechaCancelacion.Text = ObjIE.FechaCancelacion.ToShortDateString From 8f992a4af8b45e6ad35e17a5749c921fd6aa03fc Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 5 Jan 2021 14:25:02 -0700 Subject: [PATCH 09/30] transitorios --- Inventarios/TraspasoAlmacen.aspx.vb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 69e440040..28c5f2777 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1889,10 +1889,14 @@ Partial Class Inventarios_TraspasoAlmacen Exit For End If 'MOV, Alm, Transito - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al guardar los movimientos de salida" - Exit For + If gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero > 0 Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=gvr.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then + ErrorMovInv = True + TextoError = "Ocurrió un error al guardar los movimientos de salida" + Exit For + End If + Else + CveMovimientoSalidaTransitorio = 0 End If ElseIf cantidadDisponibleValidacion < 0 Then @@ -1910,16 +1914,20 @@ Partial Class Inventarios_TraspasoAlmacen Dim resultado As DataTable = ObjInventario.DtResultados Dim importe As Decimal = resultado.SUMD("Total").RoundSQL Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero + Dim tCveConcepto As Integer = 68 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=importe, Contabilizable:=False) Then + If CveMovimientoSalidaTransitorio = 0 Then + tCveConcepto = 289 + End If + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, tCveConcepto, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=importe, Contabilizable:=False) Then ErrorMovInv = True End If If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then - ErrorMovInv = True + ErrorMovInv = True + End If End If End If - End If End If From c48c0d858386113eba589533387516c551b82239 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 5 Jan 2021 18:54:25 -0700 Subject: [PATCH 10/30] -- mejoras en devoluciones --- Compras/Compras.aspx.vb | 63 ++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index bedc186b0..868a61171 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1837,25 +1837,25 @@ Partial Class Compras_Compras 'TmpDT.Columns.Add("IEPSPSPorcentaje") 'TmpDT.Columns.Add("IEPSPSIVAPorcentaje") SubTotalConceptos = Math.Round(TmpDT.SUM("Total"), 2).ToDecimal - AddPS2(False) + AddPS2(False) - 'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101 - Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") - For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows + 'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101 + Dim ProductosCodigoSATNoPermitidos As New StringBuilder("") + For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows - ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", drr("PS")) + ProductosCodigoSATNoPermitidos.AppendFormat("{0}
", drr("PS")) - Next + Next - If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then - Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) - Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) - - End If + If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then + Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:

{0}", ProductosCodigoSATNoPermitidos.ToString) + Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia) End If - Else + + End If + Else CargaConceptosXML(XMLDoc) End If @@ -4714,7 +4714,7 @@ Partial Class Compras_Compras ViewState("CveCompra") = ObjCompras.CveCompra If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then - Devolucion = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate) + Devolucion = guardardevolucion(ObjInventario, ObjCompras.CveCompra, TxtSubTotal.Text.ToDecimal, TxtFecha.Text.Trim.ToDate) TieneError = Devolucion.TieneError End If @@ -7143,6 +7143,10 @@ Partial Class Compras_Compras End If End If + If CveCompraRefacturacion > 0 Then + importeMovimiento = 0 + importeMN = 0 + End If Case 59 'Documentos importeMovimiento = importeCreditos @@ -14258,7 +14262,7 @@ Partial Class Compras_Compras '*se envia true si hubo un error*' - Private Function guardardevolucion(ObjInventario As ClsInventarios, CveCompra As Integer, subtotal As Double, Fecha As Date) As MMensajeDevolucion + Private Function guardardevolucion(ObjInventario As ClsInventarios, CveCompra As Integer, subtotal As Decimal, Fecha As Date) As MMensajeDevolucion Dim ErrorMovInv As Boolean = False Dim CveAlmacen As Integer = DdlAlmacenDevolucion.SelectedValue.ToEntero() Dim subtotaldevolucion As Double = 0 @@ -14266,6 +14270,7 @@ Partial Class Compras_Compras Dim CveMovimientoEntrada As Integer = -1 'Calculo los subtotales para comparar con la NC Dim cantidad As Double = 0.0 + Dim TotalAlmacen As Decimal = 0 For Each Dr As GridViewRow In GVDevolucion.Rows 'CveAlmacen = Dr.DataKey("CveAlmacen").ToString.ToEntero @@ -14285,14 +14290,24 @@ Partial Class Compras_Compras If CveMovimientoEntrada <= 0 Then ErrorMovInv = True Else + Dim Acumulado As Decimal = 0 + Dim PU As Decimal = 0 For Each Dr As GridViewRow In GVDevolucion.Rows If Dr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDouble, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("PU").ToString.ToDecimal, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then + Acumulado += (Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal) + PU = Dr.DataKey("PU").ToString.ToDecimal + If subtotal < Acumulado Then + Dim dif As Decimal = subtotal - Acumulado + PU = (((Dr.FCTextBox("TxtCantidad").Text.ToDecimal * Dr.DataKey("PU").ToString.ToDecimal)) + dif) / Dr.FCTextBox("TxtCantidad").Text.ToDecimal + End If + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr.FCTextBox("TxtCantidad").Text.ToDouble, Dr.DataKey("CveUM").ToString.ToEntero, Dr.DataKey("CvePS").ToString.ToEntero, PU, -1, CveMovimientoDetalleEntrada:=Dr.DataKey("CveMovimientoDetalle").ToString.ToEntero) Then ErrorMovInv = True Exit For End If End If Next + End If Else ErrorMovInv = True @@ -14354,18 +14369,18 @@ Partial Class Compras_Compras 'End Sub Protected Sub BtnVinculaDevolucion_Click(sender As Object, e As EventArgs) Try - Dim subtotaldevolucion As Double = 0 + Dim subtotaldevolucion As Decimal = 0 Dim realizadevolucion As Boolean = False 'Calculo los subtotales para comparar con la NC - Dim cantidad As Double = 0.0 + Dim cantidad As Decimal = 0 For Each Dr As GridViewRow In GVDevolucion.Rows - cantidad = Dr.FCTextBox("TxtCantidad").Text.ToDouble + cantidad = Dr.FCTextBox("TxtCantidad").Text.ToDecimal If cantidad > 0 Then realizadevolucion = True - subtotaldevolucion += Dr.DataKey("PU").ToString.ToDouble * cantidad + subtotaldevolucion += Dr.DataKey("PU").ToString.ToDecimal * cantidad End If Next @@ -14399,6 +14414,7 @@ Partial Class Compras_Compras Dim IEPSCompra As Decimal = TxtIEPS.Text.ToDecimal() Dim RetIVACompra As Decimal = TxtRetIVA.Text.ToDecimal() Dim RetISRCompra As Decimal = TxtRetISR.Text.ToDecimal() + Dim Acumulado As Decimal = 0 'Dim TotalCalculable As Decimal = TotalCompra - IEPSCompra + RetIVACompra + RetISRCompra @@ -14428,6 +14444,15 @@ Partial Class Compras_Compras Dim IVA As Decimal = IVAPorcentajeCompra 'Math.Round(Total * IVAPorcentajeCompra, 2) Dim Descuento As Decimal = 0 + Acumulado += (PU * Cantidad) + + If SubTotalCompra < Acumulado Then + 'ajusta el valor + Dim dif As Decimal = SubTotalCompra - Acumulado + PU = ((PU * Cantidad) + dif) / Cantidad + Total = Cantidad * PU + End If + AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, 0, 0, 0, 0, Descuento, -1, False) End If From 6046add3779954cca633aacee0cdcecc3208e6ea Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 6 Jan 2021 17:37:25 -0700 Subject: [PATCH 11/30] Cambios Cotizaciones --- Ventas/Ventas.aspx.vb | 89 +++++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 28 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1af853887..08e03eb7a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3981,7 +3981,7 @@ Partial Class Ventas Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero() - If UsuarioActual.Empresa.Funcionalidad(135) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TipoEstatus = 5 Then + If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TipoEstatus = 5 Then If UsuarioActual.TienePermisoProceso(159) Then Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto"))) If TienePermiso <> "" Then @@ -4087,7 +4087,7 @@ Partial Class Ventas End If - + 'SI LA AUTORIZACION ES POR SUPERVISOR, BUSCA EL SUPERVISOR QUE TIENE EL VENDEDOR If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then 'Reviso cuales son los supervisores Dim Objeto As New ClsVtaVendedores @@ -4104,7 +4104,7 @@ Partial Class Ventas If TipoEstatus = 2 Then LkCotizacionAutorizar.Visible = False - ElseIf TipoEstatus = 2 Then + ElseIf TipoEstatus = 5 Then LkCotizacionAutorizar.Visible = False End If End If @@ -4113,8 +4113,18 @@ Partial Class Ventas Objeto.Dispose() End If - String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString()) - + 'SI LA AUTORIZACION ES POR PERMISO, BUSCA QUE EL USUARIO TENGA EL PERMISO PARA AUTORIZAR + If UsuarioActual.Empresa.Funcionalidad(135) = "2" Then + 'Reviso cuales son los supervisores + If UsuarioActual.TienePermisoProceso(116) Then + LkCotizacionAutorizar.Visible = True + If TipoEstatus = 2 Then + LkCotizacionAutorizar.Visible = False + ElseIf TipoEstatus = 5 Then + LkCotizacionAutorizar.Visible = False + End If + End If + End If Case "Ant" Trsaldo.Visible = True @@ -4872,30 +4882,47 @@ Partial Class Ventas 'Verifico si tiene la funcionalidad (135) - If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135) = "1" Then - 'Reviso cuales son los supervisores - Dim ObjVendedores As New ClsVtaVendedores + If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then - If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then - Dim DTVendedores As New DataTable - If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then - DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor)) - End If + Select Case UsuarioActual.Empresa.Funcionalidad(135) + Case "1" ' POR SUPERVISOR + Dim ObjVendedores As New ClsVtaVendedores - 'Verifico si es su supervisor asignado - If DTVendedores.Rows.Count > 0 Then - If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then - BtnsFacturar.Visible = True - BtnGenerarRemision.Visible = True - Else - BtnsFacturar.Visible = False - BtnGenerarRemision.Visible = False + If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then + Dim DTVendedores As New DataTable + If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then + DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor)) + End If + + 'Verifico si es su supervisor asignado + If DTVendedores.Rows.Count > 0 Then + If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then + BtnsFacturar.Visible = True + BtnGenerarRemision.Visible = True + Else + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False + End If + End If + + DTVendedores.Dispose() End If - End If + ObjVendedores.Dispose() + + Case "2" ' POR PERMISO + If UsuarioActual.TienePermisoProceso(116) Then + If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then + BtnsFacturar.Visible = True + BtnGenerarRemision.Visible = True + Else + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False + End If + End If + + End Select + - DTVendedores.Dispose() - End If - ObjVendedores.Dispose() End If If DdlTipoComprobante.SelectedValue = "Cot" Then @@ -15478,7 +15505,7 @@ Partial Class Ventas TrAlmacenAsignado.Visible = False TrAlmacenOrigen.Visible = False - If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135) = "1" Then + If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then Alert("Se ocupa una autorización.", TipoMensaje.MsgAdvertencia) TrDireccion.Visible = False TrCiudad.Visible = False @@ -21210,8 +21237,14 @@ Partial Class Ventas ObjVentas.Dispose() If ActualizoEstatus Then - 'GeneraPDFCotizacion(True) - Alert("La cotización ha sido enviada al correo de nuestro cliente:" & Mail) + + If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then + GeneraPDFCotizacion(True) + Alert("La cotización ha sido enviada al correo de nuestro cliente:" & Mail) + ElseIf UsuarioActual.Empresa.Funcionalidad(135) = "2" Then + Alert("La cotización ha sido autorizada.") + End If + Else Alert("No se pudo autorizar la cotización", TipoMensaje.MsgError) End If From 6055cae050dc06bed33e79fe97aaf64097f652e3 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 7 Jan 2021 10:50:26 -0700 Subject: [PATCH 12/30] -- pac 5 --- App_Code/Timbrado.vb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 56fce0da2..42549491e 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -2688,6 +2688,15 @@ Public Class Timbrado #Region "Timbra" If ArchivoGenerado Then + Dim opciones As String() = New String(0) {"CALCULAR_SELLO"} + Dim pade = New PADE33.PadeTimbradoServiceClient + Dim Respuesta As String = pade.timbradoPrueba("72330711-cac6-4106-8051-cbcda1aef495", "rene.molina@adssistemas.mx", "Facturacion2021#", cfdi.Xml, opciones) + ' Aumentamos el timeout de la operación + + Dim FolioFiscal As String + FolioFiscal = obtenerAtributo(Respuesta, "TimbreFiscalDigital", "UUID") 'XmlDoc.DocumentElement("cfdi:Complemento").FirstChild.Attributes("UUID").InnerText + + 'cfdi.TimbrarCfdi(UsuarioServicio, ClaveServicio, UrlServicio, TimbraProduccion) 'sw.Stop() From 7d794e1e1d8de0a01a806bcb28c2238a05a9bd64 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 7 Jan 2021 10:50:41 -0700 Subject: [PATCH 13/30] -- estatus de cotizacion --- Ventas/RepCotizacionesxFacturar.aspx | 5 ++++- Ventas/RepCotizacionesxFacturar.aspx.vb | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Ventas/RepCotizacionesxFacturar.aspx b/Ventas/RepCotizacionesxFacturar.aspx index 0d45cd200..f475fb070 100644 --- a/Ventas/RepCotizacionesxFacturar.aspx +++ b/Ventas/RepCotizacionesxFacturar.aspx @@ -171,7 +171,10 @@
- + +
+ +
<%--
diff --git a/Ventas/RepCotizacionesxFacturar.aspx.vb b/Ventas/RepCotizacionesxFacturar.aspx.vb index 8f4a49951..34059ca2e 100644 --- a/Ventas/RepCotizacionesxFacturar.aspx.vb +++ b/Ventas/RepCotizacionesxFacturar.aspx.vb @@ -74,7 +74,7 @@ Partial Class RepCotizacionesxFacturar Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString - If ObjVentas.GetRepCotizacionesSinFacturar(FechaI.ToDate, FechaF.ToDate, Sucursales, CveCliente, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + If ObjVentas.GetRepCotizacionesSinFacturar(FechaI.ToDate, FechaF.ToDate, Sucursales, CveCliente, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveEstatusFactura:=DdlEstatusFactura.SelectedValue.ToEntero) Then GvDatos.DataSource = ObjVentas.DtResultados DtVentas = ObjVentas.DtResultados GvDatos.DataBind() @@ -139,6 +139,14 @@ Partial Class RepCotizacionesxFacturar DdlSubProyectos.DataSource() = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) DdlSubProyectos.DataBind() 'DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) + + 'DdlEstatusFactura.DataSource = GlobalDTEstatusFactura().FiltraParametros("TipoDocto = 'Cot'") + 'DdlEstatusFactura.DataBind() + DdlEstatusFactura.Items.Add(New ListItem("Registrada", "2")) + DdlEstatusFactura.Items.Add(New ListItem("Supervisada", "8")) + DdlEstatusFactura.Items.Add(New ListItem("Cancelada", "10")) + DdlEstatusFactura.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub #End Region From d436c83d7e4faab851bb5a82f5c252115483c836 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 7 Jan 2021 10:51:19 -0700 Subject: [PATCH 14/30] pac5 web service --- App_WebReferences/PADE33/Reference.svcmap | 32 ++ App_WebReferences/PADE33/Timbrado3.wsdl | 284 ++++++++++++++++++ App_WebReferences/PADE33/Timbrado3.xsd | 252 ++++++++++++++++ .../PADE33/configuration.svcinfo | 10 + .../PADE33/configuration91.svcinfo | 201 +++++++++++++ 5 files changed, 779 insertions(+) create mode 100644 App_WebReferences/PADE33/Reference.svcmap create mode 100644 App_WebReferences/PADE33/Timbrado3.wsdl create mode 100644 App_WebReferences/PADE33/Timbrado3.xsd create mode 100644 App_WebReferences/PADE33/configuration.svcinfo create mode 100644 App_WebReferences/PADE33/configuration91.svcinfo diff --git a/App_WebReferences/PADE33/Reference.svcmap b/App_WebReferences/PADE33/Reference.svcmap new file mode 100644 index 000000000..0bfba4957 --- /dev/null +++ b/App_WebReferences/PADE33/Reference.svcmap @@ -0,0 +1,32 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/Timbrado3.wsdl b/App_WebReferences/PADE33/Timbrado3.wsdl new file mode 100644 index 000000000..20ff39a6d --- /dev/null +++ b/App_WebReferences/PADE33/Timbrado3.wsdl @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/Timbrado3.xsd b/App_WebReferences/PADE33/Timbrado3.xsd new file mode 100644 index 000000000..a986a6652 --- /dev/null +++ b/App_WebReferences/PADE33/Timbrado3.xsd @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/configuration.svcinfo b/App_WebReferences/PADE33/configuration.svcinfo new file mode 100644 index 000000000..34a3fd535 --- /dev/null +++ b/App_WebReferences/PADE33/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/PADE33/configuration91.svcinfo b/App_WebReferences/PADE33/configuration91.svcinfo new file mode 100644 index 000000000..fdf001f3e --- /dev/null +++ b/App_WebReferences/PADE33/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + PadeTimbradoServicePortBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://timbrado.pade.mx:80/servicio/Timbrado3.3 + + + + + + basicHttpBinding + + + PadeTimbradoServicePortBinding + + + PADE33.PadeTimbradoService + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + PadeTimbradoServicePort + + + + + + + + + + + \ No newline at end of file From fd1b73393a6fd5cc31807d424b6a02ea9016ba08 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 7 Jan 2021 10:51:30 -0700 Subject: [PATCH 15/30] -- filtro esatus cotizaciones por facturar --- App_Code/ClsVentas.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index d0648d098..a4b949dfd 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2719,7 +2719,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetRepCotizacionesSinFacturar(FechaI As Date, FechaF As Date, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Public Function GetRepCotizacionesSinFacturar(FechaI As Date, FechaF As Date, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional CveEstatusFactura As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepCotizacionesSinFacturarGet") @@ -2729,6 +2729,7 @@ Public Class ClsVentas .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta End With From bb221284f1cdf73f359cf82df73519c19a6bf0f6 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 7 Jan 2021 20:46:52 -0700 Subject: [PATCH 16/30] CAMBIOS AGREGANDO CAMPOS DE PS Y GIRO DE EMPRESAS EN CLIENTES --- App_Code/ClsCRM.vb | 20 ++++++++++++++----- CRM/Acercamiento.aspx | 7 +++++-- CRM/Acercamiento.aspx.cs | 30 ++++++++++++++++++++++++++-- CRM/EmpresaCRM.aspx | 11 +++++++++++ CRM/EmpresaCRM.aspx.cs | 38 ++++++++++++++++++++++++++++++++---- CRM/RepAcercamientos.aspx | 17 +++++++++++++--- CRM/RepAcercamientos.aspx.cs | 13 +++++++++--- Ventas/Clientes.aspx | 6 +++--- Ventas/Clientes.aspx.vb | 10 +++++----- 9 files changed, 125 insertions(+), 27 deletions(-) diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index a07d2a7d3..2c84fb3e1 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -431,7 +431,8 @@ Public Class ClsCRM Return Retorno End Function - Public Function AddEmpresaCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, CveEncuestaAplicada As Integer, CveVendedor As Integer, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Integer + Public Function AddEmpresaCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, CveEncuestaAplicada As Integer, CveVendedor As Integer, + Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional CveGiroClasificacion As Integer = -1) As Integer Dim CveEmpresaCRM As Integer = -1 DataAdapter("PA_CRM_EmpresaAdd") With SqlAdapter.SelectCommand.Parameters @@ -444,6 +445,7 @@ Public Class ClsCRM .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -456,7 +458,8 @@ Public Class ClsCRM Return CveEmpresaCRM End Function - Public Function UpdateEmpresCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresaCRM As Integer, CveVendedor As Integer, CveUsuarioMod As Integer, Optional CveCliente As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1") As Boolean + Public Function UpdateEmpresCRM(NombreEmpresa As String, RFC As String, CveMedioCaptacion As Integer, CveEmpresaCRM As Integer, CveVendedor As Integer, CveUsuarioMod As Integer, + Optional CveCliente As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional CveGiroClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_EmpresaUpdate") With SqlAdapter.SelectCommand.Parameters @@ -469,6 +472,7 @@ Public Class ClsCRM .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@Correo", SqlDbType.VarChar).Value = Correo + .Add("@CveGiroClasificaciones", SqlDbType.Int).Value = CveGiroClasificacion End With Try SqlAdapter.Fill(Data) @@ -651,7 +655,8 @@ Public Class ClsCRM Public Function GetAcercamiento(CveEmpresa As Integer, Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamiento As Integer = -1, Optional CveTipoProceso As Integer = -1, Optional CveVendedor As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1", Optional NombreAcercamiento As String = "-1", Optional CveMedioCaptacion As Integer = -1, Optional CveRechazoMotivo As Integer = -1, Optional CveProbabilidad As Integer = -1, - Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1", Optional TopSelect As Integer = 10000) As Boolean + Optional FechaApertura As String = "-1", Optional FechaCierre As String = "-1", Optional TopSelect As Integer = 10000, Optional CvePS As Integer = -1, + Optional CveGiroClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoGet") With SqlAdapter.SelectCommand.Parameters @@ -675,6 +680,9 @@ Public Class ClsCRM .Add("@FechaCierre", SqlDbType.VarChar).Value = FechaCierre .Add("@TopSelect", SqlDbType.Int).Value = TopSelect + + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveGiroClasificacion", SqlDbType.Int).Value = CveGiroClasificacion End With Try SqlAdapter.Fill(Data) @@ -688,7 +696,7 @@ Public Class ClsCRM Public Function AddAcercamiento(CveEmpresaCRM As Integer, CveContactoPrincipal As Integer, CveTipoProceso As Integer, CveEtapaProcesoActual As Integer, CveVendedor As Integer, CveMedioCaptacion As Integer, CveRechazoMotivo As Integer, CveProbabilidadAcercamiento As Integer, FechaApertura As DateTime, NombreAcercamiento As String, Descripcion As String, Importe As Double, Comision As Double, Prioridad As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, - Optional FechaCierre As Nullable(Of DateTime) = Nothing) As Integer + Optional FechaCierre As Nullable(Of DateTime) = Nothing, Optional CvePS As Integer = -1) As Integer Dim _CveAcercamiento As Integer = -1 DataAdapter("PA_CRM_AcercamientoAdd") @@ -714,6 +722,7 @@ Public Class ClsCRM .Add("@Prioridad", SqlDbType.Int).Value = Prioridad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuarioIng", SqlDbType.Int).Value = CveUsuarioIng + .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With @@ -729,7 +738,7 @@ Public Class ClsCRM Public Function UpdateAcercamiento(CveAcercamiento As Integer, CveContactoPrincipal As Integer, CveTipoProceso As Integer, CveEtapaProcesoActual As Integer, CveVendedor As Integer, CveMedioCaptacion As Integer, CveProbabilidadAcercamiento As Integer, NombreAcercamiento As String, Descripcion As String, Importe As Double, Comision As Double, Prioridad As Integer, CveUsuarioMod As Integer, Optional CveRechazoMotivo As Integer = -1, Optional CveEncuestaAplicadaProceso As Integer = -1, - Optional FechaApertura As Nullable(Of DateTime) = Nothing, Optional FechaCierre As Nullable(Of DateTime) = Nothing) As Boolean + Optional FechaApertura As Nullable(Of DateTime) = Nothing, Optional FechaCierre As Nullable(Of DateTime) = Nothing, Optional CvePS As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_CRM_AcercamientoUpdate") With SqlAdapter.SelectCommand.Parameters @@ -755,6 +764,7 @@ Public Class ClsCRM .Add("@CveRechazoMotivo", SqlDbType.Int).Value = CveRechazoMotivo .Add("@FechaApertura", SqlDbType.DateTime).Value = IIf(FechaApertura Is Nothing, SqlTypes.SqlDateTime.Null, FechaApertura) .Add("@FechaCierre", SqlDbType.DateTime).Value = IIf(FechaCierre Is Nothing, SqlTypes.SqlDateTime.Null, FechaCierre) + .Add("@CvePS", SqlDbType.Int).Value = CvePS End With Try SqlAdapter.Fill(Data) diff --git a/CRM/Acercamiento.aspx b/CRM/Acercamiento.aspx index ef2aec956..4fac5eeab 100644 --- a/CRM/Acercamiento.aspx +++ b/CRM/Acercamiento.aspx @@ -405,12 +405,15 @@
<%-- style="padding-bottom: 17px;" --%>
- + <%----%>
- +
+ + +
diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index 3890d6dc8..30c7a064f 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -234,6 +234,18 @@ public partial class CRM_Acercamiento : ClsPaginas ViewState["CveAcercamientoGasto"] = value; } } + private int CvePS + { + get + { + return ViewState["CvePS"] == null ? -1 : ViewState["CvePS"].ToString().ToEntero(); + } + + set + { + ViewState["CvePS"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -269,6 +281,7 @@ public partial class CRM_Acercamiento : ClsPaginas } } } + CargarPS(); } } @@ -322,6 +335,8 @@ public partial class CRM_Acercamiento : ClsPaginas CveEncuestaAplicadaProceso = (ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() : -1; //CveEtapaBitacoraSeleccionada = CveEtapaActual; + CvePS = ObjCRM.DtResultados.FiltroPrimeroValor("CvePS").ToEntero(); + HdfEtapaSeleccionada.Value = CveEtapaActual.ToString(); //INHABILITAMOS CAMPOS QUE NO SE PUEDEN EDITAR DdlEmpresaCRM.Enabled = false; @@ -556,6 +571,17 @@ public partial class CRM_Acercamiento : ClsPaginas if (DTEtapasProceso.FiltroPrimeroValor("CveTipoEtapa", String.Format("CveEtapaProceso = {0}", DdlEtapaProceso.SelectedValue.ToEntero())).Contiene("1", "2", "3")) GuardarCambioEtapa(); } + + private void CargarPS() + { + DdlPS.setEsWebService(true); + if(CvePS > 0) + { + string productoAsignado = get_GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS: CvePS).FiltroPrimeroValor("PSCodigo"); + DdlPS.SelectedValue = CvePS.ToString(); + DdlPS.SelectedText = productoAsignado; + } + } #endregion #region "GUARDAR" @@ -605,7 +631,7 @@ public partial class CRM_Acercamiento : ClsPaginas } if ((CveEncuestaAplicadaProceso != 0) && ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento, - NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre)) + NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS:DdlPS.SelectedValue.ToEntero())) { //String MensajeBitacora = (CveEtapaProcesoActualActualizar != CveEtapaActual) ? String.Format("Se actualizó la etapa del acercamiento a {0}.", DTEtapasProceso.FiltroPrimeroValor("EtapaProceso", "CveEtapaProceso = " + CveEtapaProcesoActualActualizar)) : String.Format("Se actualizó el Acercamiento {0} con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text); @@ -671,7 +697,7 @@ public partial class CRM_Acercamiento : ClsPaginas int CveUsuarioIng = UsuarioActual.CveUsuario; if (ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento, - NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre)) + NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS: DdlPS.SelectedValue.ToEntero())) { CveEtapaActual = CveEtapaProcesoActualActualizar; HdfEtapaSeleccionada.Value = CveEtapaProcesoActualActualizar.ToString(); diff --git a/CRM/EmpresaCRM.aspx b/CRM/EmpresaCRM.aspx index 9ff6a1393..24e763256 100644 --- a/CRM/EmpresaCRM.aspx +++ b/CRM/EmpresaCRM.aspx @@ -109,6 +109,11 @@ +
+ + +
+ <%-- DATOS DINAMICOS - TABLA ENCUESTA --%> @@ -676,6 +681,12 @@ +
+
+ + +
+
diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 85ff85b65..93b909e00 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -217,6 +217,19 @@ public partial class CRM_EmpresaCRM : ClsPaginas ViewState["DtProbabilidadAcercamiento"] = value; } } + + private int CveGiroClasificacion + { + get + { + return ViewState["CveGiroClasificacion"].ToString().ToEntero(); + } + + set + { + ViewState["CveGiroClasificacion"] = value; + } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -237,6 +250,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas CargaDatosTecnicos(); } VerificaPermisos(); + CargaClasificaciones(); + DdlPS.setEsWebService(true); } } @@ -274,7 +289,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas { string Mensaje = ""; //DATOS GENERALES - CveEmpresaCRM = ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CveEncuestaAplicada, CveVendedorActualizar, CveSubProyecto, Correo); + CveEmpresaCRM = ObjCRM.AddEmpresaCRM(NombreEmpresa, RFC, CveMedioCaptacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CveEncuestaAplicada, CveVendedorActualizar, CveSubProyecto, Correo, DdlGiroClasificacion.SelectedValue.ToEntero()); if (CveEmpresaCRM > 0) { @@ -321,7 +336,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveEncuestaAplicada = GuardaDatosTecnicos(ObjDatosTecnicos, CveEncuestaAplicada); } - if ((CveEncuestaAplicada != 0) && ObjCRM.UpdateEmpresCRM(NombreEmpresa, RFC, CveMedioCaptacion, CveEmpresaCRM, CveVendedorActualizar, UsuarioActual.CveUsuario, CveSubProyecto: CveSubProyecto, Correo: Correo)) + if ((CveEncuestaAplicada != 0) && ObjCRM.UpdateEmpresCRM(NombreEmpresa, RFC, CveMedioCaptacion, CveEmpresaCRM, CveVendedorActualizar, UsuarioActual.CveUsuario, CveSubProyecto: CveSubProyecto, Correo: Correo,CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) { if (!ObjBitacora.AddEventoBitacora(String.Format("Se actualizó la empresa {0} con RFC {1}", NombreEmpresa, RFC), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM)) { @@ -628,8 +643,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveVendedor = ObjCRM.DtResultados.FiltroPrimeroValor("CveVendedorAsignado").ToEntero(); CveSubProyecto = ObjCRM.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero(); CveCliente = ObjCRM.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero(); + CveGiroClasificacion = ObjCRM.DtResultados.FiltroPrimeroValor("CveGiroClasificacion").ToEntero(); - if(!(CveCliente > 0)) + if (!(CveCliente > 0)) { HplCrearCliente.Visible = true; HplCrearCliente.NavigateUrl = String.Format("/Ventas/Clientes.aspx?CveEmpresaCRM={0}", CveEmpresaCRM); @@ -652,6 +668,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas BtnEliminarEmpresa.Enabled = false; DivBitacora.Visible = false; + + CveGiroClasificacion = -1; } ObjCRM.Dispose(); @@ -665,6 +683,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas else { CreaTempDTContactos(); + CveGiroClasificacion = -1; } DdlVendedorAsignado.SelectedValueExist(CveVendedor); @@ -1429,7 +1448,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (ObjCRM.DtResultados.Rows.Count > 0) { CveAcercamiento = ObjCRM.AddAcercamiento(CveEmpresaCRM, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActual, CveVendedor, CveMedioCaptacion, CveRechazoMotivo, CveProbabilidadAcercamiento, - FechaApertura, NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveEmpresa, CveUsuarioIng); + FechaApertura, NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveEmpresa, CveUsuarioIng, CvePS:DdlPS.SelectedValue.ToEntero()); }else { Alert("No tiene 'Etapa Proceso' con el 'Proceso' seleccionado al agregar el Acercamiento",ModExtensiones.TipoMensaje.MsgAdvertencia); @@ -1487,7 +1506,9 @@ public partial class CRM_EmpresaCRM : ClsPaginas BtnEliminarEmpresa.Visible = false; if (!UsuarioActual.TienePermisoProceso(251)) + { LnkAgregarAcercamiento.Visible = false; + } if ((UsuarioActual.CveVendedor != CveVendedor)) { @@ -1545,4 +1566,13 @@ public partial class CRM_EmpresaCRM : ClsPaginas CargaMetodosCaptacion(); UpDatos.Update(); } + + private void CargaClasificaciones() + { + DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); + DdlGiroClasificacion.DataSource = dtGiroClasificaciones; + DdlGiroClasificacion.DataBind(); + DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlGiroClasificacion.SelectedValueExist(CveGiroClasificacion); + } } \ No newline at end of file diff --git a/CRM/RepAcercamientos.aspx b/CRM/RepAcercamientos.aspx index 7ae9adb04..7b6db4b54 100644 --- a/CRM/RepAcercamientos.aspx +++ b/CRM/RepAcercamientos.aspx @@ -20,7 +20,7 @@
- <%----%> +
@@ -54,13 +54,24 @@
+ +
+
+ +
+
+
- <%--
diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs index b9443e390..579b7e035 100644 --- a/CRM/RepAcercamientos.aspx.cs +++ b/CRM/RepAcercamientos.aspx.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Extensiones; +using System.Data; public partial class CRM_RepAcercamientos : ClsPaginas { @@ -42,13 +43,13 @@ public partial class CRM_RepAcercamientos : ClsPaginas { CveVendedor = DdlVendedor.SelectedValue.ToEntero(); - if (CveVendedor > 0) + if (true) { string FechaInicio = TxtFechaInicio.Text == "" ? "-1" : TxtFechaInicio.Text; string FechaFin = TxtFechaFin.Text == "" ? "-1" : TxtFechaFin.Text; - + int CvePS = DdlPS.SelectedValue.ToEntero() == 0 ? -1 : DdlPS.SelectedValue.ToEntero(); ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin)) + if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) { GVDatos.DataSource = ObjCRM.DtResultados; GVDatos.DataBind(); @@ -84,6 +85,12 @@ public partial class CRM_RepAcercamientos : ClsPaginas //CALCULAMOS EL INTERVALO DE LA SEMANA ACTUAL TxtFechaInicio.Text = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek) + 1).ToShortDateString(); //TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString(); + DdlPS.setEsWebService(true); + + DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); + DdlGiroClasificacion.DataSource = dtGiroClasificaciones; + DdlGiroClasificacion.DataBind(); + DdlGiroClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); } #endregion } \ No newline at end of file diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 8cb66d465..3da1f0d6a 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -577,10 +577,10 @@ -
+ <%--
-
+
--%>
@@ -607,7 +607,7 @@
- +
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index c45fbd652..981ee8b46 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -1465,7 +1465,7 @@ Partial Class Clientes TxtEmailCotizacion.Text = ObjClientes.MailCotizacion TxtNotificar.Text = ObjClientes.NotificarA TxtPagina.Text = ObjClientes.Pagina - TxtGiro.Text = ObjClientes.Giro + 'TxtGiro.Text = ObjClientes.Giro DdlPrecioLista.SelectedValue = ObjClientes.CvePrecioLista.ToString TxtCC.Text = ObjClientes.NotificarA ChkMail.Checked = ObjClientes.EnviarFactura @@ -2520,11 +2520,11 @@ Partial Class Clientes MetodoPago = 1 End If - + Dim Giro As String = If(DdlClasificacion.SelectedValue.ToEntero() <> -1, DdlClasificacion.SelectedItem.Text, "") If ObjClientes.AddCliente(TxtNombre.Text.Trim, TxtNombreComercial.Text.Trim, TxtDireccion.Text.Trim, TxtNoExt.Text.Trim, TxtNoInt.Text.Trim, TxtColonia.Text.Trim, TxtLocalidad.Text.Trim, TxtCiudad.Text.Trim, DdlEstadoSAT.SelectedItem.Text.Trim, DdlSATPais.SelectedItem.Text.Trim, TxtRFC.Text.Trim, TxtCP.Text.Trim, TxtTelefono.Text.Trim.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), - TxtContacto.Text.Trim, TxtEmail.Text.Trim, TxtEmailCotizacion.Text.Trim, TxtNotificar.Text.Trim, TxtPagina.Text.Trim, TxtGiro.Text.Trim, DdlPrecioLista.SelectedValue.ToEntero, ChkMail.Checked, TxtRetIVA.Text.ToDouble, + TxtContacto.Text.Trim, TxtEmail.Text.Trim, TxtEmailCotizacion.Text.Trim, TxtNotificar.Text.Trim, TxtPagina.Text.Trim, Giro, DdlPrecioLista.SelectedValue.ToEntero, ChkMail.Checked, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, ChkRetIVAFletesAcarreos.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtNombreCorto.Text.Trim, DdlVendedor.SelectedValue.ToEntero, TxtPlazoCobranza.Text.Trim.ToEntero, TxtPlazoCobranzaRemision.Text.Trim.ToEntero, DiasPago, DdlTipoPago.SelectedValue, DdlCtaContableClientes.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableAnticipos.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableRetIVA.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableRetISR.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableFondoGarantia.SelectedValue.ToEntero, @@ -2617,9 +2617,9 @@ Partial Class Clientes Else NombreCliente = TxtNombre.Text.Trim() End If - + Dim Giro As String = If(DdlClasificacion.SelectedValue.ToEntero() <> -1, DdlClasificacion.SelectedItem.Text, "") If ObjClientes.UpdateCliente(NombreCliente, TxtNombreComercial.Text.Trim, TxtDireccion.Text.Trim, TxtNoExt.Text.Trim, TxtNoInt.Text.Trim, TxtColonia.Text.Trim, TxtLocalidad.Text.Trim, TxtCiudad.Text.Trim, DdlEstadoSAT.SelectedItem.Text.Trim, DdlSATPais.SelectedItem.Text.Trim, TxtRFC.Text.Trim, TxtCP.Text.Trim, - TxtTelefono.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), TxtContacto.Text.Trim, TxtEmail.Text.Trim, TxtEmailCotizacion.Text.Trim, TxtNotificar.Text.Trim, TxtPagina.Text, TxtGiro.Text, DdlPrecioLista.SelectedValue.ToEntero, ChkMail.Checked, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, ChkRetIVAFletesAcarreos.Checked, + TxtTelefono.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""), TxtContacto.Text.Trim, TxtEmail.Text.Trim, TxtEmailCotizacion.Text.Trim, TxtNotificar.Text.Trim, TxtPagina.Text, Giro, DdlPrecioLista.SelectedValue.ToEntero, ChkMail.Checked, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, ChkRetIVAFletesAcarreos.Checked, ChkEstado.Checked, TxtNombreCorto.Text.Trim, DdlVendedor.SelectedValue.ToEntero, TxtPlazoCobranza.Text.Trim.ToEntero, TxtPlazoCobranzaRemision.Text.Trim.ToEntero, DiasPago, DdlTipoPago.SelectedValue, DdlCtaContableClientes.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableAnticipos.SelectedValue.ToEntero, DdlCtaContableAnticipos.SelectedItem.Text, DdlCtaContableRetIVA.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableRetISR.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableFondoGarantia.SelectedValue.ToEntero, DdlCtaContableClientes.SelectedItem.Text, DdlCtaContableCompClientes.SelectedValue.ToEntero, DdlCtaContableCompClientes.SelectedItem.Text, DdlCtaContableCompAnticipos.SelectedValue.ToEntero, DdlCtaContableCompAnticipos.SelectedItem.Text, From e7e5f460223857b54d94f79a1b63aa6c23f6cf76 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 9 Jan 2021 10:36:23 -0700 Subject: [PATCH 17/30] Quitar caracter pipe al timbrar --- Ventas/Ventas.aspx.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 08e03eb7a..795ac6f44 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10158,6 +10158,8 @@ Partial Class Ventas End If End If + tPS = tPS.Replace("|", " ") + If tPS.Length >= 1000 Then Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999) tPS = tPSRecortado From 01543f21991c45966e5ca04d02e78387a2ad4b8c Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 9 Jan 2021 10:37:07 -0700 Subject: [PATCH 18/30] Tab de almacen al aplicar NC --- Compras/Compras.aspx | 10560 +++++++++++++++++++------------------- Compras/Compras.aspx.vb | 92 +- 2 files changed, 5428 insertions(+), 5224 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 7150832a1..172bf3174 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -1,131 +1,131 @@ -<%@ Page Title="Compras - Registro de Facturas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" ValidateRequest="false" CodeFile="Compras.aspx.vb" Inherits="Compras_Compras" EnableEventValidation="false" %> - - - - - - - -
  • - -
  • -
    -
    - - -
  • - -
  • -
  • - Agregar Concepto -
  • -
  • - Imprimir XML -
  • -
  • - Imprimir PDF -
  • -
  • - Ver Almacen -
  • -
  • - Imprimir Desglose -
  • -
  • - Agregar PS -
  • -
  • - Agregar Otros Gastos -
  • -
  • - Costo Indirecto/Importaciones -
  • - - -
  • - -
  • -
    -
    - - -
  • - -
  • -
    -
    - - - -
  • - Descontabilizar -
  • -
    - - - -
    -
  • - Contabilizar -
  • -
  • - Pagar -
  • - - -
  • - <%----%> - Solicitar Devolución -
  • -
    -
    - - +<%@ Page Title="Compras - Registro de Facturas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" ValidateRequest="false" CodeFile="Compras.aspx.vb" Inherits="Compras_Compras" EnableEventValidation="false" %> + + + + + + + +
  • + +
  • +
    +
    + + +
  • + +
  • +
  • + Agregar Concepto +
  • +
  • + Imprimir XML +
  • +
  • + Imprimir PDF +
  • +
  • + Ver Almacen +
  • +
  • + Imprimir Desglose +
  • +
  • + Agregar PS +
  • +
  • + Agregar Otros Gastos +
  • +
  • + Costo Indirecto/Importaciones +
  • + + +
  • + +
  • +
    +
    + + +
  • + +
  • +
    +
    + + + +
  • + Descontabilizar +
  • +
    + + + +
    +
  • + Contabilizar +
  • +
  • + Pagar +
  • + + +
  • + <%----%> + Solicitar Devolución +
  • +
    +
    + + -
  • - Contratos +
  • + Contratos
  • -
    - -
    - - - -
    - -
  • - Fletes -
  • -
  • - - - Complementos Pago - - - - -
  • -
  • - Actualizar Tipo Cambio -
  • - - <%-- 25/05/2018 - Link a Paqueterias Guias --%> - - -
  • - Agregar Guía -
  • -
    -
    - -
    - - - +
    + + + + + + + +
  • + Fletes +
  • +
  • + + + Complementos Pago + + + + +
  • +
  • + Actualizar Tipo Cambio +
  • + + <%-- 25/05/2018 - Link a Paqueterias Guias --%> + + +
  • + Agregar Guía +
  • +
    +
    + +
    + + + - - - Registro de Compras - - - - + + + + Registro de Compras + + + + <%-- - --%> - - -
    -
    - - -
    -
    -
    - - Datos de factura de Compra -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    + --%> + + +
    +
    + + +
    +
    +
    + + Datos de factura de Compra +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    <%-- - --%> - Proveedor: - <%--Proveedor:--%> - <%-- Proveedor:--%> -
    - - - - - -
    -
    -
    - Tipo: -
    - - - - - - -
    -
    -
    -
    - # O.C.: -
    - -
    - - -
    -
    -
    -
    -
    -
    - -
    - - - -
    - -
    - - - - - -
    -
    -
    -
    -
    - -
    - - - -
    -
    -
    -
    -
    -
    - Fecha Factura: -
    -
    - - - - - - - - - - - - - -
    -
    -
    -
    - Descripción: -
    - - - -
    -
    -
    - Refacturación: -
    - - -
    -
    -
    - ¿Es No Deducible? -
    - -
    -
    - - - + --%> + Proveedor: + <%--Proveedor:--%> + <%-- Proveedor:--%> +
    + + + + + +
    +
    +
    + Tipo: +
    + + + + + + +
    +
    +
    +
    + # O.C.: +
    + +
    + + +
    +
    +
    +
    +
    +
    + +
    + + + +
    + +
    + + + + + +
    +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    +
    +
    + Fecha Factura: +
    +
    + + + + + + + + + + + + + +
    +
    +
    +
    + Descripción: +
    + + + +
    +
    +
    + Refacturación: +
    + + +
    +
    +
    + ¿Es No Deducible? +
    + +
    +
    + + + <%--
    Tipo Gasto:
    @@ -333,1591 +333,1635 @@
    -
    --%> -
    -
    -
    - - -
    - -
    - - -
    -
    -
    - - Estatus -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - Sucursal: -
    - - -
    -
    -
    - -
    - Estatus: -
    -
    - - - - - -
    -
    -
    - Importe: -
    +
    --%> +
    +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    + + Estatus +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Sucursal: +
    + + +
    +
    +
    + +
    + Estatus: +
    +
    + + + + + +
    +
    +
    + Importe: +
    -
    -
    -
    - Saldo: -
    + +
    +
    +
    + Saldo: +
    -
    -
    -
    - Contabilizada: -
    - - <%----%> - <%----%> -
    -
    -
    - Tipo Factura: -
    - -
    -
    -
    - Validada SAT: -
    - - No - Si - -
    -
    -
    - Capturó: -
    - -
    -
    -
    - F. Captura -
    - -
    -
    -
    - Tipo Compra: -
    - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    - - -
    - - - - -
    -
    -
    -
    - - La factura no se puede registrar: - -
    -
    -
    -
    - - - - - - - - - - - -
    -
    -
    - - Presupuesto Egresos General -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    - - - -
    -
    -
    -
    - - - - -
    -
    -
    -
    - - - - -
    -
    -
    -
    - - - -
    -
    -
    -
    - <%--$--%> - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - - -
    - - - <%--width="100%"--%> - - - - + + + +
    + Contabilizada: +
    + + <%----%> + <%----%> +
    +
    +
    + Tipo Factura: +
    + +
    +
    +
    + Validada SAT: +
    + + No + Si + +
    +
    +
    + Capturó: +
    + +
    +
    +
    + F. Captura +
    + +
    +
    +
    + Tipo Compra: +
    + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + +
    +
    +
    +
    + + La factura no se puede registrar: + +
    +
    +
    +
    + + + + + + + + + + + +
    +
    +
    + + Presupuesto Egresos General +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + + +
    +
    +
    +
    + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + <%--$--%> + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + + +
    + +
    #CantUnidad
    + <%--width="100%"--%> + + + + - - + + + + + + +
    + +
    + + - - - -
    -
    - - - - - - - - - - - -
    #CantUnidad Clasificación + + + +     - -
    - -
    -
    - Producto o Servicio
    Observación - + + + + + +
    + +
    +
    + Producto o Servicio
    Observación +   - - -
    - -
    - -
    Tipo de Gasto - -
    -
    -
    P.U. % IVA Total ¿No Deducible? Comandos
    - - - - - - -
    -
    - - - -
    - <%----%> -
    -
    -
    - - - -
    -
    - -
    -
    -
    - - - - - - - -
    -
    - - - - - <%-- 0 --%> - - - - - - <%-- 1 --%> - - <%-- 2 --%> - - - - - - - <%-- 3 --%> - - -
    - - - - -
    - -
    -
    -
    - <%-- 4 --%> - - <%-- 5 --%> - - - - - - - - - <%-- 6 --%> - - <%-- 7 --%> - - <%-- 8 --%> - - - - - - <%-- 9 --%> - - - <%-- 10 --%> - - - - - - - <%-- 11 --%> - - - - - - <%-- 12 --%> - - - - - - <%-- 13 --%> - - - - - - <%-- 14 --%> - - - - - - <%-- 15 --%> - - - - - - <%-- 16 --%> - - - - - - <%-- 17 --%> - - - - - -
    -
    - - -
    - -
    -
    - - - - - - + + + + + +
    +
    + + P.U.  + % IVA  + Total  +
    + ¿No Deducible?  +
    + Comandos + + + + + + + + + + + + +
    +
    + + + +
    + <%----%> +
    +
    +
    + + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + <%-- 0 --%> + + + + + + <%-- 1 --%> + + <%-- 2 --%> + + + + + + + <%-- 3 --%> + + +
    + + + + +
    + +
    +
    +
    + <%-- 4 --%> + + <%-- 5 --%> + + + + + + + + + <%-- 6 --%> + + <%-- 7 --%> + + <%-- 8 --%> + + + + + + <%-- 9 --%> + + + <%-- 10 --%> + + + + + + + <%-- 11 --%> + + + + + + <%-- 12 --%> + + + + + + <%-- 13 --%> + + + + + + <%-- 14 --%> + + + + + + <%-- 15 --%> + + + + + + <%-- 16 --%> + + + + + + <%-- 17 --%> + + + + + +
    +
    + + +
    + +
    +
    + + + + + +       - - - - Factura - - - - - - Fecha - - - - - - Total - - - - - - - Anticipo/NC - + + + + + Factura + + + + + + Fecha + + + + + + Total + + + + + + + Anticipo/NC +   - - - - Mon - + + + + + Mon +   - - - - - - - - - - Aux - - - - - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + Aux + + + + + + + + + + +
    +
    +
    Original
    - - - - - -
    - - - - - - -
    - - -
    -
    -
    SubTotal:
    -
    - - - -  
    Descuentos: - - -  
    Amort. Ant.: - - -
    + + + + + + + + + + + + + + + + + + + + + + +   + - - - - - - - - - - - - + + + + + + + + + + + + - + + <%----%> - - - - - - - - - - - - - --%> + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
    Original
    + + + + + +
    + + + + + + +
    + + +
    +
    +
    SubTotal:
    +
    + + + +  
    Descuentos: + + +  
    Amort. Ant.: + + +   -   -     - -
    SubTotal 2: - - - - -  
    IVA: - - - - - - - Deglose 6% + + + + + +
    SubTotal 2: + + + + +  
    IVA: + + + + + + + Deglose 6% <%----%> - 8% 16% 0% -
    Ret. IVA: - - - - - - - -
    Ret ISR: - - - - +
    Ret. IVA: + + + + + + + +
    Ret ISR: + + + + % - - -
    IEPS: - - -
    O.Imp: - - -
    Redondeo: - - -
    Total: - - - - - -
    - - - - - - - -
    +
    + +
    IEPS: + + +
    O.Imp: + + +
    Redondeo: + + +
    Total: + + + + + +
    + + + + + + + +
    TC: - -
    -
    -
    -
    -
    -
    - -
    - - -
    -
    - - - - - - - - - - - - - - -
    -
    -
    -
      + + + + + +
    + + + + + +
    +
    + +
    + + +
    +
    + +
    +
    + +
    +
    + + + + + + + + +
    +
    +
    +
    • Aplica consignación: - -
    • -
      -
    • - - - - -
    • + + + + + + +
      +
    • + + + + +
    • Consignación: - -
    • + + + + + + <%--
    • Folio Consignación: -
    • --%> -
    -
    -
    - - <%----%> -
    -
    -
    -
    -
    - - - - - - - - - - -
    - - Archivo -
    - -
    -
    -
    - - - - - - - - Aplica
    - Inventario
    - -
    - - - -
    - - - -
    - - -
    - -
    - - - - - - - - - Almacén
    - -
    -
    - - - - - - - - + --%> + +
    +
    + + <%----%> +
    +
    +
    +
    +
    + + + + + + + + + + +
    + + Archivo +
    + +
    +
    +
    + + + + + + + + Aplica
    + Inventario
    + +
    + + + +
    + + + +
    + + +
    + +
    + + + + + + + + + Almacén
    + +
    +
    + + + + + + + + <%-- - --%> - - - Almacén Consignación
    - -
    - - - -
    - - - - - - - - - - - - + --%> + + + Almacén Consignación
    + +
    + + + +
    + + + + + + + + + + + + <%-- - --%> -
    -
    - -
    - - - - - + --%> + + + +
    + + + + + - - - - - - - + + + + + + + - - - - - - Producto - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    -
    - - Factura de la nota de Credito -
    -
    -
    -
    -
    - -
    - - - - - - -
    Compra: - - - -
    -
    -
    -
    -
    -
    - - - - - -
    Almacen: - -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - - - - - - - - - - -
    -
    - -
    - -
    -
    -
    -
    -
      + + + + + + Producto + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + +
    +
    + + Factura de la nota de Credito +
    +
    +
    +
    +
    + +
    + + + + + + +
    Compra: + + + +
    +
    +
    +
    +
    +
    + + + + + +
    Almacen: + +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + + + + + + + + + + +
    +
    + +
    + +
    +
    +
    +
    +
    • Tipo Cambio: - - - - -
    • -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    - - Advertencia: - -
    -
    -
    - -
    - -
    -
    -
    -
    - - Advertencia: - -
    -
    -
    -
    - -
    -
    -
    -
    - - Nota: - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - Promoción: -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - Ordenes de Compra con Almacén: -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - - - - - - - - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    - - - + + + + + + + + + + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + Advertencia: + +
    +
    +
    + +
    + +
    +
    +
    +
    + + Advertencia: + +
    +
    +
    +
    + +
    +
    +
    +
    + + Nota: + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + Promoción: +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + Ordenes de Compra con Almacén: +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + + + + + + + + + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + +            - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - - - - - - - - - - <%-- --%> - - - - - - - - - <%-- --%> - - - - - - - - - - <%-- --%> - - - + + +
    +
    +
    +
    +
    + +
    + +
    + + +
    +
    + +
    +
    +
    + +
    Importes VinculadosCalculados
    Tipo De Cambio - - - - - -
    Subtotal - - - - - -
    + + + + + + + + + <%-- --%> + + + + + + + + + <%-- --%> + + + + + + + + + + <%-- --%> + + + - - - - - - <%-- --%> - - - - + + + + + + + <%-- --%> + + + + - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - - <%-- --%> - - - + + + + + + + <%-- --%> + + + - - - - - - <%-- --%> - - - + + + + + + + <%-- --%> + + + - - - - - - <%-- --%> - - - + + + + + + + <%-- --%> + + + - - - - - <%-- --%> - -
    Importes VinculadosCalculados
    Tipo De Cambio + + + + + +
    Subtotal + + + + + +
    Descuento - - - - -
    + + + +
    Subtotal 2 - - - - - - -
    + + + + + +
    IEPS - - - - -
    + + + +
    IVA - - - - -
    + + + +
    Ret IVA - - - - -
    + + + +
    Ret ISR - - - - -
    + + + +
    Total - - - - -
    -
    - -
    -
    -
    -
    - - Datos de la Compra - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - - -
    - - - - - - - - - - -
    - -
    - + + + + + + + + + + <%-- --%> + + +
    + +
    +
    +
    +
    + + Datos de la Compra + +
    +
    +
    +
    +
    +
    + +
    +
    +
    + + +
    + + + + + + + + + + +
    + +
    + Clasificación -
    + + + + +
    Producto/Servicio -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - - - <%----%> - - - - - - + + + + + + + + + + + + + +
    + + <%----%> + + + + + + - - - - + + + + + - - - - - + + + + + + - - - - + + + + + - - - - + + + + + - - - - + + + + + - - - - + + + + + - - - - + + + + + - - - - + + + + + - - -
    Subtotal - - -
    + +
    Descuento - - -
    + +
    Subtotal 2 - - -
    + +
    IEPS - - -
    + +
    IVA - - -
    + +
    Ret IVA - - -
    + +
    Ret ISR - - -
    + +
    Anticipos: - - -
    + +
    Total - - -
    -
    - -
    - - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - + + + + + + +
    + +
    + + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + + + + <%-- @@ -1961,321 +2005,328 @@ - --%> - - - Activos Fijos - - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    #CantidadUnidadProductoObservaciónVinculación AFHorómetro / OdómetroMantenimientoDividir
    -
    -
    - - - - - -
    --%> + + + Activos Fijos + + + + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    #CantidadUnidadProductoObservaciónVinculación AFHorómetro / OdómetroMantenimientoDividir
    +
    +
    + + + + + + - -
    -
    - - - - - - - - - - - - - - -
    #CantidadUnidadProductoObservaciónVinculacion AF
    -
    -
    - - - - - - - + + + + + + + + + + + + + + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + +
    #CantidadUnidadProductoObservaciónVinculacion AF
    +
    +
    + + + + + + + - - - - - - - - - - - - - - -
    + + + + + + + + + + + + + + + +
    <%-- -
    --%> - -
    -
    -
    - - - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - +
    --%> + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + + + +
    #CantidadUnidadProductoObservaciónReferencia - -
    + + + + + + + + - - -
    #CantidadUnidadProductoObservaciónReferencia + + Personal -
    - - - -
    Desglosar
    -
    -
    - - - - - - - + + + + +
    + + + + + Desglosar + + +
    +
    + + + + + + + - - - - - - - - - - - - - - -
    + + + + + + + + + + + + + + + +
    <%-- -
    --%> - -
    -
    -
    - - - - - - - - - - -
    - - -
    -
    - - - - - - - <%----%> +
    --%> + +
    +
    +
    + + + + + + + + + + +
    + + +
    +
    + + + + + + + <%----%> <%-- @@ -2283,232 +2334,234 @@ - --%> - + --%> + <%-- --%> - - - - - - - -
    -
    - -
    -
    -
    -
    - - - - - - -
    -
    -
    -
    -
    -
    - - Condiciones de la compra -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    Método Pago: -
    Fecha Pago: -
    - - - - - - - - - - - - - - -
    -
    - -
    - -
    - - - - - - Personal/Empleado - Caja Chica - - - - - - - - - - - - -
    - - - + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + + Condiciones de la compra +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + +
    Método Pago: +
    Fecha Pago: +
    + + + + + + + + + + + + + + +
    +
    + +
    + +
    + + + + + + Personal/Empleado + Caja Chica + + + + + + + + + + + + +
    + + + - - - - - - - - - - -
    Reembolso: - - Personal/Empleado - Caja Chica -
    #
    -
    -
    - - - - - - + + + + Personal/Empleado + Caja Chica + + + + + + + + + + + +
    - - - Crédito - Contado - Reembolsos - Crédito Financiero - -
    #
    +
    +
    + + + + + + <%-- --%> - -
    + + + Crédito + Contado + Reembolsos + Crédito Financiero + +
    Numero de Reembolso: -
    - - - -
    -
    - -
    - -
    - -
    -
    - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - <%--<%--Reembolsos--%> -
    + --%> + + + + + +
    +
    + +
    + +
    + +
    +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + <%--<%--Reembolsos--%> +
    <%-- -
    @@ -2521,402 +2574,404 @@
    --%> - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Observaciones -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - - - - - - -
    Observaciones Generales: 
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Acciones -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - - - -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - Facturas Aplicadas -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - - -
    -
    -
    -
    - - +
    +
    +
    +
    +
    +
    + + Observaciones +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + + + + + + + + +
    Observaciones Generales: 
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + Acciones +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + + + + + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + Facturas Aplicadas +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + + + +
    +
    +
    +
    + + - - - - <%--********* INICIAN MODALES ***********--%> - - - + + +
    + + + <%----%> - - + + + + + +
    +
    +
    + +
    +
    + <%----%> + Bitácora +
    +
    +
    <%--
    Agregar -
    --%> -
    -
    - - - -
    -
    -
    - -
    - - - - - - - Fecha - - - - - - Fecha Agenda - - - - - - Usuario - - - - - - Descripción - - - - - - Archivo - - - - - - - - - - - - - - -
    -
    -
    -
    - - + +
    + + + + + + + Fecha + + + + + + Fecha Agenda + + + + + + Usuario + + + + + + Descripción + + + + + + Archivo + + + + + + + + + + + + + + +
    +
    +
    +
    + + - - - - - - - - - - - - - - - - - - - - - <%-- MODAL SERIE-LOTE ALMACEN --%> - - - - - -
    -
    -
    -
    -
    - - Historial de Modificación -
    -
    -
    -
    -
    -
    -
    - - - - Fecha - - - - - - - - - - -
    -
    -
    -
    -
    -
    - - - - +
    +
    + + <%--MODAL PREGUNTA IEPS y Otros Impuestos--%> + + + + <%--MODAL IR A OC--%> + + + <%--FLETES--%> + + + - - + + - - + + <%-- COMPLEMENTOS PAGO --%> + + + + + + + <%-- ACTUALIZAR TIPO CAMBIO PREPOLIZA --%> + + + + + + <%-- MODAL FLETES E IMPORTACIONES --%> + +
    +
    + + + + + + + + + + + + + + + + <%-- - --%> - - - - - - - --%> + + + + + + + diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2c17d3d82..2210878a2 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1079,6 +1079,13 @@ Partial Class ContabilidadC_RegPrePolizaS Else DdlPersonalE.Visible = False End If + + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(51) Then + CargaClasificacionesE() + DdlClasificacionesE.Visible = True + Else + DdlClasificacionesE.Visible = False + End If If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then CargaClientesE() DdlClientesE.Visible = True @@ -1136,6 +1143,12 @@ Partial Class ContabilidadC_RegPrePolizaS DdlPersonalE.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonalE.DataBind() DdlPersonalE.Items.Insert(0, New ListItem(" - ", "-1")) + End Sub + + Private Sub CargaClasificacionesE() + DdlClasificacionesE.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacionesE.DataBind() + DdlClasificacionesE.Items.Insert(0, New ListItem(" - ", "-1")) End Sub Private Sub DdlProveedoresE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedoresE.SelectedIndexChanged CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero) From 044f92d6497103ebbd631ff2c4e842701bb88398 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 12 Jan 2021 09:23:26 -0700 Subject: [PATCH 23/30] -- redondeo -- inicia transaccion de contpaqi, si aplica --- Ventas/Ventas.aspx.vb | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 1af853887..d2d8d3904 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -4582,7 +4582,7 @@ Partial Class Ventas End If End If - DdlVendedor.SelectedValue = DbRowVenta("CveVendedor").ToString() + DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero. DdlTipoComprobante.Enabled = False 'TxtDocto.Enabled = False @@ -7668,6 +7668,7 @@ Partial Class Ventas 'CONTABILIDAD AUTOMATICA Y AC If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa) + ObjContPaq.IniciaTransacSQL() End If 'VERIFICA QUE EL FOLIO NO SEA IGUAL AL DE LA FACTURA ANTERIOR @@ -12845,7 +12846,7 @@ Partial Class Ventas If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then DtCostos = ObjInventario.DtResultados - TotalCosto = DtCostos.SUMD("Total").RoundSQL + TotalCosto = DtCostos.SUMD("Total").RoundAD Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) Dim IdCtaContable As Integer = 0 Dim CveCuenta As Integer = 0 @@ -12854,7 +12855,7 @@ Partial Class Ventas Dim cont As Integer = 1 'Se agrega movimiento separado por la cuenta de ventas (ER) For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL + ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD TotalCostoAcumulado += ValorInventario 'cuando es el último movimiento y hay diferencias en los importes @@ -12864,23 +12865,23 @@ Partial Class Ventas 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString()) IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() - CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() - If ValorInventario <> 0 Then + 'CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() + 'If ValorInventario <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then OcurrioError = True End If - End If + 'End If cont += 1 Next End If IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() - If TotalCosto <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then + 'If TotalCosto <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then OcurrioError = True End If - End If + 'End If Else OcurrioError = True @@ -13503,7 +13504,7 @@ Partial Class Ventas divAmortizacionTipoRelacion.Visible = True End If - If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then + If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146) Then If Not DdlTipoAmortizacionAnticipo.Items.Cast(Of ListItem).Any(Function(x) x.Value = "3") Then DdlTipoAmortizacionAnticipo.Items.Add(New ListItem("Amortización anticipo sobre factura en cero", "3")) End If @@ -18220,10 +18221,10 @@ Partial Class Ventas Dim ValorInventario As Decimal Dim TotalCostoAcumulado As Decimal = 0D Dim Cont As Integer = 1 - Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL + Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD For Each RowInv As DataRow In DtCostosDistinct.Rows - ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL + ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero() TotalCostoAcumulado += ValorInventario From e678944e4acb11ca2e7e678d0842ef1786a509a1 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 12 Jan 2021 09:23:53 -0700 Subject: [PATCH 24/30] redondeo de decimales --- Inventarios/TraspasoAlmacen.aspx.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 28c5f2777..4639c8aea 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -971,7 +971,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUMD("Total").RoundSQL + Dim importe As Decimal = resultado.SUMD("Total").RoundAD 'Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero 'Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero Dim Contabilizable As Boolean = True @@ -1012,7 +1012,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUMD("Total").RoundSQL + Dim importe As Decimal = resultado.SUMD("Total").RoundAD Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then @@ -1736,7 +1736,7 @@ Partial Class Inventarios_TraspasoAlmacen End If If Not ErrorMovInv Then - Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL + Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundAD Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, @@ -1912,7 +1912,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUMD("Total").RoundSQL + Dim importe As Decimal = resultado.SUMD("Total").RoundAD Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero Dim tCveConcepto As Integer = 68 From b457a6e57420578d60e95fc959b3b206f8cf2541 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 12 Jan 2021 11:10:34 -0700 Subject: [PATCH 25/30] redondeos --- Compras/Compras.aspx | 4 ++-- Compras/Compras.aspx.vb | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 7150832a1..e513329fa 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -1178,8 +1178,8 @@
    - - + + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 868a61171..c445ac8e0 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4643,7 +4643,7 @@ Partial Class Compras_Compras 'End If 'METODO DE PREPOLIZA DE ALMACEN - If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 153) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 152, 153, 159, 160, 161, 162, 163) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal If ImporteAlmacen > 0 Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then @@ -5305,7 +5305,7 @@ Partial Class Compras_Compras If Not UsuarioActual.Empresa.UsaAC Then fecha = Now folio = ObjInventario.GetFolioSiguiente(2, UsuarioActual.CveEmpresa) - cvemovimientoentrada = ObjInventario.AddMovimiento(tcvealmacen, 2, 1, fecha, folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G") + cvemovimientoentrada = ObjInventario.AddMovimiento(tcvealmacen, 2, 1, fecha, folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G4") If cvemovimientoentrada <= 0 Then ErrorMovInv = True Exit For @@ -5329,7 +5329,7 @@ Partial Class Compras_Compras 'agregamos la salida gasto folio = ObjInventario.GetFolioSiguiente(3, UsuarioActual.CveEmpresa) - cvemovimientosalidagasto = ObjInventario.AddMovimiento(tcvealmacen, 3, DdlMoneda.SelectedValue.ToEntero, fecha.AddSeconds(1), folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G") + cvemovimientosalidagasto = ObjInventario.AddMovimiento(tcvealmacen, 3, DdlMoneda.SelectedValue.ToEntero, fecha.AddSeconds(1), folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G3") If cvemovimientosalidagasto <= 0 Then ErrorMovInv = True Exit For @@ -5386,7 +5386,7 @@ Partial Class Compras_Compras Dim fecha As Date = TxtFecha.Text.ToDate If Not UsuarioActual.Empresa.UsaAC Then fecha = Now - CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, 2, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G") + CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, 2, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G2") If CveMovimientoInventario <= 0 Then ErrorMovInv = True @@ -6551,7 +6551,7 @@ Partial Class Compras_Compras End If Case 6 'Compra - Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" + Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141,152,159,160,161,162,163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" @@ -14286,7 +14286,7 @@ Partial Class Compras_Compras 'si el subtotal es iwal a la nc lo guardo si no marco error If subtotal > subtotaldevolucion - 1 AndAlso subtotal < subtotaldevolucion + 1 Then - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 13, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G") + CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 13, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, Modulo:="Comp/G1") If CveMovimientoEntrada <= 0 Then ErrorMovInv = True Else From 99189cee7c9b759aadb20f31646b9a2f9e4fbebc Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 12 Jan 2021 11:10:41 -0700 Subject: [PATCH 26/30] ajustes --- Inventarios/EntradasSalidas.aspx.vb | 138 ++++++++++++++++++++++------ 1 file changed, 110 insertions(+), 28 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index b4a6d3302..93b79843a 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -294,6 +294,11 @@ Partial Class Inventarios_EntradasSalidas Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then + If UsuarioActual.CveUsuario = 100 AndAlso IfNull(Request("Regenera"), "").ToString = "1" Then + RegeneraRM(Request("CveMovimiento").ToString.ToEntero, 119) + Exit Sub + End If + CveMovimiento = -1 CveMovimientoRelacionado = -1 TieneRelacionado = -1 @@ -3594,45 +3599,52 @@ Partial Class Inventarios_EntradasSalidas End If Next Else - If ObjInventario.Modulo = "ASA/G1" Then + If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then Contabilizable = False - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 289, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then ErrorMovInv = True End If Else - If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then - 'genero las prepolizas manuales - Dim tCveConcepto As Integer = 95 - Dim CveCuenta As Integer - If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519 - IdCtaContable = 1 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then + If ObjInventario.Modulo = "ASA/G1" Then + Contabilizable = False + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then ErrorMovInv = True - End If - Else - - Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero - Dim tCveConcepto As Integer = 69 - If DdlConcepto.SelectedValue = "30" Then - tCveConcepto = 181 - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero - End If - - For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL - If tCveConcepto = 69 Then - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then + 'genero las prepolizas manuales + Dim tCveConcepto As Integer = 95 + Dim CveCuenta As Integer + If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519 + IdCtaContable = 1 + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then ErrorMovInv = True - Exit For + End If - Next + Else + Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero + Dim tCveConcepto As Integer = 69 + If DdlConcepto.SelectedValue = "30" Then + tCveConcepto = 181 + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero + End If + + For Each RowInv As DataRow In tmpCostos.Rows + ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + If tCveConcepto = 69 Then + IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + ErrorMovInv = True + Exit For + End If + + Next + + End If End If End If End If @@ -4840,6 +4852,76 @@ Partial Class Inventarios_EntradasSalidas End Sub + Private Sub RegeneraRM(CveMovD As Integer, CveMov2 As Integer) + 'Dim Retorno As Integer = -1 + 'Dim ErrorMovInv As Boolean = False + 'Dim ObjConta As New ClsContabilidad + 'ObjConta.IniciaTransacSQL() + 'Dim ObjInventario As New ClsInventarios(ObjConta.IniciaTransacSQL) + 'Dim CveMovimientoInsertado As Integer = 0 + 'Dim Fecha As Date + 'Dim Importe As Decimal + + 'If ObjInventario.GetMovimientosDetalleTransitorio(CveMovD, UsuarioActual.CveEmpresa) Then + + + ' Fecha = ObjInventario.DtResultados.Rows(0)("FechaMovto").ToString.ToDate + + ' Dim dtvirtual As DataTable = ObjInventario.DtResultados + + ' If dtvirtual.Rows.Count > 0 Then + ' CveMovimientoInsertado = ObjInventario.AddMovimiento(352, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/VM") + + ' For Each RowVirtual As DataRow In dtvirtual.Rows + ' Dim CvePS = RowVirtual("CvePS").ToString().ToEntero() + ' Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble() + ' Dim PU As Decimal = RowVirtual("PUOriginal").ToString().ToDecimal() + ' Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero() + ' Dim CveMovimientoDetalle As Integer = RowVirtual("CveMovimientoDetalle").ToString().ToEntero() + + ' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInsertado, CantidadUsado, CveUM, CvePS, PU, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ' ErrorMovInv = True + ' Exit For + ' End If + ' Next + + ' If ObjInventario.GetMovimientosDetalle(CveMovimientoInsertado, UsuarioActual.CveEmpresa) Then + + ' Dim resultado As DataTable = ObjInventario.DtResultados + ' Importe = resultado.SUMD("Total").RoundSQL + + ' Dim Contabilizable As Boolean = False + ' Dim Concepto As String = "Traspaso" + ' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Manualx", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoInsertado, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ' ErrorMovInv = True + ' End If + + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 68, Concepto, Fecha, -1, -1, CveMovimientoAlmacen:=CveMovD, ImporteMX:=Importe, Contabilizable:=Contabilizable) Then + ' ErrorMovInv = True + ' End If + + ' If Not ErrorMovInv Then Retorno = CvePrePoliza + + ' End If + ' End If + 'Else + ' ErrorMovInv = True + 'End If + + 'If ErrorMovInv Then + ' ObjConta.RollBack() + ' Alert("No se aplico", TipoMensaje.MsgError) + 'Else + ' ObjConta.Commit() + ' Alert("Se aplico", TipoMensaje.MsgInformacion) + 'End If + + 'ObjConta.Dispose() + 'ObjInventario.Dispose() + + End Sub + End Class From d83e7bc409f54bf24ed6d0d40f3c26ecbc55c485 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 12 Jan 2021 20:45:36 -0700 Subject: [PATCH 27/30] carga de trabajo del CRM --- App_Code/ClsCRM.vb | 3 ++- CRM/EmpresaCRM.aspx.cs | 2 +- CRM/RepAcercamientos.aspx.cs | 28 ++++++++------------- CRM/RepAcercamientosProcesosDetalle.aspx | 4 +-- CRM/RepAcercamientosProcesosDetalle.aspx.cs | 12 ++++----- CRM/RepAcercamientosRechazos.aspx.cs | 14 ++++++++--- 6 files changed, 33 insertions(+), 30 deletions(-) diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb index 2c84fb3e1..7cb6f40ef 100644 --- a/App_Code/ClsCRM.vb +++ b/App_Code/ClsCRM.vb @@ -1061,7 +1061,7 @@ Public Class ClsCRM Return retorno End Function - Public Function RepAcercamientosDetalle(CveEmpresa As Int32, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, cveEtapaProceso As Int32, sFecha As String, sFechaIni As String, sFechaFin As String) As Boolean + Public Function RepAcercamientosDetalle(CveEmpresa As Int32, cveVendedor As Int32, cveMedioCaptacion As Int32, cveProbabilidadAcercamiento As Int32, cveEtapaProceso As Int32, sFecha As String, sFechaIni As String, sFechaFin As String, Optional CveTipoProceso As Integer = -1) As Boolean Dim retorno As Boolean = False DataAdapter("PA_CRM_RepAcercamientosDetalle", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -1073,6 +1073,7 @@ Public Class ClsCRM .Add("@SFecha", SqlDbType.VarChar).Value = sFecha .Add("@SFechaIni", SqlDbType.VarChar).Value = sFechaIni .Add("@SFechaFin", SqlDbType.VarChar).Value = sFechaFin + .Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso End With Try SqlAdapter.Fill(Data) diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 93b909e00..8c2874e1b 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -643,7 +643,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas CveVendedor = ObjCRM.DtResultados.FiltroPrimeroValor("CveVendedorAsignado").ToEntero(); CveSubProyecto = ObjCRM.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero(); CveCliente = ObjCRM.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero(); - CveGiroClasificacion = ObjCRM.DtResultados.FiltroPrimeroValor("CveGiroClasificacion").ToEntero(); + CveGiroClasificacion = ObjCRM.DtResultados.FiltroPrimeroValor("CveGiroClasificacion") != "" ? ObjCRM.DtResultados.FiltroPrimeroValor("CveGiroClasificacion").ToEntero() : -1; if (!(CveCliente > 0)) { diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs index a0db080ea..1eef821ff 100644 --- a/CRM/RepAcercamientos.aspx.cs +++ b/CRM/RepAcercamientos.aspx.cs @@ -42,25 +42,19 @@ public partial class CRM_RepAcercamientos : ClsPaginas protected void CargaDatos() { CveVendedor = DdlVendedor.SelectedValue.ToEntero(); - - if (CveVendedor > 0) + string FechaInicio = TxtFechaInicio.Text == "" ? "-1" : TxtFechaInicio.Text; + string FechaFin = TxtFechaFin.Text == "" ? "-1" : TxtFechaFin.Text; + int CvePS = DdlPS.SelectedValue.ToEntero() == 0 ? -1 : DdlPS.SelectedValue.ToEntero(); + ClsCRM ObjCRM = new ClsCRM(); + if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) { - string FechaInicio = TxtFechaInicio.Text == "" ? "-1" : TxtFechaInicio.Text; - string FechaFin = TxtFechaFin.Text == "" ? "-1" : TxtFechaFin.Text; - int CvePS = DdlPS.SelectedValue.ToEntero() == 0 ? -1 : DdlPS.SelectedValue.ToEntero(); - ClsCRM ObjCRM = new ClsCRM(); - if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveVendedor: CveVendedor, FechaInicio: FechaInicio, FechaFin: FechaFin, CvePS: CvePS, CveGiroClasificacion:DdlGiroClasificacion.SelectedValue.ToEntero())) - { - GVDatos.DataSource = ObjCRM.DtResultados; - GVDatos.DataBind(); - } - - ObjCRM.Dispose(); - UPDatos.Update(); - }else - { - Alert("El Campo Vendedor es requerido",ModExtensiones.TipoMensaje.MsgError); + GVDatos.DataSource = ObjCRM.DtResultados; + GVDatos.DataBind(); } + + ObjCRM.Dispose(); + UPDatos.Update(); + } protected void GVDatos_RowDataBound(object sender, GridViewRowEventArgs e) diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx b/CRM/RepAcercamientosProcesosDetalle.aspx index b54c7f46d..61d484036 100644 --- a/CRM/RepAcercamientosProcesosDetalle.aspx +++ b/CRM/RepAcercamientosProcesosDetalle.aspx @@ -266,7 +266,7 @@ - + @@ -286,7 +286,7 @@ - + diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx.cs b/CRM/RepAcercamientosProcesosDetalle.aspx.cs index fe8ab3eb8..b33304729 100644 --- a/CRM/RepAcercamientosProcesosDetalle.aspx.cs +++ b/CRM/RepAcercamientosProcesosDetalle.aspx.cs @@ -85,9 +85,9 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas RcveMedioCaptacion = Request["cveMedioCaptacion"] == null ? -1 : Request["cveMedioCaptacion"].ToString().ToEntero(); RcveProbabilidadAcercamiento = Request["cveProbabilidadAcercamiento"] == null ? -1 : Request["cveProbabilidadAcercamiento"].ToString().ToEntero(); RcveEtapaProceso = Request["cveEtapaProceso"] == null ? -1 : Request["cveEtapaProceso"].ToString().ToEntero(); - RsFecha = Request["Fecha"] == null ? "" : Request["Fecha"].ToString(); - RsFechaIni = Request["FechaInicio"] == null ? "" : Request["FechaInicio"].ToString(); - RsFechaFin = Request["FechaFin"] == null ? "" : Request["FechaFin"].ToString(); + RsFecha = Request["Fecha"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["Fecha"].ToString(); + RsFechaIni = Request["FechaInicio"] == null ? Extensiones.ModExtensiones.MinFecha.ToString() : Request["FechaInicio"].ToString(); + RsFechaFin = Request["FechaFin"] == null ? Extensiones.ModExtensiones.MaxFecha.ToString() : Request["FechaFin"].ToString(); try { RsFechaIni = RsFechaIni.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaInicio.Text = RsFechaIni.ToDateTime().ToString("dd/MM/yyyy"); } catch (Exception) { RsFechaIni = ""; } try { RsFechaFin = RsFechaFin.ToDateTime().ToString("yyyy/MM/dd"); TxtFechaFin.Text = RsFechaFin.ToDateTime().ToString("dd/MM/yyyy"); } @@ -192,7 +192,7 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas protected void cargarDatos() { ClsCRM ObjRepA = new ClsCRM(); - ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni, RsFechaFin); + ObjRepA.RepAcercamientosDetalle(UsuarioActual.CveEmpresa, RcveVendedor, RcveMedioCaptacion, RcveProbabilidadAcercamiento, RcveEtapaProceso, RsFecha, RsFechaIni, RsFechaFin,CveTipoProceso:DdlTipoProceso.SelectedValue.ToEntero()); GVRepAcercamientosDetalle.DataSource = ObjRepA.DtResultados; ObjRepA.Dispose(); GVRepAcercamientosDetalle.DataBind(); @@ -218,8 +218,8 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas // RsFecha = Request["CveGrupo1"] == null ? "" : Request["CveGrupo1"].ToString(); // break; //} - RsFechaIni = TxtFechaInicio.Text.Length > 0 ? TxtFechaInicio.Text.ToDateTime().ToString("yyyy/MM/dd") : ""; - RsFechaFin = TxtFechaFin.Text.Length > 0 ? TxtFechaFin.Text.ToDateTime().ToString("yyyy/MM/dd") : ""; + RsFechaIni = TxtFechaInicio.Text.Length > 0 ? TxtFechaInicio.Text.ToDateTime().ToString("yyyy/MM/dd") : Extensiones.ModExtensiones.MinFecha.ToString(); + RsFechaFin = TxtFechaFin.Text.Length > 0 ? TxtFechaFin.Text.ToDateTime().ToString("yyyy/MM/dd") : Extensiones.ModExtensiones.MaxFecha.ToString(); RcveVendedor = DdlVendedor.SelectedValue.ToEntero(); RcveMedioCaptacion = DdlMedioCaptacion.SelectedValue.ToEntero(); RcveProbabilidadAcercamiento = DdlProbabilidad.SelectedValue.ToEntero(); diff --git a/CRM/RepAcercamientosRechazos.aspx.cs b/CRM/RepAcercamientosRechazos.aspx.cs index 9a1efc92f..1a5d105c8 100644 --- a/CRM/RepAcercamientosRechazos.aspx.cs +++ b/CRM/RepAcercamientosRechazos.aspx.cs @@ -131,9 +131,17 @@ public partial class CRM_RepAcercamientosRechazos : ClsPaginas HyperLinkField hypt = new HyperLinkField(); hypt.DataTextField = $"Total"; hypt.HeaderText = $"Total"; - hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" }; - string strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); - hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + string strfilstros = ""; + if (DdlGrupo1.SelectedValue == "1") { + hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2", "Grupo1", "CveVendedor" }; + strfilstros = string.Format("&cveMedioCaptacion={0}&cveProbabilidadAcercamiento={1}", cveMedioCaptacion, cveProbabilidadAcercamiento); + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&cveVendedor={{3}}&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + } + else { + hypt.DataNavigateUrlFields = new string[] { "CveGrupo1", "CveGrupo2" , "Grupo1" }; + strfilstros = string.Format("&cveVendedor={0}&cveMedioCaptacion={1}&cveProbabilidadAcercamiento={2}", cveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento); + hypt.DataNavigateUrlFormatString = $"/CRM/RepAcercamientosProcesosDetalle.ASPX?CveTipoProceso={cveTipoProceso}&CveGrupo1={{0}}&CveGrupo2={{1}}&c&FechaInicio={TxtFechaInicio.Text}&FechaFin={TxtFechaFin.Text}{strfilstros}"; + } switch (idgrupo1) { case 1: From ba3f507c1d843d9617fd98a578f6e8b3944c78d2 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Wed, 13 Jan 2021 12:27:32 -0700 Subject: [PATCH 28/30] --- App_Code/ClsNominas.vb | 3 +- App_Code/ClsRH.vb | 2 +- Ashx/SIGGPS.ashx | 2 +- Nomina/Aguinaldo.aspx.cs | 50 +- Nomina/Finiquito.aspx | 734 +++++++--------- Nomina/Finiquito.aspx.cs | 815 +++++++++--------- Nomina/FiniquitoOld.aspx | 516 +++++++++++ Nomina/FiniquitoOld.aspx.cs | 514 +++++++++++ ...Finiquito.aspx.vb => FiniquitoOld.aspx.vb} | 0 Nomina/Nomina.aspx.vb | 2 +- Nomina/Nomina2.aspx | 99 ++- Nomina/Nomina2.aspx.cs | 74 +- Nomina/ReportePTU.aspx.vb | 2 + RH/Personal.aspx | 4 +- RH/Personal.aspx.vb | 38 +- SiteGPS.master | 18 +- vwd.webinfo | 4 + 17 files changed, 1994 insertions(+), 883 deletions(-) create mode 100644 Nomina/FiniquitoOld.aspx create mode 100644 Nomina/FiniquitoOld.aspx.cs rename Nomina/{Finiquito.aspx.vb => FiniquitoOld.aspx.vb} (100%) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 53b11a3e3..e40a7740e 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -1985,7 +1985,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function GetNominaEmpleado(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, Optional RegimenContratacion As Integer = 1) As Boolean + Public Function GetNominaEmpleado(CveProyecto As Integer, CveSubProyecto As Integer, CveTurno As Integer, CvePeriodo As Integer, CveEmpresa As Integer, Agrupador As Integer, Optional RegimenContratacion As Integer = 1, Optional CvePersonal As Integer = -1) As Boolean Dim retorno As Boolean = False Try DTSet = New DataSet() @@ -1998,6 +1998,7 @@ Public Class ClsNominas .Add("@Agrupador", SqlDbType.VarChar).Value = Agrupador .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@RegimenContratacion", SqlDbType.Int).Value = RegimenContratacion + .Add("@CvePersonal", SqlDbType.Decimal).Value = CvePersonal End With diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 2f7f7c87d..c9557b703 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2159,7 +2159,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al obtener el reporte de Altas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al actualizar las bajas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno diff --git a/Ashx/SIGGPS.ashx b/Ashx/SIGGPS.ashx index 64678a627..5f0c66a38 100644 --- a/Ashx/SIGGPS.ashx +++ b/Ashx/SIGGPS.ashx @@ -74,7 +74,7 @@ Public Class SIGGPS : Implements IHttpHandler, IRequiresSessionState 'Dim contextc = Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager.GetHubContext(Of MyGPSHub)() 'SendNotificacionGPS(contextc, 5, 1727, "Encabezado", "Mensaje", 2, "{""timeOut"":15000, ""extendedTimeOut"":16000}", "142608__autistic-lucario__error.wav", 0, SQLToGmapsJArray("POINT (-99.211688 19.717715)", "POINT").ToString()) Using ObjGPS As New ClsSisNotificaciones - ObjGPS.ObtenerNotificaciones() + Retorno = $"[""IsOk""=""{ObjGPS.ObtenerNotificaciones()}""]" End Using context.Response.Write(Retorno) End Sub diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs index e1507fd52..b89c02fb9 100644 --- a/Nomina/Aguinaldo.aspx.cs +++ b/Nomina/Aguinaldo.aspx.cs @@ -537,16 +537,8 @@ Aguinaldoapagar if (Listaparametros!= null) { foreach (parametroQuery pr in Listaparametros) - { - if (pr.SqlDataType != null) - { - if (pr.ParameterDirection != null) - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; - else - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value; - } - else - SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue); + { + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; } } @@ -586,15 +578,7 @@ Aguinaldoapagar { foreach (parametroQuery pr in Listaparametros) { - if ( pr.SqlDataType != null) - { - if ( pr.ParameterDirection != null) - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; - else - SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value; - } - else - SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue); + SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection; } } @@ -714,18 +698,18 @@ Aguinaldoapagar } } -public class parametroQuery -{ - public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection)) - { - this.ParameterName = parameterName; - this.SqlDataType = sqlDataType; - this.ParameterDirection = parameterDirection; - this.SqlValue = sqlValue; - } +//public class parametroQuery +//{ +// public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection)) +// { +// this.ParameterName = parameterName; +// this.SqlDataType = sqlDataType; +// this.ParameterDirection = parameterDirection; +// this.SqlValue = sqlValue; +// } - public string ParameterName { get; set; } - public SqlDbType SqlDataType { get; set; } - public ParameterDirection ParameterDirection { get; set; } - public object SqlValue { get; set; } -} +// public string ParameterName { get; set; } +// public SqlDbType SqlDataType { get; set; } +// public ParameterDirection ParameterDirection { get; set; } +// public object SqlValue { get; set; } +//} diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx index c77da1039..c2112291a 100644 --- a/Nomina/Finiquito.aspx +++ b/Nomina/Finiquito.aspx @@ -4,6 +4,37 @@ - Finiquito -
  • - Cambiar Empleado
  • + done_allAutorizar +
  • - ReCalcular
  • + Timbrar +
  • - done_allAutorizar
  • -
  • - Timbrar
  • -
  • - Formato Renuncia
  • + Formato Finiquito +
    @@ -83,79 +82,177 @@ - - -
    -
    - -
    -
    -
    - - Datos del Empleado -
    -
    - - -
    -
    -
    -
    -
    Empleado:
    -
    - -
    -
    -
    -
    Estatus
    -
    - -
    -
    -
    -
    Motivo Baja
    -
    - -
    -
    -
    -
    Fecha Baja
    -
    - -
    -
    -
    -
    Perido Finiquito
    -
    - -
    -
    -
    -
    -
    - -
    - - - - - -
    -