diff --git a/Acumuladores/RepIndicadorDiarioDetalle.aspx b/Acumuladores/RepIndicadorDiarioDetalle.aspx new file mode 100644 index 000000000..70cf16e06 --- /dev/null +++ b/Acumuladores/RepIndicadorDiarioDetalle.aspx @@ -0,0 +1,259 @@ +<%@ Page Title="Indicador diario detalle" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadorDiarioDetalle.aspx.vb" Inherits="Acumuladores_RepIndicadorDiarioDetalle" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + <%-- + +
+ +
+
+
--%> +
+ +
  • + Generar +
  • +
  • + Personalizar +
  • +
  • + Ver Dlls en pesos +
  • +
  • + Imprimir +
  • + + + + + + +
    + + Reporte de Productos Servicios + + + + + + +
    +
    +
    + + +
    +
    +
    + +
    + +
    +
    + Fecha Inicio: + +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: + +
    +
    +
    + + + + +
    + + + + + + +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + diff --git a/Acumuladores/RepIndicadorDiarioDetalle.aspx.vb b/Acumuladores/RepIndicadorDiarioDetalle.aspx.vb new file mode 100644 index 000000000..cd77622b5 --- /dev/null +++ b/Acumuladores/RepIndicadorDiarioDetalle.aspx.vb @@ -0,0 +1,67 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.IO +Imports Extensiones +Imports Microsoft.Reporting.WebForms +Imports System.IO.Compression + +Partial Class Acumuladores_RepIndicadorDiarioDetalle + Inherits ClsPaginas + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + + CargaParametrosDetalle() + + End If + End Sub + + +#Region " CARGA DATOS INICIALES " + + + Private Sub CargaParametrosDetalle() + + Dim Opcion As Integer = If(Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToEntero() > 0, Request("Opcion").ToEntero(), -1) + + Dim CveSubProyecto As Integer = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() > 0, Request("CveSubProyecto").ToEntero(), -1) + + + + End Sub +#End Region + +#Region " CARGA DATOS " + Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click + CargaDatos() + UPDatos.Update() + End Sub + + Private Sub CargaDatos() + + Dim ObjAcum As New ClsAcumuladores() + + Dim FechaI, FechaF As Date + FechaI = txtFechaI.Text.ToDate + FechaF = txtFechaF.Text.ToDate + + If ObjAcum.GetRepIndicadorDiarioDetalle(FechaI, FechaF, 1, -1, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjAcum.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjAcum.Dispose() + GvDatos.DataBind() + + End Sub + + +#End Region + + + + +End Class diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 14962f888..6a8a46e45 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -1135,7 +1135,7 @@ Public Class ClsAcumuladores End Function - Public Function GetRepIndicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProeycto As Integer, CveEmpresa As Integer) As Boolean + Public Function GetRepIndicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -1144,7 +1144,35 @@ Public Class ClsAcumuladores With SqlAdapter.SelectCommand.Parameters .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaFin", SqlDbType.Date).Value = FechaFin - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProeycto + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + + SqlAdapter.Fill(Data) + Retorno = True + + Catch ex As SqlException + + OnError("Ocurrió un error al consultar los datos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + + Return Retorno + End Function + + Public Function GetRepIndicadorDiarioDetalle(FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + SqlDataAdapter("PA_Acum_RepIndicadorDiarioDetalleGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 36a2814a5..e82343f8c 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -4012,7 +4012,7 @@ Public Class ClsGenerales End Function - Public Function GetInvEntregaAlmacenRutaRep(CveSubProyecto As Integer, CveEmpresa As Integer, Estatus As Integer, FechaInicio As Date, FechaFin As Date, CveChofer As Integer, Optional CveTimbre As Integer = -1) As Boolean + Public Function GetInvEntregaAlmacenRutaRep(CveSubProyecto As Integer, CveEmpresa As Integer, Estatus As Integer, FechaInicio As Date, FechaFin As Date, CveChofer As Integer, CveUsuario As Integer, Optional CveTimbre As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -4027,7 +4027,7 @@ Public Class ClsGenerales .Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@CveChofer", SqlDbType.Int).Value = CveChofer .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre - + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 2fcd6752f..fe1fe6f3f 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2298,7 +2298,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetInventarioFisico(CveInventarioFisico As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Estado As Integer) As Boolean + Public Function GetInventarioFisico(CveInventarioFisico As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Estado As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_InventarioFisicoGet") With SqlAdapter.SelectCommand.Parameters @@ -2306,6 +2306,7 @@ Public Class ClsInventarios .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@Estado", SqlDbType.Int).Value = Estado + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index f7896eacb..0eb004041 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -2036,7 +2036,7 @@ Public Class ClsPaginas End Set End Property 'Variables para Ventas - Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Boolean = True, Optional VendedorTipo As Integer = 1) As DataTable + Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional VendedorTipo As Integer = 1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTVendedores-{0}", CveEmpresa) 'sino existe, recarga los datos @@ -2047,10 +2047,15 @@ Public Class ClsPaginas End If If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0} AND CveEstatus = {1} AND VendedorTipo = {2}", CveEmpresa, If(Estatus, 1, 0), VendedorTipo), "", DataViewRowState.CurrentRows) + Dim StrSQL As New StringBuilder + StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) + If VendedorTipo >= 0 Then StrSQL.AppendFormat(" AND VendedorTipo = {0} ", VendedorTipo) + If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", If(Estatus = 1, True, False)) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) GlobalDTVendedores = Dv.ToTable Dv.Dispose() + Else GlobalDTVendedores = DirectCast(Application(AppNombre), DataTable) End If @@ -5633,7 +5638,8 @@ Public Class ClsPaginas PaginaDict.Add("/Acumuladores/CatTiposUso.aspx".ToUpper(), 1034) PaginaDict.Add("/Acumuladores/CatFoliosGarantia.aspx".ToUpper(), 1035) PaginaDict.Add("/Acumuladores/CatGarantiasMeses.aspx".ToUpper(), 1036) - PaginaDict.Add("/Acumuladores/RepIndicadorDiario.aspx".ToUpper(), 2055) + PaginaDict.Add("/Acumuladores/RepIndicadorDiario.aspx".ToUpper(), 730) + PaginaDict.Add("/Acumuladores/RepIndicadorDiarioDetalle.aspx".ToUpper(), 730) PaginaDict.Add("/Acumuladores/RepEntradasUsadosClientes.aspx".ToUpper(), 543) PaginaDict.Add("/Acumuladores/EntradasUsadosResumenRep.aspx".ToUpper(), 1032) @@ -7075,7 +7081,7 @@ Public Class ClsPaginas 'Si no tiene CBB, SE GENERA If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar() - CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB) + CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total, Vta.FolioFiscal, RutaCBB) End If 'ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme.Replace("https", "http"), Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 67bf2bda2..3e3bce08c 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2527,7 +2527,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString() + .Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object)) End With Try SqlAdapter.Fill(Data) @@ -2549,7 +2549,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo SqlDataAdapter("PA_RH_ChecadorAsistenciaAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString() + .Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object)) End With Try SqlAdapter.Fill(Data) @@ -7181,6 +7181,25 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo + Public Function UpPersonalAsistenciasMasiva(CveEmpresa As Integer, CveUsuario As Integer, xmlProductos As String) As Boolean + Dim Retorno As Boolean = False + Data = New DataTable + SqlDataAdapter("PA_RH_PersonalAsistenciasMasivaUP") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@xmlRegistros", SqlDbType.Xml).Value = If(String.IsNullOrEmpty(xmlProductos), DBNull.Value, DirectCast(xmlProductos.ToString(), Object)) + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar la asistencia masiva", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar la asistencia masiva.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function Public Function UpPersonalSupervisorMasiva(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpSupervisorMasiva)) As Boolean Dim Retorno As Boolean = False Dim xmlProductos As System.Xml.Linq.XDocument = Nothing @@ -7192,7 +7211,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - .Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString() + .Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object)) End With Try SqlAdapter.Fill(Data) diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 42753215c..c5b86d7a1 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -155,8 +155,7 @@ -
    -
    + @@ -219,11 +218,8 @@ -
    - - -
    - +
    +
    - -
    - +

    - @@ -266,6 +260,108 @@ <%----%> + + + + +
    +
    +
    +

    PÉRDIDA

    +
    + +
    + MXN + + + +
    +
    +
    +
    +
    +
    +

    GANANCIA

    +
    + +
    +
    +
    + MXN + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    +

    +
    + +
    +
    +
    + MXN + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    + +
    + + + + + +
    + +
    + + +
    +
    +
    + + + + + + + + + + + + <%----%> +
    +
    + @@ -349,7 +445,7 @@ -
    +
    @@ -360,7 +456,7 @@ + ToolTip="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None"> @@ -376,109 +472,122 @@ - - -
    -
    - -
    - - - - -
    - -
    - - - - - -
    -
    - -
    - -
    - -
    - - - - - - - - - - - - - - - -
    -
    - + - + + +
    +
    +
    +

    PÉRDIDA

    +
    + +
    + MXN + + + +
    +
    +
    +
    +
    +
    +

    GANANCIA

    +
    + +
    +
    +
    + MXN + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    +

    + +
    + +
    +
    +
    + MXN + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    - - - + + +
    - + -
    -
    - -
    -
    +
    + + +
    -
    +
    + +
    - - + - - - + + + + - - - + + + + - +
    - + + -
    +
    @@ -525,6 +634,106 @@ + + + +
    + +
    + + + + +
    + +
    + + + + + +
    +
    + + + +
    + +
    + +
    + + + + + + + + + + + + +
    +
    + + + +
    +
    + +
    + + + + +
    + +
    + + + + + +
    +
    + +
    + +
    + +
    + + + + + + + + + + + + + + + +
    +
    + @@ -561,7 +770,7 @@ @@ -575,6 +784,54 @@ + + + + +
    + +
    + + + + +
    + +
    + + + + + +
    + +
    + +
    +
    + +
    + + + + + + + + + + + + +
    +
    + diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index 56cfe835c..df81c70c2 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -28,11 +28,14 @@ Partial Class Bancos_FluctuacionCambiaria Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then CargaFechas() + CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "") + CargarCentrosDeCosto(Nothing, DdlSubProyectoComprasAnt, Nothing, LblSubProyectoComprasAnt, "") + CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "") + CargarCentrosDeCosto(Nothing, DdlsubProyectoVentasAnt, Nothing, LblSubProyectoVentasAnt, "") + CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreedores, Nothing, LblSubProyectoAcreedores, "") + CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreeedoresAnt, Nothing, LblSubProyectoAcreedoresAnt, "") CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "") - CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "") - CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "") - CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales, "") - CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreedores, Nothing, LblSubProyectoAcreedores, "") + CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales, "") CargarCentrosDeCosto(Nothing, DdlSubProyectoDeudores, Nothing, LblSubProyectoDeudores, "") CargaUltimaFluctuacion() @@ -62,14 +65,18 @@ Partial Class Bancos_FluctuacionCambiaria End Sub - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) CargaTipoCambio() - If T.ActiveTabIndex = 0 Then CargaDatosCompra() - If T.ActiveTabIndex = 1 Then CargaDatosVentas() - If T.ActiveTabIndex = 2 Then CargaDatosCuentas() - If T.ActiveTabIndex = 3 Then CargaDatosDeudores() - If T.ActiveTabIndex = 4 Then CargaDatosAcreedores() - If T.ActiveTabIndex = 5 Then CargaDatosFiliales() + If T.ActiveTabIndex = 0 Then CargaDatosProveedores() + If T.ActiveTabIndex = 1 Then CargaDatosProveedoresAnticipos() + If T.ActiveTabIndex = 2 Then CargaDatosClientes() + If T.ActiveTabIndex = 3 Then CargaDatosClientesAnticipos() + If T.ActiveTabIndex = 4 Then CargaDatosAcreedores() + If T.ActiveTabIndex = 5 Then CargaDatosAcreedoresAnticipos() + If T.ActiveTabIndex = 6 Then CargaDatosCuentas() + + If T.ActiveTabIndex = 7 Then CargaDatosFiliales() + If T.ActiveTabIndex = 8 Then CargaDatosDeudores() UpTabs.Update() End Sub @@ -84,21 +91,8 @@ Partial Class Bancos_FluctuacionCambiaria ObjGenerales.Dispose() End Sub - Private Sub CargaUltimaFluctuacion() - 'Dim Obj As New ClsBancos - 'If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then - ' Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC") - ' If dt.Rows.Count > 0 Then - ' LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", dt.Rows(0)("Fecha").ToString.ToDate.ToShortDateString) - ' 'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual - ' If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then - ' TxtFecha.Text = Now.ToShortDateString - ' Else - ' TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString() - ' End If - ' End If - 'End If - 'Obj.Dispose() + Private Sub CargaUltimaFluctuacion() + Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now) @@ -111,24 +105,23 @@ Partial Class Bancos_FluctuacionCambiaria Else DdlMes.SelectedValueExist(Now.AddMonths(-1).Month) DdlAnio.SelectedValueExist(Now.AddMonths(-1).Year) - 'TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString() End If End If CargaTipoCambio() End Sub - Private Sub CargaDatosCompra() - Dim ObjBancos As New ClsBancos - 'LblTotalCompras.Text = "0.00" + Private Sub CargaDatosProveedores() + Dim ObjBancos As New ClsBancos + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 1, UsuarioActual.CveEmpresa) Then - GvCompras.DataSource = ObjBancos.DtResultados + GvProveedores.DataSource = ObjBancos.DtResultados 'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero - Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ") - Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ") + Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ") + Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ") Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs - Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion") + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion").Abs Dim Final As Double = GanaciaAux - PerdidaAux HdnProveedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString @@ -138,6 +131,44 @@ Partial Class Bancos_FluctuacionCambiaria IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero + LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero + LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero + LblComprasPerdidaGanancia.Text = If(Final < 0, "Ganancia", "Pérdida") + + LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + Else + GvProveedores.DataSource = Nothing + Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia) + End If + ObjBancos.Dispose() + GvProveedores.DataBind() + UpIndicadores.Visible = True + If GvProveedores.Rows.Count > 0 Then + GvProveedores.Rows(GvProveedores.Rows.Count - 1).CssClass = "SubTotales2" + End If + End Sub + + Private Sub CargaDatosProveedoresAnticipos() + Dim ObjBancos As New ClsBancos + + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 2, UsuarioActual.CveEmpresa) Then + GvProveedoresAnt.DataSource = ObjBancos.DtResultados + 'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ") + Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ") + + Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion") + + Dim Final As Double = GanaciaAux - PerdidaAux + HdnProveedorAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString + HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString + BtnProveedoresAntRemove.Visible = HdnProveedorAntCvePrePoliza.Value.ToEntero > 0 + BtnGeneraComprasAnt.Visible = Not HdnProveedorAntCvePrePoliza.Value.ToEntero > 0 + + IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero @@ -145,28 +176,26 @@ Partial Class Bancos_FluctuacionCambiaria LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero Else - GvCompras.DataSource = Nothing + GvProveedoresAnt.DataSource = Nothing Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia) End If ObjBancos.Dispose() - GvCompras.DataBind() - UpIndicadores.Visible = True - If GvCompras.Rows.Count > 0 Then - GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2" - End If + GvProveedoresAnt.DataBind() + UpIndicadores.Visible = True + End Sub - Private Sub CargaDatosVentas() + Private Sub CargaDatosClientes() Dim ObjBancos As New ClsBancos LblTotalVentas.Text = "0.00" - If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 2, UsuarioActual.CveEmpresa) Then + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 3, UsuarioActual.CveEmpresa) Then GvVentas.DataSource = ObjBancos.DtResultados - Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") - Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0") + Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0") + Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") - Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs - Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0") + Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion > 0").Abs + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion < 0").Abs Dim Final As Double = GanaciaAux - PerdidaAux HdnClienteCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString @@ -190,12 +219,84 @@ Partial Class Bancos_FluctuacionCambiaria End If ObjBancos.Dispose() GvVentas.DataBind() + End Sub + + Private Sub CargaDatosClientesAnticipos() + Dim ObjBancos As New ClsBancos + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 4, UsuarioActual.CveEmpresa) Then + GvClientesAnt.DataSource = ObjBancos.DtResultados + + Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0") + Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0") + + Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs + Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0") + + Dim Final As Double = GanaciaAux - PerdidaAux + HdnClienteAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString + HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString + BtnClientesAntRemove.Visible = HdnClienteAntCvePrePoliza.Value.ToEntero > 0 + BtnClientesAnticipos.Visible = Not HdnClienteAntCvePrePoliza.Value.ToEntero > 0 + + 'IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd") + + 'LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero + 'LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero + 'LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero + 'LblVentasPerdidaGanancia.Text = If(Final < 0, "Pérdida", "Ganancia") + + LblTotalVentasAnt.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + + UpIndicadoresVentas.Visible = True + Else + GvClientesAnt.DataSource = Nothing + Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia) + End If + ObjBancos.Dispose() + GvClientesAnt.DataBind() + End Sub + + + Private Sub CargaDatosAcreedores() + Dim ObjBancos As New ClsBancos + + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 5, UsuarioActual.CveEmpresa) Then + + HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString + HdnAcreedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString + BtnAcreedoresRemove.Visible = HdnAcreedorCvePrePoliza.Value.ToEntero > 0 + BtnGeneraAcreedores.Visible = Not HdnAcreedorCvePrePoliza.Value.ToEntero > 0 + GvAcreedores.DataSource = ObjBancos.DtResultados + LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + Else + GvAcreedoresAnt.DataSource = Nothing + Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia) + End If + ObjBancos.Dispose() + GvAcreedores.DataBind() End Sub + Private Sub CargaDatosAcreedoresAnticipos() + Dim ObjBancos As New ClsBancos + + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 6, UsuarioActual.CveEmpresa) Then + HdnAcreedorAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString + BtnAcreedoresAntRemove.Visible = HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0 + BtnGeneraAcreedoresAnt.Visible = Not HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0 + GvAcreedoresAnt.DataSource = ObjBancos.DtResultados + LblTotalAcreedoresAnt.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero + Else + GvAcreedoresAnt.DataSource = Nothing + Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia) + End If + ObjBancos.Dispose() + GvAcreedoresAnt.DataBind() + End Sub + Private Sub CargaDatosCuentas() Dim ObjBancos As New ClsBancos LblTotalBancos.Text = "0.00" - If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 4, UsuarioActual.CveEmpresa) Then + If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal Dim TotAcumulado As Decimal = 0 @@ -237,7 +338,7 @@ Partial Class Bancos_FluctuacionCambiaria End If ObjBancos.Dispose() GvCuentas.DataBind() - End Sub + End Sub Private Sub CargaDatosDeudores() Dim ObjBancos As New ClsBancos @@ -253,24 +354,6 @@ Partial Class Bancos_FluctuacionCambiaria GvDeudores.DataBind() End Sub - Private Sub CargaDatosAcreedores() - Dim ObjBancos As New ClsBancos - LblTotalAcreedores.Text = "0.00" - If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 6, UsuarioActual.CveEmpresa) Then - GvAcreedores.DataSource = ObjBancos.DtResultados - LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero - HdnAcreedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString - HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString - BtnAcreedoresRemove.Visible = HdnAcreedorCvePrePoliza.Value.ToEntero > 0 - BtnGeneraAcreedores.Visible = Not HdnAcreedorCvePrePoliza.Value.ToEntero > 0 - - Else - GvAcreedores.DataSource = Nothing - Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia) - End If - ObjBancos.Dispose() - GvAcreedores.DataBind() - End Sub Private Sub CargaDatosFiliales() Dim ObjBancos As New ClsBancos @@ -315,7 +398,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias Total = LblTotal.ToDecimal - If Total > 0 Then + If Total < 0 Then CveConceptoContable = 64 idCta = IdCtaGanancia TipoMovto = True @@ -327,7 +410,7 @@ Partial Class Bancos_FluctuacionCambiaria Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Proveedores Anticipos", CveConceptoContable, "Fluctuación Proveedores Anticipos", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then ErrorRegistrar = True End If @@ -338,13 +421,13 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then 'saco las cuentas de pérdida y ganancia - For Each gvr As GridViewRow In GvCompras.Rows + For Each gvr As GridViewRow In GvProveedores.Rows Total = gvr.DataKey("Fluctuacion").ToDecimal 'si es pérdida o ganancia IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero() 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then ErrorRegistrar = True Exit For End If @@ -362,7 +445,7 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() BtnGeneraCompras.Visible = False - Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() Alert("Error al generar la fluctuación", TipoMensaje.MsgError) @@ -370,6 +453,86 @@ Partial Class Bancos_FluctuacionCambiaria Conta.Dispose() End Sub + + Protected Sub BtnGeneraComprasAnt_Click(sender As Object, e As EventArgs) + Dim Total As Decimal = 0 + Dim Conta As New ClsContabilidad + Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) + Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoComprasAnt.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + Dim idCta As Integer = 0 + + Dim CveCuentaPerdida, CveCuentaGanancia As Integer + Dim idCtaPerdida, IdCtaGanancia As Integer + + Dim TipoMovto As Boolean = False + Dim CveConceptoContable As Integer = 0 + Dim IdCtaComplementaria As Integer = 0 + + Dim ErrorRegistrar As Boolean = False + + CveCuentaPerdida = 0 '55379 + CveCuentaGanancia = 0 ' 55382 + idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 + IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias + + Total = LblTotal.ToDecimal + If Total > 0 Then + CveConceptoContable = 64 + idCta = IdCtaGanancia + TipoMovto = True + Else + CveConceptoContable = 65 + idCta = idCtaPerdida + TipoMovto = False + End If + + Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() + + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras Anticipos", CveConceptoContable, "Fluctuación Proveedores Anticipos", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoComprasAnt.SelectedValue.ToEntero) Then + ErrorRegistrar = True + End If + + Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveBitacora <= 0 Then + ErrorRegistrar = True + End If + + If Not ErrorRegistrar Then + 'saco las cuentas de pérdida y ganancia + For Each gvr As GridViewRow In GvProveedoresAnt.Rows + Total = gvr.DataKey("Fluctuacion").ToDecimal + 'si es pérdida o ganancia + IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero() + + 'movimiento de complementaria + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + ErrorRegistrar = True + Exit For + End If + + If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + Exit For + End If + Next + + Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, CveBitacora, UsuarioActual.CveEmpresa) + + End If + + If Not ErrorRegistrar Then + Conta.Commit() + BtnGeneraComprasAnt.Visible = False + Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Else + Conta.RollBack() + Alert("Error al generar la fluctuación", TipoMensaje.MsgError) + End If + Conta.Dispose() + End Sub + #End Region #Region "FLUCTUACION VENTAS" @@ -397,7 +560,7 @@ Partial Class Bancos_FluctuacionCambiaria '' Total = LblTotalVentas.Text.ToDecimal - If Total > 0 Then + If Total < 0 Then CveConceptoContable = 64 CveCuenta = CveCuentaGanancia TipoMovto = True @@ -441,6 +604,103 @@ Partial Class Bancos_FluctuacionCambiaria CveConconceptoCliente = 203 End If + 'movimiento de complementaria + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + ErrorRegistrar = True + Exit For + End If + + If Not Conta.UpdateTCValuacion(gvr.DataKey("CveVenta").ToEntero, -1, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + Exit For + End If + + Next + + If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + End If + + If Not ErrorRegistrar Then + Conta.Commit() + BtnGeneraVentas.Visible = False + Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + + Else + Conta.RollBack() + Alert("Error al generar la fluctuación", TipoMensaje.MsgError) + End If + Conta.Dispose() + End Sub + + + + Protected Sub BtnClientesAnticipos_Click(sender As Object, e As EventArgs) + Dim Total As Decimal = 0 + + Dim idCta As Integer = 0 + Dim CveCuenta As Integer = 0 + Dim CveCuentaPerdida, CveCuentaGanancia As Integer + Dim idCtaPerdida, IdCtaGanancia As Integer + Dim TipoMovto As Boolean = False + Dim CveConceptoContable As Integer = 0 + Dim IdCtaComplementaria As Integer = 0 + Dim ErrorRegistrar As Boolean = False + + CveCuentaPerdida = 0 '55379 + CveCuentaGanancia = 0 ' 55382 + idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 + IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias + + Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() + '' + + Total = LblTotalVentasAnt.Text.ToDecimal + If Total < 0 Then + CveConceptoContable = 64 + CveCuenta = CveCuentaGanancia + TipoMovto = True + idCta = IdCtaGanancia + Else + CveConceptoContable = 65 + CveCuenta = CveCuentaPerdida + idCta = idCtaPerdida + TipoMovto = False + End If + + If Total = 0 Then + Alert("El Importe tiene que ser diferente a cero", TipoMensaje.MsgError) + Exit Sub + End If + + Dim Conta As New ClsContabilidad + Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) + Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoVentasAnt.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentasAnt.SelectedValue.ToEntero) Then + ErrorRegistrar = True + End If + + Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 4, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveBitacora <= 0 Then + ErrorRegistrar = True + End If + + Dim CveConconceptoCliente As Integer = 203 + + 'saco las cuentas de pérdida y ganancia + For Each gvr As GridViewRow In GvClientesAnt.Rows + Total = gvr.DataKey("Fluctuacion").ToDecimal + + IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() + + If (gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0) OrElse (gvr.DataKey("CveVenta").ToEntero > 0 AndAlso gvr.DataKey("TipoDocto") = "Ant") Then + CveConconceptoCliente = 226 + Else + CveConconceptoCliente = 203 + End If + 'movimiento de complementaria If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then ErrorRegistrar = True @@ -454,20 +714,178 @@ Partial Class Bancos_FluctuacionCambiaria Next - If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 4, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then ErrorRegistrar = True End If If Not ErrorRegistrar Then Conta.Commit() - BtnGeneraVentas.Visible = False - Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + BtnClientesAnticipos.Visible = False + Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() Alert("Error al generar la fluctuación", TipoMensaje.MsgError) End If + Conta.Dispose() + End Sub + +#End Region + + +#Region "FLUCTUACION ACREEDORES" + + Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs) + RegistraFluctuacionAcreedores() + End Sub + + Private Sub RegistraFluctuacionAcreedores(Optional Anticipos As Boolean = False) + Dim Total As Decimal = 0 + Dim Conta As New ClsContabilidad + Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) + Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim idCta As Integer = 0 + Dim CveCuentaPerdida, CveCuentaGanancia As Integer + Dim idCtaPerdida, IdCtaGanancia As Integer + Dim TipoMovto As Boolean = False + Dim CveConceptoContable As Integer = 0 + Dim CveCuentaComplementaria As Integer = 55206 + Dim IdCtaComplementaria As Integer = 1081 + Dim ErrorRegistrar As Boolean = False + + CveCuentaPerdida = 0 '55379 + CveCuentaGanancia = 0 ' 55382 + idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 + IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias + + Total = LblTotalAcreedores.Text.ToDecimal + If Total < 0 Then + CveConceptoContable = 64 + idCta = IdCtaGanancia + TipoMovto = True + Else + CveConceptoContable = 65 + idCta = idCtaPerdida + TipoMovto = False + End If + + Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() + + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoAcreedores.SelectedValue.ToEntero) Then + ErrorRegistrar = True + End If + + Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 5, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveBitacora <= 0 Then + ErrorRegistrar = True + End If + + 'saco las cuentas de pérdida y ganancia + For Each gvr As GridViewRow In GvAcreedores.Rows + Total = gvr.DataKey("Fluctuacion").ToDecimal + 'si es pérdida o ganancia + IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() + + 'movimiento de complementaria + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + ErrorRegistrar = True + Exit For + End If + + If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + Exit For + End If + Next + + Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 5, CveBitacora, UsuarioActual.CveEmpresa) + + If Not ErrorRegistrar Then + Conta.Commit() + BtnGeneraAcreedores.Visible = False + Alert(String.Format("La Fluctuación se ha generado
    Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Else + Conta.RollBack() + Alert("Error al generar la fluctuación", TipoMensaje.MsgError) + End If Conta.Dispose() + Banco.Dispose() + End Sub + + + Protected Sub BtnGeneraAcreedoresAnt_Click(sender As Object, e As EventArgs) + Dim Total As Decimal = 0 + Dim Conta As New ClsContabilidad + Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) + Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedoresAnt.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + Dim idCta As Integer = 0 + Dim CveCuentaPerdida, CveCuentaGanancia As Integer + Dim idCtaPerdida, IdCtaGanancia As Integer + Dim TipoMovto As Boolean = False + Dim CveConceptoContable As Integer = 0 + Dim CveCuentaComplementaria As Integer = 55206 + Dim IdCtaComplementaria As Integer = 1081 + Dim ErrorRegistrar As Boolean = False + + CveCuentaPerdida = 0 '55379 + CveCuentaGanancia = 0 ' 55382 + idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 + IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 + Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias + + Total = LblTotalAcreedoresAnt.Text.ToDecimal + If Total > 0 Then + CveConceptoContable = 64 + idCta = IdCtaGanancia + TipoMovto = True + Else + CveConceptoContable = 65 + idCta = idCtaPerdida + TipoMovto = False + End If + + Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() + + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores Anticipos ", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoAcreeedoresAnt.SelectedValue.ToEntero) Then + ErrorRegistrar = True + End If + + Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 6, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveBitacora <= 0 Then + ErrorRegistrar = True + End If + + 'saco las cuentas de pérdida y ganancia + For Each gvr As GridViewRow In GvAcreedoresAnt.Rows + Total = gvr.DataKey("Fluctuacion").ToDecimal + 'si es pérdida o ganancia + IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() + + 'movimiento de complementaria + If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then + ErrorRegistrar = True + Exit For + End If + + If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then + ErrorRegistrar = True + Exit For + End If + Next + + Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 6, CveBitacora, UsuarioActual.CveEmpresa) + + If Not ErrorRegistrar Then + Conta.Commit() + BtnGeneraAcreedoresAnt.Visible = False + Alert(String.Format("La Fluctuación se ha generado
    Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Else + Conta.RollBack() + Alert("Error al generar la fluctuación", TipoMensaje.MsgError) + End If + Conta.Dispose() + Banco.Dispose() End Sub #End Region @@ -493,7 +911,6 @@ Partial Class Bancos_FluctuacionCambiaria Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - CveCuentaPerdida = 0 ' 55379 CveCuentaGanancia = 0 ' 55382 idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 @@ -553,7 +970,7 @@ Partial Class Bancos_FluctuacionCambiaria Conta.Commit() ObjContPaq.Commit() - Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
    Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) CargaDatosCuentas() Else Conta.RollBack() @@ -628,7 +1045,7 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() - Alert(String.Format("La Fluctuación se ha generado
    Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
    Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() End If @@ -721,7 +1138,7 @@ Partial Class Bancos_FluctuacionCambiaria 'Fin autoconta Conta.Commit() - Alert(String.Format("La Fluctuación se ha generado
    Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
    Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() ObjContPaq.RollBack() @@ -733,116 +1150,9 @@ Partial Class Bancos_FluctuacionCambiaria #End Region -#Region "FLUCTUACION ACREEDORES" - - Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs) - - Dim Total As Decimal = 0 - Dim Conta As New ClsContabilidad - Dim Banco As New ClsBancos(Conta.IniciaTransacSQL()) - Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - Dim idCta As Integer = 0 - Dim CveCuentaPerdida, CveCuentaGanancia As Integer - Dim idCtaPerdida, IdCtaGanancia As Integer - Dim TipoMovto As Boolean = False - Dim CveConceptoContable As Integer = 0 - Dim CveCuentaComplementaria As Integer = 55206 - Dim IdCtaComplementaria As Integer = 1081 - Dim ErrorRegistrar As Boolean = False - - CveCuentaPerdida = 0 '55379 - CveCuentaGanancia = 0 ' 55382 - idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227 - IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230 - Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias - - - Total = LblTotalAcreedores.Text.ToDecimal - If Total > 0 Then - CveConceptoContable = 64 - idCta = IdCtaGanancia - TipoMovto = True - Else - CveConceptoContable = 65 - idCta = idCtaPerdida - TipoMovto = False - End If - - Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal() - - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoAcreedores.SelectedValue.ToEntero) Then - ErrorRegistrar = True - End If - - Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 6, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveBitacora <= 0 Then - ErrorRegistrar = True - End If - - 'saco las cuentas de pérdida y ganancia - For Each gvr As GridViewRow In GvAcreedores.Rows - Total = gvr.DataKey("Fluctuacion").ToDecimal - 'si es pérdida o ganancia - IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero() - - 'movimiento de complementaria - If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then - ErrorRegistrar = True - Exit For - End If - - If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then - ErrorRegistrar = True - Exit For - End If - Next - - Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 6, CveBitacora, UsuarioActual.CveEmpresa) - - If Not ErrorRegistrar Then - Conta.Commit() - BtnGeneraAcreedores.Visible = False - Alert(String.Format("La Fluctuación se ha generado
    Ver Póliza", CvePrePoliza), TipoMensaje.MsgInformacion) - Else - Conta.RollBack() - Alert("Error al generar la fluctuación", TipoMensaje.MsgError) - End If - Conta.Dispose() - Banco.Dispose() - End Sub - -#End Region - #Region "GRIDVIEWS" - Protected Sub GvCompras_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompras.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - 'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble - 'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString - 'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio") - 'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString.FormatoNumero, "No aplica") - 'If e.Row.FCLabel("LbFluctuacion").Text = "No aplica" Then - ' e.Row.BackColor = Drawing.Color.LightSalmon - 'ElseIf e.Row.FCLabel("LbFluctuacion").Text.ToDouble < 0 Then - ' e.Row.BackColor = Drawing.Color.LightGoldenrodYellow - 'End If - - 'e.Row.FCHyperLink("HLProveedor").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor").ToString.ToEntero) - - 'If Not e.Row.DBCampo("IdCtaContProveedores").ToString.ToEntero > 0 Then - ' e.Row.FCHyperLink("HLProveedor").ForeColor = Drawing.Color.Red - 'End If - - - 'If e.Row.DBCampo("Fluctuacion").ToString.ToDouble < 0 Then - ' e.Row.BackColor = Drawing.Color.LightGoldenrodYellow - 'End If - 'If e.Row.DBCampo("SinTipoCambio").ToString.ToEntero > 0 Then - ' e.Row.BackColor = Drawing.Color.LightSalmon - 'End If - End If - End Sub - + Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then 'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble @@ -885,6 +1195,7 @@ Partial Class Bancos_FluctuacionCambiaria If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorCvePrePoliza.Value.ToEntero, 1, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() + BtnProveedoresRemove.visible = False Alert("Flucturación eliminada.") Else Banco.RollBack() @@ -893,12 +1204,41 @@ Partial Class Bancos_FluctuacionCambiaria End Sub + Protected Sub BtnProveedoresAntRemove_Click(sender As Object, e As EventArgs) + Dim Banco As New ClsBancos + Banco.IniciaTransacSQL() + + If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorAntCvePrePoliza.Value.ToEntero, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + Banco.Commit() + BtnProveedoresAntRemove.Visible = False + Alert("Flucturación eliminada.") + Else + Banco.RollBack() + End If + Banco.Dispose() + End Sub + Protected Sub BtnClientesRemove_Click(sender As Object, e As EventArgs) Dim Banco As New ClsBancos Banco.IniciaTransacSQL() - If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteCvePrePoliza.Value.ToEntero, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteCvePrePoliza.Value.ToEntero, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() + BtnClientesRemove.Visible = False + Alert("Flucturación eliminada.") + Else + Banco.RollBack() + End If + Banco.Dispose() + End Sub + + Protected Sub BtnClientesAntRemove_Click(sender As Object, e As EventArgs) + Dim Banco As New ClsBancos + Banco.IniciaTransacSQL() + + If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteAntCvePrePoliza.Value.ToEntero, 4, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + Banco.Commit() + BtnClientesAntRemove.Visible = False Alert("Flucturación eliminada.") Else Banco.RollBack() @@ -910,12 +1250,30 @@ Partial Class Bancos_FluctuacionCambiaria Dim Banco As New ClsBancos Banco.IniciaTransacSQL() - If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorCvePrePoliza.Value.ToEntero, 6, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorCvePrePoliza.Value.ToEntero, 5, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then Banco.Commit() + BtnAcreedoresRemove.Visible = False Alert("Flucturación eliminada.") Else Banco.RollBack() End If Banco.Dispose() End Sub + + + Protected Sub BtnAcreedoresAntRemove_Click(sender As Object, e As EventArgs) + Dim Banco As New ClsBancos + Banco.IniciaTransacSQL() + + If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorAntCvePrePoliza.Value.ToEntero, 6, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then + Banco.Commit() + BtnAcreedoresAntRemove.Visible = False + Alert("Flucturación eliminada.") + Else + Banco.RollBack() + End If + Banco.Dispose() + End Sub + + End Class diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index de7391935..705ac9305 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -728,10 +728,6 @@ Partial Class Bancos_PopIEVentas TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero - If UsuarioActual.CveEmpresa = 140 Then 'codigo temporal. RMF permite cargar el corte - CveCorte = dr("CveCorte").ToString.ToEntero - End If - LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }" 'Configuración de Modalidad Update @@ -745,8 +741,6 @@ Partial Class Bancos_PopIEVentas End If End If - - MovimientoPagar = New IEMovimiento MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal @@ -788,6 +782,10 @@ Partial Class Bancos_PopIEVentas CargaCorteCaja() End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'toma como proridad el que viene de + CveCorte = dr("CveCorte").ToString.ToEntero + End If + If RFCCliente.ToUpper <> "XAXX010101000" Then Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero diff --git a/Bin/roslyn/csc.exe b/Bin/roslyn/csc.exe index 44c3c41df..7077f16a0 100644 Binary files a/Bin/roslyn/csc.exe and b/Bin/roslyn/csc.exe differ diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 85dfd42e1..82c2469c5 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2194,7 +2194,7 @@ Partial Class Compras_Compras DdlRetISRConcepto.Items.Clear() DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1")) DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2")) - If UsuarioActual.CveEmpresa = 119 Then + If UsuarioActual.CveEmpresa.Contiene(119, 7, 11, 12, 122, 145) Then DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3")) End If End If @@ -6917,7 +6917,7 @@ Partial Class Compras_Compras End If - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TotalRealDevolucion, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TotalRealDevolucion, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=TotalRealDevolucion * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, TotalRealDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True End If Else diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 15117ab36..da6e5c217 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -231,11 +231,7 @@
    Si -
    - -
    - -
    +
    @@ -713,7 +709,7 @@ - <%----%> + diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index e99d9468d..51becc774 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -531,14 +531,13 @@ Partial Class ContabilidadC_RegPrePolizaS End If - If UsuarioActual.CveEmpresa = 119 Then - ' BtnContabilizar.Visible = True + If dr("FolioPoliza").ToString = "" Then + BtnContabilizar.Visible = True End If If UsuarioActual.Empresa.TipoContabilizacion = 1 Then If dr("FolioPoliza").ToString.ToEntero > 0 Then divContabilizada.Visible = True - LblFolio.Text = dr("FolioPoliza").ToString Folio = dr("FolioPoliza").ToString End If @@ -2611,29 +2610,29 @@ Partial Class ContabilidadC_RegPrePolizaS End Function #End Region - 'Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click + Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click - ' Contabilizar() + Contabilizar() - 'End Sub + End Sub - 'Private Sub Contabilizar() + Private Sub Contabilizar() - ' Dim ObjConta As New ClsContabilidad + Dim ObjConta As New ClsContabilidad - ' If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero - ' ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) - ' End If + If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero + ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) + End If - ' If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then - ' Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) - ' Else + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then + Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + Else - ' Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) - ' End If + Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + End If - ' ObjConta.Dispose() - 'End Sub + ObjConta.Dispose() + End Sub #Region "Paquete Egresos" @@ -2795,16 +2794,9 @@ Partial Class ContabilidadC_RegPrePolizaS LnkComplementoPago.Visible = True End If - - If UsuarioActual.CveEmpresa = 119 Then - ' BtnContabilizar.Visible = True - End If - - If UsuarioActual.Empresa.TipoContabilizacion = 1 Then If dr("FolioPoliza").ToString.ToEntero > 0 Then divContabilizada.Visible = True - LblFolio.Text = dr("FolioPoliza").ToString Folio = dr("FolioPoliza").ToString End If diff --git a/Contabilidad2/CatContaEjercicios.aspx.vb b/Contabilidad2/CatContaEjercicios.aspx.vb index 157cd674d..cea243360 100644 --- a/Contabilidad2/CatContaEjercicios.aspx.vb +++ b/Contabilidad2/CatContaEjercicios.aspx.vb @@ -72,7 +72,7 @@ Partial Class Contabilidad2_CatContaEjercicios Dim ObjConta As New ClsContabilidad Dim errorString As String = "" If LbAgregar.Text = "Agregar" Then - If Not ObjConta.AddContaEjercicio(DateTime.Today, UsuarioActual.CvePersonal, UsuarioActual.CveEmpresa, Ejercicio:=TxtEjercicio.Text, + If Not ObjConta.AddContaEjercicio(DateTime.Today, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Ejercicio:=TxtEjercicio.Text, PeriodoActual:=DdlPeriodoActual.SelectedValue.ToEntero, Estatus:=ChkEstatus.Checked) Then errorString = "Error al agregar" End If diff --git a/Documentacion/TableroMaterialidad.aspx b/Documentacion/TableroMaterialidad.aspx index aad8b527b..01736b900 100644 --- a/Documentacion/TableroMaterialidad.aspx +++ b/Documentacion/TableroMaterialidad.aspx @@ -15,6 +15,18 @@ .spanfoliofiscal { white-space: nowrap; } + th.Modulo5{ + color:#fff; + background-color:darksalmon; + } + th.Modulo6{ + color:#fff; + background-color:#67809f; + } + th.Modulo7{ + color:#fff; + background-color:purple; + } th:not(.Modulo5) + th.Modulo5, th:not(.Modulo6) + th.Modulo6, th:not(.Modulo7) + th.Modulo7{ diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 18b09e247..9cdc4a770 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -1345,7 +1345,7 @@ Partial Class Inventarios_EntradasSalidas tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero End If - If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then FechaCaducidadVal = MinFecha FechaCaducidad = MinFecha Lote = "" @@ -2116,8 +2116,6 @@ Partial Class Inventarios_EntradasSalidas filtro = IIf(UsuarioActual.CveEmpresa.Contiene(72, 1, 80), "CveConcepto NOT IN (4,5,10)", filtro).ToString Else - - filtro = String.Format("{0} AND CveTipoAlmacen = {1}", IIf(UsuarioActual.CveEmpresa.Contiene(72, 1, 80, 4, 7, 11, 12, 135), "CveConcepto NOT IN (4,5,10)", filtro).ToString, CveTipoAlmacen) End If @@ -2160,6 +2158,14 @@ Partial Class Inventarios_EntradasSalidas DdlConcepto.Items.Insert(If(DdlConcepto.Items.Count >= 1, 1, 0), New ListItem(" Salida por Ajuste ", "34")) End If + ' RECEPCION USADOS + If CveTipoAlmacen = 22 Then + If DdlConcepto.Items.FindByValue("3") Is Nothing Then + DdlConcepto.Items.Insert(If(DdlConcepto.Items.Count >= 2, 2, DdlConcepto.Items.Count), New ListItem("Salida Almacen ", "3")) + End If + + End If + '[IPP]: PARCHE PARA JAM If UsuarioActual.CveEmpresa = 119 And CveTipoAlmacen.Contiene(4, 8, 16) Then If DdlConcepto.Items.FindByValue("2") Is Nothing Then @@ -2212,20 +2218,14 @@ Partial Class Inventarios_EntradasSalidas DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("35")) End If - - - End If - If UsuarioActual.CveUsuario.Contiene(2185, 100) Then DdlConcepto.Items.Add(New ListItem("Entrada por Ajuste", "32")) DdlConcepto.Items.Add(New ListItem("Salida por Ajuste", "34")) End If - - DdlConcepto.SelectedValue = "-1" ddlConcepto_SelectedIndexChanged(DdlConcepto, EventArgs.Empty) @@ -4475,7 +4475,7 @@ Partial Class Inventarios_EntradasSalidas Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero - If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then AplicaLote = False AplicaCaducidad = False End If @@ -4517,7 +4517,7 @@ Partial Class Inventarios_EntradasSalidas Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero - If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then AplicaLote = False AplicaCaducidad = False End If diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index de1ed0a89..8a4a1cf51 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -345,8 +345,16 @@
    - - Ventas por surtir + + + Ventas por surtir + + + + + + +  
    @@ -355,10 +363,7 @@
    - - - -   + " style="display: inline-block; margin-right: -20px; width: 70px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">   diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 78376bdd2..4a3ee3bdf 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -670,7 +670,7 @@ Partial Class Inventarios_EntregaAlmacen If UsuarioActual.CveEmpresa = 119 Then Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero - If CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then ValidaLoteCaducidad = True Else ValidaLoteCaducidad = False diff --git a/Inventarios/InventarioFisico.aspx.vb b/Inventarios/InventarioFisico.aspx.vb index cffe5140e..4fe1da3d9 100644 --- a/Inventarios/InventarioFisico.aspx.vb +++ b/Inventarios/InventarioFisico.aspx.vb @@ -104,7 +104,7 @@ Partial Class Inventarios_InventarioFisico Dim Inventario As New ClsInventarios Dim dt As New DataTable - If Inventario.GetInventarioFisico(-1, CveEmpresa, DdlFiltroSubProyecto.SelectedValue.ToEntero, DdlEstado.SelectedValue.ToEntero) Then + If Inventario.GetInventarioFisico(-1, CveEmpresa, DdlFiltroSubProyecto.SelectedValue.ToEntero, DdlEstado.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then dt = Inventario.DtResultados End If Inventario.Dispose() diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 7f5d10e5c..5719ca0ec 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -559,7 +559,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto").ToEntero 'RMF condición temporal - If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then ValidaLoteCaducidad = True Else ValidaLoteCaducidad = False diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx b/Inventarios/RepEntregaAlmacenRuta.aspx index 22b756e5f..99c34b4b8 100644 --- a/Inventarios/RepEntregaAlmacenRuta.aspx +++ b/Inventarios/RepEntregaAlmacenRuta.aspx @@ -99,7 +99,7 @@ " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
    diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs index 1d2ff4eec..8a8337a05 100644 --- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs +++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs @@ -512,9 +512,12 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas string RFCReceptor = GvRow.DataKey("RFCReceptor").ToString(); string RFCEmisor = GvRow.DataKey("RFCEmisor").ToString(); int CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero(); + int CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero(); + int CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero(); Timbrado ObjCancelacion = new Timbrado(); ClsGenerales ObjGenerales = new ClsGenerales(); + ObjGenerales.IniciaTransacSQL (); if (EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptor)) { @@ -528,22 +531,27 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) { - Alert("El complemento se cancelo correctamente."); + //regenero el tmbre + CveTimbre = ObjGenerales.AddGralTimbre("Tra", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen : CveEntregaAlmacen, AplicaCP: true); + + + ProcesoOK = true; } } - else - { - Alert("Se presento un error al cancelar el Folio Fiscal", ModExtensiones.TipoMensaje.MsgAdvertencia); - } } - ObjGenerales.Dispose(); - if (ProcesoOK) { - CargaDatos(); + ObjGenerales.Commit(); + Alert("El complemento se cancelo correctamente."); } + else + { + ObjGenerales.RollBack(); + Alert("Se presento un error al cancelar el Folio Fiscal", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + ObjGenerales.Dispose(); } @@ -622,11 +630,11 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas LnkTimbrar.Visible = true; } - if (e.Row.DataKey("TimbreTipoDocto") == "Man") - { - e.Row.FCLinkButton("LnkEditarDirOrigen").Visible = true; - e.Row.FCLinkButton("LnkEditarDirDestino").Visible = true; - } + //if (e.Row.DataKey("TimbreTipoDocto") == "Man") + //{ + // e.Row.FCLinkButton("LnkEditarDirOrigen").Visible = true; + // e.Row.FCLinkButton("LnkEditarDirDestino").Visible = true; + //} if (e.Row.DataKey("Estatus").ToEntero() == 1) { diff --git a/Inventarios/ResguardoMaterial.aspx.vb b/Inventarios/ResguardoMaterial.aspx.vb index 42f088a0d..a03b30b6c 100644 --- a/Inventarios/ResguardoMaterial.aspx.vb +++ b/Inventarios/ResguardoMaterial.aspx.vb @@ -1126,7 +1126,7 @@ Partial Class Inventarios_ResguardoMaterial Private Sub DdlAlmacenDestinoLiberacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestinoLiberacion.SelectedIndexChanged Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestinoLiberacion.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto").ToEntero 'RMF condición temporal - If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then ValidaLoteCaducidad = True Else ValidaLoteCaducidad = False diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 91b4b928a..04ceface6 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -593,14 +593,14 @@ Partial Class Inventarios_TraspasoAlmacen 'codigo provisional. Dim CveSubP As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero - If DrPS("AplicaCaducidad").ToString = "True" AndAlso CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If DrPS("AplicaCaducidad").ToString = "True" AndAlso CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then If Not ChkSugiereFechaCaducidad.Checked AndAlso (TxtnFechaCaducidad.Text = "" OrElse TxtnLote.Text = "") Then Alert("Falta Especificar lote/Fecha del producto", TipoMensaje.MsgAdvertencia) Exit Sub End If End If - If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.Checked And CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.Checked And CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then Dim ObjInventarios As New ClsInventarios If ObjInventarios.GetExistenciasCaducidad(CveProducto, DdlAlmacenOrigen.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue) Then @@ -637,7 +637,7 @@ Partial Class Inventarios_TraspasoAlmacen tLote = If(TxtnLote.Visible, TxtnLote.Text, "-1") tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha) - If Not CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If Not CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then tLote = "-1" tCaducidad = MinFecha End If @@ -2163,7 +2163,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim tSerie As String = gvr.FCTextBox("TxtSerie").Text 'gvr.DataKey("Serie").ToString Dim tFechaCaducidad As Date = gvr.DataKey("FechaCaducidad").ToDate - If CveSubProyectoRecibe.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then + If CveSubProyectoRecibe.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then tLote = gvr.FCTextBox("TxtLote").Text tFechaCaducidad = gvr.FCTextBox("TxtCaducidad").Text.ToDate End If diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index c92264be3..13bcf21a4 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -4,6 +4,10 @@