diff --git a/AF/AF.aspx b/AF/AF.aspx index 2234d7bf7..33c02cd41 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -154,6 +154,21 @@ +
+
+ +
+ +
+
+ + +
+
+
+ +
+
@@ -179,20 +194,7 @@
-
-
- -
- -
-
- - -
-
-
- -
+
diff --git a/AF/CatAF.aspx b/AF/CatAF.aspx index 393b4fbb2..b32f78b85 100644 --- a/AF/CatAF.aspx +++ b/AF/CatAF.aspx @@ -72,7 +72,7 @@ -
+
@@ -131,7 +131,8 @@
Cliente:
- + <%----%> +
Grupo:
diff --git a/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb index a9dac3d27..239c3235c 100644 --- a/AF/CatAF.aspx.vb +++ b/AF/CatAF.aspx.vb @@ -95,9 +95,20 @@ Partial Class AF_CatAF 'DdlProyecto.DataBind() 'DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlCliente.DataBind() - DdlCliente.Items.Insert(0, New ListItem("Todos", "-1")) + 'DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + 'DdlCliente.DataBind() + 'DdlCliente.Items.Insert(0, New ListItem("Todos", "-1")) + + 'CargaClientes + Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + If EsWS Then + DdlClientes.setEsWebService(True) + Else + DdlClientes.setEsWebService(False) + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + DdlClientes.DataBind() + DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + End If CargarTipoActivoFijo() CargaGrupos() @@ -234,7 +245,8 @@ Partial Class AF_CatAF If intContador > 0 Then strSQL1.AppendFormat(" group by CveActivoFijo having count(*)={0}", intContador) - If ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, Codigo, Descripcion, DdlTipoActivo.SelectedValue.ToEntero, DdlSubTipoActivo.SelectedValue.ToEntero, NoSerie, Año, CvePersonaResponsable, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, strSQL1.ToString, -1, CveGrupo:=DdlGrupo.SelectedValue.ToEntero) Then + Dim Cvecliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1) + If ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, Codigo, Descripcion, DdlTipoActivo.SelectedValue.ToEntero, DdlSubTipoActivo.SelectedValue.ToEntero, NoSerie, Año, CvePersonaResponsable, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, strSQL1.ToString, CveCliente:=CveCliente, CveGrupo:=DdlGrupo.SelectedValue.ToEntero) Then If ObjAF.DtResultados.Rows.Count > 0 Then DtActivosFijos = ObjAF.DtResultados 'GvDatos.DataSource = ObjAF.DtResultados diff --git a/AF/CatModelos.aspx.vb b/AF/CatModelos.aspx.vb index 10b5fe558..30134ec70 100644 --- a/AF/CatModelos.aspx.vb +++ b/AF/CatModelos.aspx.vb @@ -3,10 +3,11 @@ Option Strict On Imports System.Data Imports System.Linq +Imports CFDi Imports Extensiones Partial Class AF_CatModelos - Inherits ClsPaginas + Inherits ClsPaginas #Region " PROPIEDADES" @@ -71,7 +72,13 @@ Partial Class AF_CatModelos CargaDatos() ObjAF.Dispose() UpDatos.Update() + RegarGlobalDT() End Sub + + Private Sub RegarGlobalDT() + GlobalDTModeloActivoFijo(UsuarioActual.CveEmpresa, -1) = Nothing + End Sub + Public Sub Edit_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) HdnModalidad.Value = "U" @@ -101,6 +108,7 @@ Partial Class AF_CatModelos End If ObjAF.Dispose() UpDatos.Update() + RegarGlobalDT() End Sub Private Sub GvModelo_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvModelos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 836808ff2..7a7dfdde6 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1637,7 +1637,7 @@ Partial Class Bancos_IE DdlCuenta.Items.Clear() Dim dt As DataTable - If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(127) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Else dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 3214eed66..5b9c971a6 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -529,7 +529,7 @@
Recolección
- + @@ -775,7 +775,7 @@
- +
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index cecb271b0..7342b296b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -17044,6 +17044,8 @@ Partial Class Compras_Compras ' End If 'End If + + Select Case Modalidad Case "A" 'ADD @@ -17058,11 +17060,13 @@ Partial Class Compras_Compras Else IVA = Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) End If + + AddPS(TxtCantidad.Text.Trim.ToDecimal, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero, DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDecimal, Total, IVA, TxtRetIVAModal.Text.ToDecimal / 100, TxtRetISRModal.Text.ToDecimal / 100, TxtIEPSModal.Text.ToDecimal / 100, 0, TxtDescuentoModal.Text.ToDecimal, OtrosGastos:=0, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text, NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS, CveContratoDetalle:=CveContratoDetalle, - CveCultivoCuadroDetalle:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedValue.ToEntero, -1), TemporadaCuadro:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedItem.Text, "")) + CveCultivoCuadroDetalle:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedValue.ToEntero, -1), TemporadaCuadro:=If(DdlCultivosCuadro.SelectedValue.ToEntero > 0, DdlCultivosCuadro.SelectedItem.Text, ""), CodigoPS:=CodigoPS) AddPS2() LimpiaAgregar() @@ -17135,11 +17139,13 @@ Partial Class Compras_Compras Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Decimal = 0, Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Decimal = 0, Optional PorcentajeIEPS As Decimal = 0, Optional PorcentajeRetIVA As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, - Optional CveSATPSActualizado As Boolean = False, Optional TemporadaCuadro As String = "") As Integer + Optional CveSATPSActualizado As Boolean = False, Optional TemporadaCuadro As String = "", Optional CodigoPS As String = "") As Integer Dim Row As DataRow = Nothing - + If Not TmpDT.Columns.Contains("CodigoPS") Then + TmpDT.Columns.Add("CodigoPS") + End If Row = TmpDT.NewRow() Dim Retorno As Integer = 0 @@ -17224,6 +17230,12 @@ Partial Class Compras_Compras Row("Clasificacion") = Clasificacion Row("CvePS") = CvePS Row("PS") = PS + + If CodigoPS.Trim = "" Then + CodigoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CodigoPS") + End If + Row("CodigoPS") = CodigoPS + Row("CveTipoPS") = CveTipoPS Row("PSDescripcion") = PSDescripcion @@ -17407,6 +17419,9 @@ Partial Class Compras_Compras DrPS("Clasificacion") = PSRow("Clasificacion").ToString DrPS("CvePS") = DdlPS.SelectedValue DrPS("PS") = PSRow("PS").ToString + + DrPS("CodigoPS") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimeroValor("CodigoPS") + DrPS("CveTipoPS") = CveTipoPS DrPS("CveSATPS") = PSRow("CveSATPS").ToString.ToEntero DrPS("SATClaveProductoServicio") = PSRow("SATClaveProductoServicio").ToString diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 8a2dcc8c5..607b43dc6 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -606,7 +606,7 @@ Partial Class General_SaldosIniciales Exit Sub End If - If Not dt.Columns(5).ColumnName = "AgrupadorSAT" Then + If Not dt.Columns(4).ColumnName = "AgrupadorSAT" Then Alert("El nombre de la quinta columna debe ser 'AgrupadorSAT'. Favor de corregirlo", TipoMensaje.MsgError) Exit Sub End If @@ -855,6 +855,7 @@ Partial Class General_SaldosIniciales Dim Linea As String = If(Row.Table.Columns.Contains("Linea"), Row("Linea").ToString().Trim, "") Dim Modelo As String = If(Row.Table.Columns.Contains("Modelo"), Row("Modelo").ToString().Trim, "") Dim RetIVA As Decimal = If(Row.Table.Columns.Contains("RetIVA"), Row("RetIVA").ToString().Trim.ToDecimal, 0D) + Dim NumeroParte As String = If(Row.Table.Columns.Contains("NumeroParte"), Row("NumeroParte").ToString().Trim, "") Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString().ToEntero() @@ -973,7 +974,7 @@ Partial Class General_SaldosIniciales 'If Not CveClasificacion2 > 0 AndAlso Clasificacion2 <> "" Then Alert("No se encontró la Serie: " + Clasificacion2, TipoMensaje.MsgAdvertencia) : ErrorPS = True : Exit For If CvePS > 0 Then - If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, RetIVA, False, -1, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS, UsuarioActual.CveEmpresa, + If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, NumeroParte, CodigoBarras, Descripcion, Precio, -1, RetIVA, False, -1, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS, UsuarioActual.CveEmpresa, CveTipoPS:=CveTipoPS, CveMarca:=CveMarca, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveTamaño:=CveTamaño, AplicaSerie:=AplicaSerie, CveObjetoImpuesto:=2) Then 'If Not ObjPS.UpdatePS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, 0, 1, 1, False, 0, True, True, True, UsuarioActual.CveUsuario, CvePS, -1, -1, CveSATPS, @@ -987,7 +988,7 @@ Partial Class General_SaldosIniciales Else 'If Codigo.Length > 0 Then - If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, RetIVA, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, + If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, NumeroParte, CodigoBarras, Descripcion, Precio, -1, RetIVA, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveClasificacionDetalle:=CveClasificacionDetalle, AplicaSerie:=AplicaSerie, CveObjetoImpuesto:=2) <= 0 Then 'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index 56c8fb0dc..091061b30 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -591,7 +591,7 @@ Partial Class Ventas_ActualizarPrecios End If If Not Correcto Then - ProductosNoCargados.AppendFormat("{0},", row("Producto / Servicio").ToString()) + ProductosNoCargados.AppendFormat("{0}-{1},", row(0).ToString(), row("Producto / Servicio").ToString()) RowsNoCargados += 1 End If Next diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index f3d03f077..250fe13ba 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -136,7 +136,7 @@ Partial Class CatClasificaciones Public Sub CargaDatos() Dim ObjClasificaciones As New ClsClasificaciones If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then - ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") + ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($" (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") '' comentado. (Codigo IS NULL OR Codigo = '') AND Else Me.GvDatos.DataSource = Nothing End If diff --git a/Ventas/FacturacionGlobal.aspx.vb b/Ventas/FacturacionGlobal.aspx.vb index a5e219498..fc174e83d 100644 --- a/Ventas/FacturacionGlobal.aspx.vb +++ b/Ventas/FacturacionGlobal.aspx.vb @@ -110,7 +110,7 @@ Partial Class Ventas_FacturacionGlobal GvDatos.Columns(7).Visible = True End If - Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() + Dim CveCliente As Integer = -1 'UsuarioActual.Empresa.Funcionalidad(714).ToEntero() Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") @@ -152,7 +152,7 @@ Partial Class Ventas_FacturacionGlobal End Sub Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) - Dim CveCliente As Integer = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() + Dim CveCliente As Integer = -1 'UsuarioActual.Empresa.Funcionalidad(714).ToEntero() Dim CveMoneda As Integer = 1 Dim SbRemisiones As New StringBuilder() @@ -232,8 +232,8 @@ Partial Class Ventas_FacturacionGlobal ObjFactura.PreparaTimbre() - If Math.Abs(ObjFactura.Total.RoundSQL(2) - DtPagosFacturaGlobal.SUMD("Importe").RoundSQL(2)) > 0.01 Then - Alert("Los pagos no coinciden con el total de la factura", TipoMensaje.MsgError) + If Math.Abs(ObjFactura.Total.RoundSQL(2) - DtPagosFacturaGlobal.SUMD("Importe").RoundSQL(2)) > 0.1 Then + Alert($"Los pagos no coinciden con el total de la factura [{ObjFactura.Total.RoundSQL(2)}-{ DtPagosFacturaGlobal.SUMD("Importe").RoundSQL(2)}]", TipoMensaje.MsgError) Exit Sub End If diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb index 7c1c7fd05..df3f633dd 100644 --- a/Ventas/PVCobranza.aspx.vb +++ b/Ventas/PVCobranza.aspx.vb @@ -346,6 +346,7 @@ Partial Class Ventas_PVCobranza Dim MsgError As String = "" Dim SaldoPendiente As Decimal = DbRowVenta("Saldo").ToString.ToDecimal + Dim SaldoTotalInicial As Decimal = DbRowVenta("Saldo").ToString.ToDecimal Dim PagoAplicado As Decimal = 0 Dim ObjConta As New ClsContabilidad @@ -384,8 +385,8 @@ Partial Class Ventas_PVCobranza Dim PagoEfectivo As Decimal = TxtImporteEfectivo.Text.ToDecimal PagoAplicado += PagoEfectivo - If PagoAplicado > VentaActual.Total Then - TxtCambio.Text = (PagoAplicado - VentaActual.Total).FormatoNumero + If PagoAplicado >= SaldoTotalInicial Then + TxtCambio.Text = (PagoAplicado - SaldoTotalInicial).FormatoNumero PagoEfectivo = SaldoPendiente End If MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2)