diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index 6d82dd232..8d42dc3a9 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -380,7 +380,8 @@ - + + diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 4e3b0b213..5098d660e 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4350,11 +4350,13 @@ Public Class ClsBancos Return Retorno End Function - Public Function GetAcreedoresReporte(CveEmpresa As Integer) As Boolean + Public Function GetAcreedoresReporte(CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Banc_AcreedorReporte") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index e8509be9f..fc6fbae9c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5288,11 +5288,11 @@ Public Class ClsPaginas If sw IsNot Nothing AndAlso Not (Not User.Identity.IsAuthenticated OrElse UsuarioActual Is Nothing) Then sw.Stop() - If Not Page.IsPostBack Then - Using ObjUsuario As New ClsSisUsuarios - ObjUsuario.AddBitacora(CveModulo, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request.Url.PathAndQuery.ToString(), sw.ElapsedMilliseconds) - End Using - End If + 'If Not Page.IsPostBack Then + ' Using ObjUsuario As New ClsSisUsuarios + ' ObjUsuario.AddBitacora(CveModulo, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Request.Url.PathAndQuery.ToString(), sw.ElapsedMilliseconds) + ' End Using + 'End If End If If Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString.Length > 0 Then @@ -6834,13 +6834,6 @@ Public Class ClsPaginas params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) - 'ALAN YEPIZ - If UsuarioActual.CveEmpresa.Contiene(123) Then - params.Add(New ReportParameter("DiaExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Day))) - params.Add(New ReportParameter("MesExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Month))) - params.Add(New ReportParameter("AñoExpedicion", String.Format("{0}", Vta.Fecha.ToDate.Year))) - End If - RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) Case "Cot" diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 42549491e..bed33b7e6 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -2981,8 +2981,10 @@ Public Class Timbrado comprobante.Conceptos(i).ClaveProdServ = concep.ClaveProdServ If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then - comprobante.Conceptos(i).Descuento = concep.Descuento - comprobante.Conceptos(i).DescuentoSpecified = True + If concep.Descuento > 0 Then + comprobante.Conceptos(i).Descuento = concep.Descuento + comprobante.Conceptos(i).DescuentoSpecified = True + End If End If If concep.Noidentificacion <> "" Then comprobante.Conceptos(i).NoIdentificacion = concep.Noidentificacion @@ -2996,33 +2998,39 @@ Public Class Timbrado k = 0 'SI NO ES FACTURA EN 0 AGREGA LOS IMPUESTOS If Not ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("P", "N") AndAlso (Ventas.Total <> 0 OrElse (ObjCFDITimbre.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.TotalImpuestosTrasladados > 0)) Then - comprobante.Conceptos(i).Impuestos = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestos() - comprobante.Conceptos(i).Impuestos.Traslados = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion = "T").Count - 1) {} - If concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count > 0 Then - comprobante.Conceptos(i).Impuestos.Retenciones = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count - 1) {} + + If concep.Impuestos.Count > 0 Then + + comprobante.Conceptos(i).Impuestos = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestos() + comprobante.Conceptos(i).Impuestos.Traslados = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion = "T").Count - 1) {} + If concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count > 0 Then + comprobante.Conceptos(i).Impuestos.Retenciones = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion(concep.Impuestos.FindAll(Function(p As CFDIConceptosImpuestos) p.TrasladooRetencion <> "T").Count - 1) {} + End If + + For Each imp As CFDIConceptosImpuestos In concep.Impuestos + If imp.TrasladooRetencion = "T" Then + comprobante.Conceptos(i).Impuestos.Traslados(j) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado() + comprobante.Conceptos(i).Impuestos.Traslados(j).Base = imp.Base + comprobante.Conceptos(i).Impuestos.Traslados(j).Impuesto = imp.Impuesto + comprobante.Conceptos(i).Impuestos.Traslados(j).TipoFactor = imp.TipoFactor + comprobante.Conceptos(i).Impuestos.Traslados(j).Importe = imp.Importe + comprobante.Conceptos(i).Impuestos.Traslados(j).ImporteSpecified = True + comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuota = imp.TasaOCuota.FormatoNumero(6) + comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuotaSpecified = True + j += 1 + Else + comprobante.Conceptos(i).Impuestos.Retenciones(k) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion() + comprobante.Conceptos(i).Impuestos.Retenciones(k).Base = imp.Base + comprobante.Conceptos(i).Impuestos.Retenciones(k).Impuesto = imp.Impuesto + comprobante.Conceptos(i).Impuestos.Retenciones(k).TipoFactor = imp.TipoFactor + comprobante.Conceptos(i).Impuestos.Retenciones(k).Importe = imp.Importe + comprobante.Conceptos(i).Impuestos.Retenciones(k).TasaOCuota = imp.TasaOCuota.ToString.ToDecimal + k += 1 + End If + Next End If - For Each imp As CFDIConceptosImpuestos In concep.Impuestos - If imp.TrasladooRetencion = "T" Then - comprobante.Conceptos(i).Impuestos.Traslados(j) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosTraslado() - comprobante.Conceptos(i).Impuestos.Traslados(j).Base = imp.Base - comprobante.Conceptos(i).Impuestos.Traslados(j).Impuesto = imp.Impuesto - comprobante.Conceptos(i).Impuestos.Traslados(j).TipoFactor = imp.TipoFactor - comprobante.Conceptos(i).Impuestos.Traslados(j).Importe = imp.Importe - comprobante.Conceptos(i).Impuestos.Traslados(j).ImporteSpecified = True - comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuota = imp.TasaOCuota.FormatoNumero(6) - comprobante.Conceptos(i).Impuestos.Traslados(j).TasaOCuotaSpecified = True - j += 1 - Else - comprobante.Conceptos(i).Impuestos.Retenciones(k) = New Profact.TimbraCFDI33.ComprobanteConceptoImpuestosRetencion() - comprobante.Conceptos(i).Impuestos.Retenciones(k).Base = imp.Base - comprobante.Conceptos(i).Impuestos.Retenciones(k).Impuesto = imp.Impuesto - comprobante.Conceptos(i).Impuestos.Retenciones(k).TipoFactor = imp.TipoFactor - comprobante.Conceptos(i).Impuestos.Retenciones(k).Importe = imp.Importe - comprobante.Conceptos(i).Impuestos.Retenciones(k).TasaOCuota = imp.TasaOCuota.ToString.ToDecimal - k += 1 - End If - Next + End If i += 1 Next diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 0f859956c..80424468e 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -3450,9 +3450,16 @@ Partial Class Bancos_IE Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC) Dim CveCuentaIVAxAcreditarDevDinC = 0 Dim CveCuentaIVAAcreditableDevDinC = 0 - Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero - Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + Dim IdCtaIVAXAcreditarDevDinC As Integer + Dim IdCtaIVAAcreditableDevDinC As Integer + + If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then + IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero + IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero + Else + MsgError = "Sin Registros de porcentaje impuesto" + End If Dim IVADevMN As Decimal = 0 Dim IEPSDevMN As Decimal = 0 @@ -4508,7 +4515,8 @@ Partial Class Bancos_IE End If If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then + + If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then ErrorCancelar = True MensajeError = "Error al contabilizar poliza" End If diff --git a/Bancos/PagoAcreedor.aspx b/Bancos/PagoAcreedor.aspx index e51215961..934cc2d4e 100644 --- a/Bancos/PagoAcreedor.aspx +++ b/Bancos/PagoAcreedor.aspx @@ -385,6 +385,93 @@ + + +
+
+
+ + +
+
+
+ +
Fecha Inicio:
+
+
+ <%--width: 120px !important;--%> + + + + + + + + + + <%----%> + + + <%----%> + + +
+
+
Fecha Fin:
+
+ +
+ <%--width: 120px !important;--%> + + + + + + + + <%----%> + + + <%----%> + + +
+
+ +
+
+ +
+ +
+ + + + +
diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index cdcd5066d..bf115dfad 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -931,14 +931,29 @@ public partial class Bancos_PagoAcreedor : ClsPaginas #region"REPORTE" protected void CargaReporte() { + + DateTime FInicio = MinFecha; + DateTime FFin = MaxFecha; + + if(TxtFechaInicio.Text.Length == 10) + { + FInicio = TxtFechaInicio.Text.ToDate(); + } + + if(TxtFechaFin.Text.Length == 10) + { + FFin = TxtFechaFin.Text.ToDate(); + } + ClsBancos bancos = new ClsBancos(); - if (bancos.GetAcreedoresReporte(UsuarioActual.CveEmpresa)) + if (bancos.GetAcreedoresReporte(UsuarioActual.CveEmpresa, FInicio, FFin)) { GvReporte.DataSource = bancos.DtResultados; GvReporte.DataBind(); } bancos.Dispose(); UpReporte.Update(); + } protected void GvReporte_RowDataBound(object sender, GridViewRowEventArgs e) { @@ -970,4 +985,9 @@ public partial class Bancos_PagoAcreedor : ClsPaginas UpDatos.Update(); UpMovAcreedor.Update(); } + + protected void BtnConsultarReporte_Click(object sender, EventArgs e) + { + CargaReporte(); + } } diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 950682e27..98ca9289b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4053,7 +4053,7 @@ Partial Class Compras_Compras 'Verifica funcionalidad 702 "Require orden de compra para factura de compra" - If UsuarioActual.Empresa.Funcionalidad(702) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(128) <> "" Then If Not EstaAsociadoACajaChica And Not EstaAsociadoAPersonal Then If Not CompraEstaVinculadaOC Then Alert("Debe de vincular una orden de compra para registrar la factura") diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 99cd97ad1..1eaa7301e 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -910,7 +910,7 @@ Partial Class PopUpVerFactura If Archivo.Exists Then HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf") + HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name).ToLower = "xml", "application/xml", "application/pdf") HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) HttpContext.Current.Response.TransmitFile(Path) diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 197c8bf07..6756eca1a 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -542,7 +542,7 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 205, 206, 14, 15, 16, 19, 25, 26, 21, 18, 60) Then CargaProveedores() DdlProveedores.Visible = True DdlCompras.Visible = True @@ -557,7 +557,7 @@ Partial Class ContabilidadC_RegPrePoliza Else DdlPersonal.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientes() DdlClientes.Visible = True DdlVentas.Visible = True @@ -594,11 +594,21 @@ Partial Class ContabilidadC_RegPrePoliza End Sub Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged - CargaCompras(DdlProveedores.SelectedValue.ToEntero) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + CargaNotasCreditoCompras(DdlProveedores.SelectedValue.ToEntero, DdlCompras) + Else + CargaCompras(DdlProveedores.SelectedValue.ToEntero) + End If + End Sub Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange - CargaVentas(DdlClientes.SelectedValue.ToEntero) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(12, 91) Then + CargaVentas(DdlClientes.SelectedValue.ToEntero) + Else + CargaVentas(DdlClientes.SelectedValue.ToEntero) + End If + End Sub Private Sub CargaSubProyectos() @@ -646,6 +656,24 @@ Partial Class ContabilidadC_RegPrePoliza End If End Sub + Private Sub CargaNotasCreditoCompras(CveProveedor As Integer, ddl As DropDownList) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + Dim ObjCompras As New ClsCompras + + ddl.ClearSelection() + If ObjCompras.GetCompras(UsuarioActual.CveEmpresa, "NC", "-1", "-1", "-1", "-1", "-1", "-1", "-1", "-1", CveProveedor:=CveProveedor, TopSelect:=1000) Then + ddl.DataSource = ObjCompras.DtResultados '.FiltraParametros("Saldo <> 0") + ddl.DataBind() + ddl.Items.Insert(0, New ListItem(" - ", "-1")) + Else + ddl.DataSource = Nothing + ddl.DataBind() + ddl.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjCompras.Dispose() + End If + End Sub + Private Sub CargaClientes() DdlClientes.setEsWebService(True) DdlClientes.Attributes.Add("data-metodo", "getcliente") @@ -676,6 +704,22 @@ Partial Class ContabilidadC_RegPrePoliza ObjVentas.Dispose() End Sub + Private Sub CargaNotasCreditoVentas(CveCliente As Integer) + Dim ObjVentas As New ClsVentas + + DdlVentas.ClearSelection() + If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0") + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + Else + DdlVentas.DataSource = Nothing + DdlVentas.DataBind() + DdlVentas.Items.Insert(0, New ListItem(" - ", "-1")) + End If + ObjVentas.Dispose() + End Sub + Private Sub CargaPersonal() DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonal.DataBind() @@ -904,15 +948,7 @@ Partial Class ContabilidadC_RegPrePoliza Dim IdCtaContable As Integer = 0 Dim PorcentajeImpuesto As Decimal = 0 - 'Registra movimieno bancario - If CveConcepto = 30 Then - CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" - CveIEInsertado = CveIE - If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then - FolioIE = ObjIE.Folio - End If - End If + Dim CveProveedor As Integer = -1 @@ -945,7 +981,18 @@ Partial Class ContabilidadC_RegPrePoliza CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero Else If CveConcepto = 30 Then + 'Registra movimieno bancario + If CveConcepto = 30 Then + CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario" + CveIEInsertado = CveIE + If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then + FolioIE = ObjIE.Folio + End If + End If + CveIE = CveIEInsertado + Else CveIE = -1 End If @@ -993,7 +1040,7 @@ Partial Class ContabilidadC_RegPrePoliza 'MENSAJE PRINCIPAL MensajeAlert.AppendFormat("

Folio de Póliza: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio) - MensajeAlert.AppendFormat("

Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio) + MensajeAlert.AppendFormat("

Prepóliza: {1}", CvePrePoliza, ObjMov.ContaFolio) 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion) Else Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") @@ -1671,7 +1718,12 @@ Partial Class ContabilidadC_RegPrePoliza Protected Sub DdlProveedores_SelectedIndexChanged1(sender As Object, e As EventArgs) Dim ddl As DropDownList = CType(sender, DropDownList) Dim ddl2 As DropDownList = DirectCast(ddl.BindingContainer, GridViewRow).FCDropDownList("DdlCompras") - CargaCompras2(ddl.SelectedValue.ToEntero, ddl2) + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(18, 60) Then + CargaNotasCreditoCompras(ddl.SelectedValue.ToEntero, ddl2) + Else + CargaCompras2(ddl.SelectedValue.ToEntero, ddl2) + End If + End Sub Private Sub CargaCompras2(CveProveedor As Integer, ddl As DropDownList) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2210878a2..a358c4250 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -514,7 +514,7 @@ Partial Class ContabilidadC_RegPrePolizaS Else DdlPersonal.Visible = False End If - If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientes() DdlClientes.Visible = True DdlVentas.Visible = True @@ -542,7 +542,11 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub Private Sub CargaCuentasContables() - DdlCtaContable.DataSource = Session("DtCuentas") + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + DdlCtaContable.DataSource = ObjConta.DtResultados + End If + ObjConta.Dispose() DdlCtaContable.DataBind() DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub @@ -1058,8 +1062,13 @@ Partial Class ContabilidadC_RegPrePolizaS DdlTipoGastoE.DataBind() DdlTipoGastoE.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub - Private Sub CargaCtaContableE() - DdlCtaContableE.DataSource = Session("DtCuentas") + Private Sub CargaCtaContableE() + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + DdlCtaContableE.DataSource = ObjConta.DtResultados + End If + ObjConta.Dispose() + DdlCtaContableE.DataBind() DdlCtaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub @@ -1086,7 +1095,7 @@ Partial Class ContabilidadC_RegPrePolizaS Else DdlClasificacionesE.Visible = False End If - If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then + If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39, 12, 91) Then CargaClientesE() DdlClientesE.Visible = True DdlVentasE.Visible = True diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index 0ac1a8eb6..58f533539 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -147,10 +147,10 @@ public partial class Contabilidad_RepIVA : ClsPaginas } if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0) { - Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() > 0 ? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() > 0 ? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0)); + Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0)); Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal() + Math.Round(e.Row.DBCampo("IVANoDeducible").ToDecimal()), 2); - if (dif > 1) + if (Math.Abs(dif) > 1) { e.Row.ForeColor = System.Drawing.Color.Red; e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err"; diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index fc9a9f92b..0a4a9ebf9 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -938,11 +938,11 @@ Partial Class Inventarios_RecepcionAlmacen TotalCompraOC = ObjCompras.DtResultados.Rows(0)("SubTotal").ToString.ToDecimal - ObjCompras.DtResultados.Rows(0)("Descuentos").ToString.ToDecimal CveTipoCompra = ObjCompras.DtResultados.Rows(0)("CveTipoCompra").ToString.ToEntero - If CveTipoCompra = 9 Then + If CveTipoCompra = 9 Then ' apoyo logistico CargaAlmacenes(-1, "27", CveTipoCompra) ElseIf CveTipoCompra = 10 Then CargaAlmacenes(-1, CveTipoCompra:=CveTipoCompra) - ElseIf TipoMovimiento = 3 Then + ElseIf TipoMovimiento = 3 Then 'devolucion al proveedor CargaAlmacenes(-1, "21,2", CveTipoCompra) Else CargaAlmacenes(-1) @@ -967,11 +967,14 @@ Partial Class Inventarios_RecepcionAlmacen CargaSoloUsados = True SumarImporteUsados = True DtRecepcion = ObjInventario.DtResultados.Copy() - If UsuarioActual.CveRol = 1 Then - CargaAlmacenes(-1, "22", CveTipoCompra) - Else - CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra) + If TipoMovimiento <> 3 Then 'sino es devolucion/NC + If UsuarioActual.CveRol = 1 Then + CargaAlmacenes(-1, "22", CveTipoCompra) + Else + CargaAlmacenes(DtRecepcion.Rows(0)("CveSubProyecto").ToString.ToEntero, "22", CveTipoCompra) + End If End If + Else DtRecepcion = ObjInventario.DtResultados.Copy() diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index d6c0cbaf4..4526e1692 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -244,7 +244,7 @@ Partial Class ProductosyServicios End If - If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) And CvePS = -1 Then + If UsuarioActual.CveEmpresa.Contiene(72, 80) And CvePS = -1 Then 'DivDatos.Attributes("class") = "col-md-12" TxtPS.Enabled = False DivDdlTipo.Visible = True