diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 3089b032b..150702154 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -162,7 +162,7 @@ - + diff --git a/Acumuladores/CatGarantiasMeses.aspx b/Acumuladores/CatGarantiasMeses.aspx index d9cca1c6c..c9b99fdbb 100644 --- a/Acumuladores/CatGarantiasMeses.aspx +++ b/Acumuladores/CatGarantiasMeses.aspx @@ -90,10 +90,7 @@
Tipo Uso
-
- - - + @@ -116,8 +113,8 @@
- +   - +   - +   + + +   + + - +   - + @@ -215,6 +217,24 @@ +
+ Fecha Inicio: + +
+
+
+ + + + +
+ + + + + + +
diff --git a/Acumuladores/CatGarantiasMeses.aspx.vb b/Acumuladores/CatGarantiasMeses.aspx.vb index 1faba2cbf..9ce2b7d8d 100644 --- a/Acumuladores/CatGarantiasMeses.aspx.vb +++ b/Acumuladores/CatGarantiasMeses.aspx.vb @@ -113,7 +113,7 @@ Partial Class Acumuladores_CatFoliosGarantia 'End If 'ObjPS.Dispose() - DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) + DdlMarcaM.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) DdlMarcaM.DataBind() DdlTipoUsoM.DataSource = GlobalDTAcumTiposUso(UsuarioActual.CveEmpresa) @@ -126,7 +126,7 @@ Partial Class Acumuladores_CatFoliosGarantia Dim ObjAcum As New ClsAcumuladores If Not Actualizar Then - If ObjAcum.GarantiasMesesAdd(DdlMarcaM.SelectedValue.ToEntero, DdlTipoUsoM.SelectedValue.ToEntero, TxtMes.Text.ToEntero, TxtValor.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If ObjAcum.GarantiasMesesAdd(DdlMarcaM.SelectedValue.ToEntero, DdlTipoUsoM.SelectedValue.ToEntero, TxtMes.Text.ToEntero, TxtValor.Text.ToDecimal, txtFechaI.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then TxtMes.Text = TxtMes.Text.ToEntero + 1 TxtValor.Text = "" @@ -147,7 +147,7 @@ Partial Class Acumuladores_CatFoliosGarantia Alert("Ocurrió un error al guardar la Garantía de Mes", TipoMensaje.MsgError) End If Else - If ObjAcum.GarantiasMesesUpdate(CveGarantiaMes, DdlMarcaM.SelectedValue.ToEntero, DdlTipoUsoM.SelectedValue.ToEntero, TxtMes.Text.ToEntero, TxtValor.Text.ToDecimal, UsuarioActual.CveUsuario) Then + If ObjAcum.GarantiasMesesUpdate(CveGarantiaMes, DdlMarcaM.SelectedValue.ToEntero, DdlTipoUsoM.SelectedValue.ToEntero, TxtMes.Text.ToEntero, TxtValor.Text.ToDecimal, txtFechaI.Text.ToDate, UsuarioActual.CveUsuario) Then TxtMes.Text = "" TxtValor.Text = "" @@ -211,6 +211,7 @@ Partial Class Acumuladores_CatFoliosGarantia TxtMes.Text = GvRow.DataKey("Mes") TxtValor.Text = GvRow.DataKey("Valor") + txtFechaI.Text = GvRow.DataKey("FechaInicioVigencia") CargaCombosModal() DdlMarcaM.SelectedValueExist(GvRow.DataKey("CveMarca").ToEntero) DdlTipoUsoM.SelectedValueExist(GvRow.DataKey("CveTipoUso").ToEntero) diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index e9aa5a929..54581d959 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -608,14 +608,14 @@ Public Class ClsAcumuladores End Try Return Retorno - End Function - - + End Function + + #End Region - + #Region " GARANTÍAS MESES " - - Public Function GarantiasMesesGet(CveGarantiaMes As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveTipoUso As Integer = -1, Optional Mes As Integer = -1) As Boolean + + Public Function GarantiasMesesGet(CveGarantiaMes As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveTipoUso As Integer = -1, Optional Mes As Integer = -1, Optional FechaInicioVigencia As Date = MinFecha) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -625,7 +625,8 @@ Public Class ClsAcumuladores .Add("@CveGarantiaMes", SqlDbType.Int).Value = CveGarantiaMes .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveMarca", SqlDbType.Int).Value = CveMarca - .Add("@CveTipoUso", SqlDbType.Int).Value = CveTipoUso + .Add("@CveTipoUso", SqlDbType.Int).Value = CveTipoUso + .Add("@FechaInicioVigencia", SqlDbType.Date).Value = FechaInicioVigencia .Add("@Mes", SqlDbType.Int).Value = Mes End With @@ -641,7 +642,7 @@ Public Class ClsAcumuladores Return Retorno End Function - Public Function GarantiasMesesAdd(CveMarca As Integer, CveTipoUso As Integer, Mes As Integer, Valor As Double, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function GarantiasMesesAdd(CveMarca As Integer, CveTipoUso As Integer, Mes As Integer, Valor As Double, FechaInicioVigencia As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -653,6 +654,7 @@ Public Class ClsAcumuladores .Add("@CveTipoUso", SqlDbType.Int).Value = CveTipoUso .Add("@Mes", SqlDbType.Int).Value = Mes .Add("@Valor", SqlDbType.SmallMoney).Value = Valor + .Add("@FechaInicioVigencia", SqlDbType.Date).Value = FechaInicioVigencia .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -670,7 +672,7 @@ Public Class ClsAcumuladores Return Retorno End Function - Public Function GarantiasMesesUpdate(CveGarantiaMes As Integer, CveMarca As Integer, CveTipoUso As Integer, Mes As Integer, Valor As Double, CveUsuario As Integer) As Boolean + Public Function GarantiasMesesUpdate(CveGarantiaMes As Integer, CveMarca As Integer, CveTipoUso As Integer, Mes As Integer, Valor As Double, FechaInicioVigencia As Date, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -682,7 +684,8 @@ Public Class ClsAcumuladores .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@CveTipoUso", SqlDbType.Int).Value = CveTipoUso .Add("@Mes", SqlDbType.Int).Value = Mes - .Add("@Valor", SqlDbType.SmallMoney).Value = Valor + .Add("@Valor", SqlDbType.SmallMoney).Value = Valor + .Add("@FechaInicioVigencia", SqlDbType.Date).Value = FechaInicioVigencia .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 05fcb23df..355c7a521 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -8111,7 +8111,7 @@ Partial Class Compras_Compras End If 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA - If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then Dim CvePreComprobacion As Integer If ObjCompras.DtResultados.Rows.Count = 0 Then diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 7c87964c4..dec88a6df 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -6309,7 +6309,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CajaChica", "Caja chica: " & ParamComprobacion.Rows(0)("BancoNumCuentaMoneda").ToString)) params.Add(New ReportParameter("observaciones", "Observaciones: " & ParamComprobacion.Rows(0)("Observaciones").ToString)) params.Add(New ReportParameter("folio", ParamComprobacion.Rows(0)("Folio").ToString)) - params.Add(New ReportParameter("fecha", ParamComprobacion.Rows(0)("FechaDocumento").ToString)) + params.Add(New ReportParameter("fecha", ParamComprobacion.Rows(0)("FechaDocumento").ToString().ToDate().ToString("dd/MM/yyyy"))) params.Add(New ReportParameter("importe", ParamComprobacion.Rows(0)("Importe").ToString)) params.Add(New ReportParameter("TotAbono", DtComprobacion.SUM("Abonado").ToString)) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 4b02bd7d4..36dbcce18 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -586,7 +586,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero - If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) + If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 293, 294, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206, 341, 342, 304, 272, 259) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) If CveConceptoContable.Contiene(30, 204, 66, 92) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) diff --git a/Empresas/159/Formatos/Factura.rdlc b/Empresas/159/Formatos/Factura.rdlc index 889043fa2..7d8f52f52 100644 --- a/Empresas/159/Formatos/Factura.rdlc +++ b/Empresas/159/Formatos/Factura.rdlc @@ -2163,8 +2163,8 @@ Embedded ID3 FitProportional - 23.20001cm - 0.21011cm + 25.46336cm + 0.26815cm 0.93046cm 5.37042cm 31 @@ -2195,8 +2195,8 @@ Textbox60 - 20.86523cm - 0.21011cm + 23.12858cm + 0.26815cm 0.6882cm 20.71217cm 32 @@ -2215,8 +2215,8 @@ =System.Convert.FromBase64String(Parameters!QRDescarga.Value) image/png FitProportional - 8.75362in - 6.64986in + 9.6447in + 6.67271in 0.6035in 0.78275in 33 @@ -2268,8 +2268,8 @@ Textbox60 - 21.31001cm - 0.21011cm + 23.57336cm + 0.26815cm 1.49135cm 5.37042cm 34 @@ -2298,8 +2298,8 @@ Textbox5 - 20.84936cm - 0.10579cm + 23.11271cm + 0.16383cm 0.05496cm 20.88652cm 35 @@ -2329,8 +2329,8 @@ Textbox5 - 24.22924cm - 0.21011cm + 26.49259cm + 0.26815cm 0.05496cm 20.88652cm 36 @@ -2423,8 +2423,8 @@ Textbox60 - 21.31001cm - 7.38142cm + 23.57336cm + 7.43946cm 2.45709cm 6.56105cm 37 @@ -2462,8 +2462,8 @@ Textbox60 - 21.30023cm - 14.60142cm + 23.56358cm + 14.65946cm 1.46939cm 6.32076cm 38 @@ -3516,8 +3516,473 @@ + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.14926cm + 0.07193cm + 0.54004cm + 20.7077cm + + + Black + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.83025cm + 4.78817cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.39643cm + 3.28643cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + 20.80555cm + 0.16383cm + 2.25247cm + 20.89818cm + 44 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + - 24.52253cm + 26.54755cm + + + + true + true + + + + + CFDI Relacionados + + + + + + + Textbox5 + 0.14926cm + 0.07193cm + 0.54004cm + 20.7077cm + + + Black + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Relación: + + + + + + + Textbox29 + 0.83025cm + 4.78817cm + 0.41981cm + 5.31841cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!TipoRelacionTexto.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.42456cm + + + 2.05585cm + + + 3.03631cm + + + 7.7847cm + + + + + 0.44125cm + + + + + true + true + + + + + Folio + + + + + + + Textbox10 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fecha + + + + + + + Textbox12 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Importe + + + + + + + Textbox21 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Folio Fiscal + + + + + + + Textbox11 + + + Black + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.41479cm + + + + + true + true + + + + + =Fields!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Fecha.Value + + + + + + + Fecha + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe1 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FolioFiscal.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet4 + 1.39643cm + 3.28643cm + 0.85604cm + 15.30142cm + 3 + + + + + + true + 20.48601cm + 0.16383cm + 2.25247cm + 20.89818cm + 44 + + =Microsoft.VisualBasic.Interaction.IIF(First(Fields!SerieFolio.Value, "DataSet4") <> "", False, True) + + + + + + + true + true + + + + + + + + Black + 2pt + 2pt + 2pt + 2pt + + - 24.44315cm + 26.31443cm @@ -1318,9 +1318,9 @@ Textbox4 3.24442cm - 14.99769cm + 14.60575cm 0.49417cm - 1.34938cm + 1.74132cm 9 =IIf(Parameters!folio.Value = "",True,False) @@ -1354,9 +1354,9 @@ Textbox4 3.80915cm - 14.99769cm + 14.60575cm 0.49417cm - 1.38465cm + 1.77659cm 10 =IIf(Parameters!folio.Value = "",True,False) @@ -1390,9 +1390,9 @@ Textbox4 2.6797cm - 14.99769cm + 14.60575cm 0.49417cm - 1.34937cm + 1.74131cm 11 =IIf(Parameters!folio.Value = "",True,False) @@ -1919,8 +1919,9 @@ ReportParameter1 - DateTime + String true + true ReportParameter1 diff --git a/General/RepIndicadorResumen.aspx.vb b/General/RepIndicadorResumen.aspx.vb index 46b34244a..d76f7677e 100644 --- a/General/RepIndicadorResumen.aspx.vb +++ b/General/RepIndicadorResumen.aspx.vb @@ -41,7 +41,8 @@ Partial Class General_RepIndicadorResumen End If If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1, - UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then + UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, TipoDocto:="Fac", + CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then GvCompProductores.DataSource = ObjCompras.DtResultados.FiltraParametros("", "Cantidad DESC") End If diff --git a/Nomina/ConceptoNomina.aspx.cs b/Nomina/ConceptoNomina.aspx.cs index db804f5e9..a5dced7e4 100644 --- a/Nomina/ConceptoNomina.aspx.cs +++ b/Nomina/ConceptoNomina.aspx.cs @@ -291,7 +291,7 @@ public partial class Nomina_CatConcepto : ClsPaginas using (ClsContabilidad ObjConta = new ClsContabilidad()) { - if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa)) + if (ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa)) { DdlCtaContable.DataSource = ObjConta.DtResultados; diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 9357e8b57..0a10319c1 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -2636,7 +2636,7 @@ public partial class Nomina_Nomina2 : ClsPaginas using (ClsContabilidad ObjConta = new ClsContabilidad()) { - if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa)) + if (ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa)) { DdlCtaContable.DataSource = ObjConta.DtResultados; DdlCtaContable.DataBind(); @@ -8407,7 +8407,7 @@ public partial class Nomina_Nomina2 : ClsPaginas using (ClsContabilidad ObjConta = new ClsContabilidad()) { - if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa)) + if (ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa)) { DdlCtaContable.DataSource = ObjConta.DtResultados; DdlCtaContable.DataBind(); @@ -8488,7 +8488,7 @@ public partial class Nomina_Nomina2 : ClsPaginas int CveAlmacen = -1; - if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa)) + if (ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa)) { dtconta = ObjConta.DtResultados; } diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 9ac8c8c5d..5d60ca69c 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -3115,7 +3115,8 @@
- + +
@@ -3142,7 +3143,7 @@
- +
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 403b0b66e..ee059d485 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -7126,7 +7126,7 @@ Partial Class PV Else 'TxtPUFactura.Enabled = True 'TxtPUFactura.Text = "" - DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + ' DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) End If DdlPSAjuste.DataBind() ' DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -7418,6 +7418,10 @@ Partial Class PV Alert("No se ha especificado producto de ajuste a entregar") Exit Sub End If + If TxtEtiqueta.Text <> "" OrElse TxtEtiqueta.Text.Length <> 4 Then + Alert("No se ha especificado la etiqueta.") + Exit Sub + End If If Not CalculaMesesUso() Then Exit Sub End If @@ -7427,53 +7431,63 @@ Partial Class PV If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then Dim CveMarca As Integer = -1 - CveMarca = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero + CveMarca = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimeroValor("CveMarca", "").ToEntero Dim ImportePagarCliente As Decimal = 0 Dim ObjAcum As New ClsAcumuladores If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then If ObjAcum.DtResultados.Rows.Count > 0 Then - TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString + ''obtener siempre y cuando la fecha de inicio sea mayor + Dim strDate As Date = ($"01/{TxtEtiqueta.Text.Substring(0, 2)}/{TxtEtiqueta.Text.Substring(2, 2)}").ToDate + Dim drg As DataRow = ObjAcum.DtResultados.FiltroPrimero($" #{strDate.ToString("yyyy/MM/dd")}# > FechaInicioVigencia ", "FechaInicioVigencia") + If drg IsNot Nothing Then - TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero - ImportePagarCliente = TxtImporteAjuste.Text.ToDecimal + TxtPorcentajeAjuste.Text = (drg("Valor").ToString.ToDouble / 100).ToString + TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero + ImportePagarCliente = TxtImporteAjuste.Text.ToDecimal - Dim CargoVendido As Decimal = 0 - Dim CargoGarantia As Decimal = 0 - Dim CveTamaño As Integer = 0 + Dim CargoVendido As Decimal = 0 + Dim CargoGarantia As Decimal = 0 + Dim CveTamaño As Integer = 0 - If DdlPSAjuste.SelectedValue.ToEntero > 0 Then - Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimero("") - If Dr IsNot Nothing Then - CargoGarantia = Dr("Cargo").ToString.ToDecimal + If DdlPSAjuste.SelectedValue.ToEntero > 0 Then + Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).FiltroPrimero("") + If Dr IsNot Nothing Then + CargoGarantia = Dr("Cargo").ToString.ToDecimal + End If End If - End If - If DdlPS.SelectedValue.ToEntero > 0 Then - Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero).FiltroPrimero("") - If Dr IsNot Nothing Then - CveTamaño = Dr("CveTamaño").ToString.ToEntero + If DdlPS.SelectedValue.ToEntero > 0 Then + Dim Dr As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("") + If Dr IsNot Nothing Then + CveTamaño = Dr("CveTamaño").ToString.ToEntero + End If End If - End If - Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CveTamaño = {CveTamaño}") - If DrCargo IsNot Nothing Then + Dim DrCargo As DataRow = GlobalDTAcumTamaños(UsuarioActual.CveEmpresa).FiltroPrimero($" CveTamaño = {CveTamaño}") + If DrCargo IsNot Nothing Then - CargoVendido = DrCargo("Cargo").ToString.ToDecimal + CargoVendido = DrCargo("Cargo").ToString.ToDecimal - End If + End If - 'el ajuste no puede ser mayor al precio de lo vendido de nuevo - If (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))) < 0 Then + 'el ajuste no puede ser mayor al precio de lo vendido de nuevo + If (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))) < 0 Then + TxtImporteAjuste.Text = "0.00" + CargoGarantia = CargoVendido + ImportePagarCliente = 0 + End If + ImportePagarCliente = (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))).ToDecimal + + TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}." + TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero + 'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero + Else + Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia) + 'cuando no está registrada, no da ajuste + TxtImporteAjuste.ToolTip = "El producto no tiene ajuste en ese periodo" TxtImporteAjuste.Text = "0.00" - CargoGarantia = CargoVendido - ImportePagarCliente = 0 End If - ImportePagarCliente = (TxtPrecio.Text.ToDouble - ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia))).ToDecimal - - TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}." - TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero - 'TxtPagarCliente.Text = ImportePagarCliente.FormatoNumero Else Alert("El producto no tiene ajuste en ese periodo", TipoMensaje.MsgAdvertencia) 'cuando no está registrada, no da ajuste diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index e9cc454a2..f324421c8 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -600,11 +600,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas // - if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23) + if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23) { e.Row.FCLinkButton("LnkValidarRefac").Visible = false; } + + if (e.Row.DBCampo("PuedeRefacturar") == "0" && e.Row.DBCampo("CveEstatusFactura") == "23" && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0) { if (e.Row.FCLinkButton("LnkCancelar") != null) e.Row.FCLinkButton("LnkCancelar").Visible = true; diff --git a/Ventas/RepProductosServicios.aspx.vb b/Ventas/RepProductosServicios.aspx.vb index 6225d3e6e..ed6a05dc5 100644 --- a/Ventas/RepProductosServicios.aspx.vb +++ b/Ventas/RepProductosServicios.aspx.vb @@ -61,29 +61,31 @@ Partial Class Ventas_RepProductosServicios #Region " CARGA DATOS INICIALES " - Private Sub CargaGrupo() - DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3")) - DdlGrupo.Items.Insert(1, New ListItem("Clasificación", "4")) - DdlGrupo.Items.Insert(2, New ListItem("Productos-Servicios", "5")) - DdlGrupo.Items.Insert(3, New ListItem("Año", "6")) - DdlGrupo.Items.Insert(4, New ListItem("Mes", "7")) - DdlGrupo.Items.Insert(5, New ListItem("Año/Mes", "8")) - DdlGrupo.Items.Insert(6, New ListItem("Fecha", "9")) - DdlGrupo.Items.Insert(7, New ListItem("Cliente", "10")) - DdlGrupo.Items.Insert(8, New ListItem("Vendedor", "12")) - DdlGrupo.Items.Insert(9, New ListItem("Usuario", "13")) - DdlGrupo.Items.Insert(10, New ListItem("Estatus Fact.", "14")) - DdlGrupo.Items.Insert(11, New ListItem("Año Ejec.", "15")) - DdlGrupo.Items.Insert(12, New ListItem("Mes Ejec.", "16")) - DdlGrupo.Items.Insert(13, New ListItem("Año/Mes Ejec.", "17")) - DdlGrupo.Items.Insert(14, New ListItem("Fecha Ejec.", "18")) - DdlGrupo.Items.Insert(15, New ListItem("Cliente - PS", "20")) - DdlGrupo.Items.Insert(16, New ListItem("Sucursal - PS", "21")) - DdlGrupo.Items.Insert(17, New ListItem("Familia - Marca - Tipo", "22")) - DdlGrupo.Items.Insert(18, New ListItem("Tipo Cliente", "23")) - DdlGrupo.Items.Insert(18, New ListItem("Marca", "24")) - DdlGrupo.Items.Insert(18, New ListItem("Cliente Sucursal", "26")) - DdlGrupo.Items.Insert(18, New ListItem("Giro", "27")) + Private Sub CargaGrupo() + If DdlProyecto.Visible Then DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1")) + DdlGrupo.Items.Add(New ListItem(LblSubProyecto.Text, "2")) + DdlGrupo.Items.Add(New ListItem("Categoria", "3")) + DdlGrupo.Items.Add(New ListItem("Clasificación", "4")) + DdlGrupo.Items.Add(New ListItem("Productos-Servicios", "5")) + DdlGrupo.Items.Add(New ListItem("Año", "6")) + DdlGrupo.Items.Add(New ListItem("Mes", "7")) + DdlGrupo.Items.Add(New ListItem("Año/Mes", "8")) + DdlGrupo.Items.Add(New ListItem("Fecha", "9")) + DdlGrupo.Items.Add(New ListItem("Cliente", "10")) + DdlGrupo.Items.Add(New ListItem("Vendedor", "12")) + DdlGrupo.Items.Add(New ListItem("Usuario", "13")) + DdlGrupo.Items.Add(New ListItem("Estatus Fact.", "14")) + DdlGrupo.Items.Add(New ListItem("Año Ejec.", "15")) + DdlGrupo.Items.Add(New ListItem("Mes Ejec.", "16")) + DdlGrupo.Items.Add(New ListItem("Año/Mes Ejec.", "17")) + DdlGrupo.Items.Add(New ListItem("Fecha Ejec.", "18")) + DdlGrupo.Items.Add(New ListItem("Cliente - PS", "20")) + DdlGrupo.Items.Add(New ListItem("Sucursal - PS", "21")) + DdlGrupo.Items.Add(New ListItem("Familia - Marca - Tipo", "22")) + DdlGrupo.Items.Add(New ListItem("Tipo Cliente", "23")) + DdlGrupo.Items.Add(New ListItem("Marca", "24")) + DdlGrupo.Items.Add(New ListItem("Cliente Sucursal", "26")) + DdlGrupo.Items.Add(New ListItem("Giro", "27")) DdlGrupo.DataBind() DdlGrupo.SelectedValueExist("8") @@ -157,9 +159,9 @@ Partial Class Ventas_RepProductosServicios DdlClienteClasificacion.DataBind() DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) - CargaGrupo() CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto) - CargarCentrosDeCosto(Nothing, DdlSubProyectoEjecucion, Nothing, Nothing) + CargarCentrosDeCosto(Nothing, DdlSubProyectoEjecucion, Nothing, Nothing) + CargaGrupo() TipoCambio = 1 TCEspecifico = 0 diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 642a31d7e..780fc3c20 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -18318,8 +18318,8 @@ Partial Class Ventas Return False End If - If PU <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" Then - Alert("El precio debe ser mayor a 0", TipoMensaje.MsgAdvertencia) + If PU <= 0 Then + Alert("No se puede vender a un importe de cero", TipoMensaje.MsgAdvertencia) Return False End If @@ -18331,10 +18331,10 @@ Partial Class Ventas ObjVentas.Dispose() 'VALIDA PRECIO CERO (0) - If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 And PU = 0 And DtPromociones.FiltroPrimeroValor("PUPromocion", $"CvePS = {CvePS}").ToDecimal > 0 Then - Alert($"El producto {HdnPS.Value}. No se puede vender a un importe de cero ($0)", TipoMensaje.MsgAdvertencia) - Return False - End If + 'If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 And PU = 0 And DtPromociones.FiltroPrimeroValor("PUPromocion", $"CvePS = {CvePS}").ToDecimal > 0 Then + ' Alert($"El producto {HdnPS.Value}. No se puede vender a un importe de cero ($0)", TipoMensaje.MsgAdvertencia) + ' Return False + 'End If 'SI NO TIENE LA FUNCIONALIDAD VALIDARA LAS MONEDAS If UsuarioActual.Empresa.Funcionalidad(524) <> "" Then @@ -23674,16 +23674,44 @@ Partial Class Ventas Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs) Dim SaldoAlmacen As Decimal = 0 - Dim ObjVentas As New ClsVentas - If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then - If ObjVentas.DtResultados.Rows.Count > 0 Then - Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0) - Me.DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero() - SaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal() + Dim ErrorVerificacion As Boolean = False + + Using ObjInv As New ClsInventarios + If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then + If ObjInv.DtResultados.Rows.Count > 0 Then + TieneAlmacen = True + End If + Else + ErrorVerificacion = True End If + End Using + + If ErrorVerificacion Then + Alert("No se pudieron verificar los movimientos de almacen del documento.", TipoMensaje.MsgError) + Exit Sub End If - If SaldoAlmacen >= 0 Then + If Not TieneAlmacen Then + Alert("El documento no tiene movimientos de almacen.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Using ObjVentas As New ClsVentas + If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=True) Then + If ObjVentas.DtResultados.Rows.Count > 0 Then + Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0) + Me.DevolucionAlmacen = DbRowVenta("EsDevolucionVenta").ToString().ToEntero() + SaldoAlmacen = DbRowVenta("SaldoAlmacen").ToString().ToDecimal() + End If + End If + End Using + + If DdlTipoComprobante.SelectedValue.ToString() = "Rem" AndAlso SaldoAlmacen = 0 Then + Alert("El documento ya fue devuelto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If DdlTipoComprobante.SelectedValue.ToString() = "Ing" AndAlso SaldoAlmacen = 0 Then Alert("El movimiento ya fue devuelto.", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -23691,17 +23719,17 @@ Partial Class Ventas If Me.DevolucionAlmacen.Contiene(2) Then InicializaDevolucionAlmacen() UpnTools.Update() - ObjVentas.Dispose() Alert("El movimiento ya fue devuelto.", TipoMensaje.MsgAdvertencia) Exit Sub End If Dim EstatusDevolucion = If(Me.DevolucionAlmacen = 0, 1, 0) - If ObjVentas.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then + Dim ObjV As New ClsVentas + If ObjV.UpdateVentasDevolucionAlmacen(EstatusDevolucion, CveVenta) Then Alert("La solicitud de Devolución de Almacén se guardó correctamente") End If - ObjVentas.Dispose() + ObjV.Dispose() Me.DevolucionAlmacen = EstatusDevolucion @@ -24693,28 +24721,9 @@ Partial Class Ventas End Sub Private Sub LbCancelarDocumento_Click(sender As Object, e As EventArgs) Handles LbCancelarDocumento.Click + Dim SaldoAlmacen As Decimal = 0 - If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then - - Dim sb As New StringBuilder() - Dim sbExtra As New StringBuilder() - sb.Append("La factura se encuentra en el siguiente estatus del SAT:
") - - Dim TotalT As Decimal = TxtTotal.Text.ToDecimal - Dim RFCReceptor As String = "" - - If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then - RFCReceptor = LblRFC.Text.Trim - - 'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA - If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then - RFCReceptor = Me.ClienteSucursal.RFC - End If - Else - RFCReceptor = Me.RFCReceptorVenta - End If - - Dim SaldoAlmacen As Decimal = 0 + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev") Then Dim PermiteCancelar As Boolean = True Using ObjVentas As New ClsVentas @@ -24737,12 +24746,41 @@ Partial Class Ventas Else PermiteCancelar = False End If + + If PermiteCancelar And SaldoVenta <> 0 Then + If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then + DivDevAlm.Visible = True + TieneAlmacen = True + End If + End If + End Using If Not PermiteCancelar Then Alert("La venta no se puede cancelar si no ha sido surtida previamente", TipoMensaje.MsgAdvertencia) Exit Sub End If + End If + + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then + + Dim sb As New StringBuilder() + Dim sbExtra As New StringBuilder() + sb.Append("La factura se encuentra en el siguiente estatus del SAT:
") + + Dim TotalT As Decimal = TxtTotal.Text.ToDecimal + Dim RFCReceptor As String = "" + + If String.IsNullOrEmpty(Me.RFCReceptorVenta) Then + RFCReceptor = LblRFC.Text.Trim + + 'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA + If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then + RFCReceptor = Me.ClienteSucursal.RFC + End If + Else + RFCReceptor = Me.RFCReceptorVenta + End If Dim SWatch As New Stopwatch @@ -25057,7 +25095,7 @@ Partial Class Ventas ' CancelarRefacturada() 'End If - Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True) + Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=True) Try Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing Dim strMensaje As New StringBuilder()