diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 5ce542163..0fa040293 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -4122,7 +4122,7 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function GetAnexoCatalogoMensual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, CveUsuario As Integer) As Boolean + Public Function GetAnexoCatalogoMensual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, CveUsuario As Integer, Periodo As Integer) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoMensualGet") @@ -4134,18 +4134,19 @@ Public Class ClsContabilidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Divisor", SqlDbType.Int).Value = Divisor .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Periodo", SqlDbType.Int).Value = Periodo End With Try SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal CC", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal Mensual", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno End Function - Public Function GetAnexoCatalogoAnual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, EjercicioFinal As Integer, Divisor As Integer, CveUsuario As Integer) As Boolean + Public Function GetAnexoCatalogoAnual(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, EjercicioFinal As Integer, Divisor As Integer, CveUsuario As Integer, Periodo As Integer) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoAnualGet") @@ -4159,6 +4160,7 @@ Public Class ClsContabilidad .Add("@EjercicioFinal", SqlDbType.Int).Value = EjercicioFinal .Add("@Divisor", SqlDbType.Int).Value = Divisor .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Periodo", SqlDbType.Int).Value = Periodo End With @@ -4166,12 +4168,13 @@ Public Class ClsContabilidad SqlAdapter.Fill(DSet) Retorno = True Catch ex As Exception - Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal CC", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al obtener el Estado Resultados Horizontal Anual", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno End Function - Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer) As Boolean + + Public Function GetAnexoCatalagoCC(CveCuenta As Integer, Ejercicio As Integer, CveSubproyecto As Integer, CveEmpresa As Integer, Divisor As Integer, Periodo As Integer) As Boolean Dim Retorno = False DataAdapter("PA_Conta_AnexoCatalogoCCGet") @@ -4181,6 +4184,10 @@ Public Class ClsContabilidad .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio .Add("@CveSubproyecto", SqlDbType.Int).Value = CveSubproyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Divisor", SqlDbType.Int).Value = Divisor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Periodo", SqlDbType.Int).Value = Periodo + End With Try @@ -6237,7 +6244,7 @@ Public Class ClsContabilidad End Function - Public Function GetEstadosAnualHorizontal(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1) As Boolean + Public Function GetEstadosAnualHorizontal(FechaI As Date, FechaF As Date, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1, Optional Periodo As Integer = 12) As Boolean Dim Retorno = False DataAdapter("PA_Conta2_EstadoResultadosAnualHorizontal") @@ -6250,6 +6257,7 @@ Public Class ClsContabilidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@Tipo", SqlDbType.Int).Value = Tipo + .Add("@Periodo", SqlDbType.Int).Value = Periodo End With diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 974bce081..7d260f7a6 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -4632,7 +4632,7 @@ Public Class ClsInventarios #Region "INVENTARIOS - REPORTE UNIFORMES RESGUARDO" - Public Function GetResguardoUniformesRep(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveDepartamento As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1") As Boolean + Public Function GetResguardoUniformesRep(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveDepartamento As Integer = -1, Optional FechaInicio As String = "-1", Optional FechaFin As String = "-1", Optional Todo As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ResguardoUniformesRep") @@ -4643,6 +4643,7 @@ Public Class ClsInventarios .Add("@CveDepartamento", SqlDbType.Int).Value = CveDepartamento .Add("@FechaInicio", SqlDbType.VarChar).Value = FechaInicio .Add("@FechaFin", SqlDbType.VarChar).Value = FechaFin + .Add("@Todo", SqlDbType.Bit).Value = Todo End With Try SqlAdapter.Fill(Data) diff --git a/Ashx/GenerarPDFFactura.ashx b/Ashx/GenerarPDFFactura.ashx index b6a4e841c..e1b597879 100644 --- a/Ashx/GenerarPDFFactura.ashx +++ b/Ashx/GenerarPDFFactura.ashx @@ -44,7 +44,13 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Dim ListaDS = New List(Of ReportDataSource) Dim Parametros As New List(Of ReportParameter) - Dim Formato = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReporteAPI.rdlc" + Dim Formato As String = "" + + If datos.API_SALI Then + Formato = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReporteAPISali.rdlc" + Else + Formato = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReporteAPI.rdlc" + End If Parametros.Add(New ReportParameter("Empresa", datos.Empresa.Empresa)) Parametros.Add(New ReportParameter("RFC", datos.Empresa.RFC)) @@ -69,6 +75,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Parametros.Add(New ReportParameter("UsoCFDI", datos.Factura.UsoCFDI)) Parametros.Add(New ReportParameter("Vencimiento", datos.Factura.FechaVencimiento)) Parametros.Add(New ReportParameter("SubTotal", datos.Factura.SubTotal)) + Parametros.Add(New ReportParameter("Descuentos", datos.Factura.Descuentos)) Parametros.Add(New ReportParameter("IVA", datos.Factura.IVA)) Parametros.Add(New ReportParameter("IEPS", datos.Factura.IEPS)) Parametros.Add(New ReportParameter("Total", datos.Factura.Total)) @@ -81,8 +88,17 @@ Public Class GenerarPDFFactura : Implements IHttpHandler DtDatos.Columns.Add(New DataColumn("PU", GetType(Decimal))) DtDatos.Columns.Add(New DataColumn("IVA", GetType(Decimal))) DtDatos.Columns.Add(New DataColumn("IEPS", GetType(Decimal))) + DtDatos.Columns.Add(New DataColumn("Descuento", GetType(Decimal))) DtDatos.Columns.Add(New DataColumn("Total", GetType(Decimal))) + Dim DtImpuestos As New DataTable + DtImpuestos.Columns.Add(New DataColumn("Impuesto", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("Tipo", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("Base", GetType(Decimal))) + DtImpuestos.Columns.Add(New DataColumn("TipoFactor", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("TasaOCuota", GetType(String))) + DtImpuestos.Columns.Add(New DataColumn("Importe", GetType(Decimal))) + For Each PS In datos.Factura.ListaProductos Dim Row = DtDatos.NewRow() Row("Cantidad") = PS.Cantidad @@ -91,12 +107,24 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Row("PU") = PS.PU Row("IVA") = PS.IVA Row("IEPS") = PS.IEPS + Row("Descuento") = PS.Descuento Row("Total") = (PS.Cantidad * PS.PU) + PS.IVA + PS.IEPS DtDatos.Rows.Add(Row) Next + Dim RowImpuesto = DtImpuestos.NewRow() + RowImpuesto("Impuesto") = "IVA" + RowImpuesto("Tipo") = "Traslado" + RowImpuesto("Base") = datos.Factura.SubTotal + RowImpuesto("TipoFactor") = "Tasa" + RowImpuesto("TasaOCuota") = "16%" + RowImpuesto("Importe") = datos.Factura.IVA + + DtImpuestos.Rows.Add(RowImpuesto) + ListaDS.Add(New ReportDataSource("DsProductos", DtDatos)) + ListaDS.Add(New ReportDataSource("DsImpuestos", DtImpuestos)) ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "Factura") End If @@ -337,6 +365,7 @@ Public Class GenerarPDFFactura : Implements IHttpHandler Public Property Cliente As ClienteWS Public Property Empresa As EmpresaWS Public Property Timbrado As DatosSATWS + Public Property API_SALI As Boolean End Class diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index bd5cbd3fa..7b3891368 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -2469,17 +2469,25 @@ Partial Class Bancos_IE - 'If CveOCSolicitudAnticipo > 0 Then - ' If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then - ' EsValido = False - ' Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) + If CveOCSolicitudAnticipo > 0 Then - ' End If - 'End If - + Dim ObjOC As New ClsOC + If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then + SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal + Else + SaldoOCAnticipo = 0 + End If + ObjOC.Dispose() + + If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then + EsValido = False + Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) + End If + End If Return EsValido + End Function Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) diff --git a/Contabilidad/LibroDiario.aspx.vb b/Contabilidad/LibroDiario.aspx.vb index d3507a095..fd61a89cf 100644 --- a/Contabilidad/LibroDiario.aspx.vb +++ b/Contabilidad/LibroDiario.aspx.vb @@ -51,11 +51,12 @@ Partial Class Contabilidad_LibroDiario InicializaValores() - If UsuarioActual.Empresa.UsaAC Then - BtnConsultar.Enabled = True - Else - Alert("La empresa no usa Armonización Contable", TipoMensaje.MsgError) - End If + BtnConsultar.Enabled = True + 'If UsuarioActual.Empresa.UsaAC Then + ' BtnConsultar.Enabled = True + 'Else + ' Alert("La empresa no usa Armonización Contable", TipoMensaje.MsgError) + 'End If End If End Sub @@ -212,7 +213,6 @@ Partial Class Contabilidad_LibroDiario #Region " IMPRIMIR " -#End Region Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click 'FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate) 'FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate) @@ -245,5 +245,6 @@ Partial Class Contabilidad_LibroDiario ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/Grales/Formatos/LibroDiario.rpt"), DtDatos, lista, "LibroDiario", Formato), "LibroDiario", Formato) End Sub +#End Region End Class diff --git a/Contabilidad2/RepAnexoCatalogoAnual.aspx b/Contabilidad2/RepAnexoCatalogoAnual.aspx index ffe9e4e8a..569e1ad17 100644 --- a/Contabilidad2/RepAnexoCatalogoAnual.aspx +++ b/Contabilidad2/RepAnexoCatalogoAnual.aspx @@ -25,17 +25,38 @@