This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-09-22 20:16:00 -07:00
50 changed files with 3137 additions and 2091 deletions

View File

@@ -3129,11 +3129,11 @@ Public Class ClsBancos
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Or Ex1.Message.Contains("Número: 2601;") Then
Alert("Ya existe un registro con el mismo Folio", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Or Ex1.Message.Contains("Número: 2601;") Then
Alert("Ya existe un registro con el mismo Folio", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al actualizar El movimiento Bancario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
@@ -4760,4 +4760,25 @@ Public Class ClsBancos
#End Region
#Region "reportes"
Public Function GetPagosNoBancarios(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1, Optional CvePersonal As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Banc_PagosNoBancarios")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los pagos no bancarios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
End Class

View File

@@ -1863,6 +1863,7 @@ Public Class ClsInventarios
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente

View File

@@ -1188,13 +1188,12 @@ Public Class ClsMovimientos
Return Retorno
End Function
Public Function GetCxPDetalle(FechaI As String, FechaF As String, CveProveedor As Integer, CveProveedorClasificacion As Integer,
CveProveedorSucursal As Integer, CveUsuario As Integer,
CveUsuarioResponsable As Integer,
Anio As Integer, Mes As Integer, AnioMes As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEstatusFactura As Integer,
Fecha As String, Agrupador As Integer, Opcion As String, CveEmpresa As Integer, CveSucursal As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1,
Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing,
Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, Optional Comprobaciones As Integer = -1) As Boolean
Public Function GetCxPDetalle(FechaI As String, FechaF As String, CveProveedor As Integer, CveProveedorClasificacion As Integer, CveProveedorSucursal As Integer, CveUsuario As Integer,
CveUsuarioResponsable As Integer, Anio As Integer, Mes As Integer, AnioMes As String, CveMoneda As Integer, CveSubProyecto As Integer,
CveEstatusFactura As Integer, Fecha As String, Agrupador As Integer, Opcion As String, CveEmpresa As Integer, CveSucursal As Integer,
TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional FechaVI As String = "-1", Optional FechaVF As String = "1",
Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1,
Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1) As Boolean
Dim Retorno As Boolean = False
If FechaCorte = Nothing Then FechaCorte = Now
@@ -1227,6 +1226,7 @@ Public Class ClsMovimientos
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
.Add("@Comprobaciones", SqlDbType.Int).Value = Comprobaciones
.Add("@AplicaNC", SqlDbType.Int).Value = AplicaNC
End With
Try

View File

@@ -145,9 +145,18 @@
<div class="col-md-1">
<h5>TC:<asp:Literal runat="server" ID="LtTipoCambioActual"></asp:Literal></h5>
</div>
<div class="col-md-3">
<div class="col-md-2">
<asp:TextBox ID="TxtConceptoFluctuacion" runat="server"></asp:TextBox>
</div>
<div class="col-md-2" style="width: 80px;" runat="server" id="LiSubProyectoLbl">
<asp:Label runat="server" ID="LblSubProyecto"></asp:Label>
</div>
<div class="col-md-1 " runat="server" id="LiSubProyectoDdl">
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
</asp:DropDownList>
</div>
</div>
</div>
<div class="portlet-body">

View File

@@ -19,6 +19,7 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargarCentrosDeCosto(Nothing, DdlSubproyecto, Nothing, LblSubProyecto)
CargaUltimaFluctuacion()
End If
End Sub
@@ -218,13 +219,19 @@ Partial Class Bancos_FluctuacionCambiaria
End If
ObjBancos.Dispose()
GvFiliales.DataBind()
End Sub
End Sub
#End Region
#Region "FLUCTUACION COMPRAS"
Protected Sub BtnGeneraCompras_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
@@ -245,7 +252,6 @@ Partial Class Bancos_FluctuacionCambiaria
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
@@ -257,8 +263,11 @@ Partial Class Bancos_FluctuacionCambiaria
CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -284,13 +293,20 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.RollBack()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION VENTAS"
Protected Sub BtnGeneraVentas_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
@@ -323,7 +339,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -354,13 +370,20 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.RollBack()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION BANCOS"
Protected Sub BtnGeneraBancos_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Protected Sub BtnGeneraBancos_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
@@ -417,7 +440,7 @@ Partial Class Bancos_FluctuacionCambiaria
Exit For
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
End If
@@ -446,13 +469,20 @@ Partial Class Bancos_FluctuacionCambiaria
ObjContPaq.Dispose()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION DEUDOR"
Protected Sub BtnGeneraDedudores_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Protected Sub BtnGeneraDedudores_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
@@ -493,7 +523,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -519,13 +549,18 @@ Partial Class Bancos_FluctuacionCambiaria
End If
Conta.Dispose()
Banco.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION FILIALES"
Protected Sub BtnGeneraFiliales_Click(sender As Object, e As EventArgs)
Protected Sub BtnGeneraFiliales_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
@@ -571,7 +606,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -614,13 +649,19 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.Dispose()
Banco.Dispose()
ObjContPaq.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION ACREEDORES"
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
@@ -655,7 +696,7 @@ Partial Class Bancos_FluctuacionCambiaria
idCta = idCtaPerdida
TipoMovto = False
End If
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -680,162 +721,162 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.RollBack()
End If
Conta.Dispose()
End Sub
End Sub
#End Region
#Region "FLUCTUACION GENERAL"
' Protected Sub BtnGenerar_Click(sender As Object, e As EventArgs)
' Dim AcumuladoGananciaCompras = 0.0, AcumuladoPerdidaCompras = 0.0, AcumuladoGananciaBancos = 0.0, AcumuladoPerdidaBancos = 0.0
' Dim IDPoliza = -1
' 'Valida datos de Compras
' For Each gvr As GridViewRow In GvCompras.Rows
' If gvr.DataKey("SinTipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Compras")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' 'Valida datos de Bancos
' For Each gvr As GridViewRow In GvCuentas.Rows
' If Not gvr.DataKey("TipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Cuentas Bancarias")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
' ObjConta.IniciaTransacSQL()
' Dim ObjBancos As New ClsBancos
' ObjBancos.IniciaTransacSQL()
' Dim ErrorGenerar = False
' Dim Fecha As Date = TxtFecha.Text.ToDate
' IDPoliza = ObjConta.AddPoliza(3, "Fluctuación Cambiaria", (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, UsuarioActual.CveUsuario, Fecha)
' If IDPoliza > 0 Then
' 'COMIENZA: AGREGA CUENTAS BANCARIAS
' If AcumuladoGananciaBancos > 0 Or AcumuladoPerdidaBancos > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCuentas.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Cuentas Bancarias", If(Fluc > 0, "Ganancia", "Perdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 2195, AcumuladoGananciaBancos > 0, AcumuladoGananciaBancos, "", "Acumulado Ganancia Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 4695, AcumuladoPerdidaBancos > 0, AcumuladoPerdidaBancos, "", "Acumulado Pérdida Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA CUENTAS BANCARIAS
' 'COMIENZA: AGREGA COMPRAS
' If AcumuladoGananciaCompras > 0 Or AcumuladoPerdidaCompras > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCompras.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Compras", If(Fluc > 0, "Ganancia", "Pérdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, Not AcumuladoGananciaCompras > 0, AcumuladoGananciaCompras, "", "Acumulado Ganancia Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, Not AcumuladoPerdidaCompras > 0, AcumuladoPerdidaCompras, "", "Acumulado Pérdida Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA COMPRAS
' Else
' ErrorGenerar = True
' End If
' 'Agrega en Bitacoras
' If Not ErrorGenerar Then
' If ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' If Not ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' ErrorGenerar = True
' End If
' Else
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar Then
' ObjConta.AjustaPoliza(IDPoliza)
' ObjConta.Commit()
' ObjBancos.Commit()
' Alert(String.Format("Fluctuación realizada con exito.<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza))
' Else
' ObjConta.RollBack()
' ObjBancos.RollBack()
' Alert("Ocurrio un error al generar la poliza", TipoMensaje.MsgAdvertencia)
' End If
' ObjConta.Dispose()
' ObjBancos.Dispose()
' End Sub
' Protected Sub BtnGenerar_Click(sender As Object, e As EventArgs)
' Dim AcumuladoGananciaCompras = 0.0, AcumuladoPerdidaCompras = 0.0, AcumuladoGananciaBancos = 0.0, AcumuladoPerdidaBancos = 0.0
' Dim IDPoliza = -1
' 'Valida datos de Compras
' For Each gvr As GridViewRow In GvCompras.Rows
' If gvr.DataKey("SinTipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Compras")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' 'Valida datos de Bancos
' For Each gvr As GridViewRow In GvCuentas.Rows
' If Not gvr.DataKey("TipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Cuentas Bancarias")
' 'Exit Sub
' Else
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
' AcumuladoGananciaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble
' Else
' AcumuladoPerdidaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
' End If
' End If
' End If
' Next
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
' ObjConta.IniciaTransacSQL()
' Dim ObjBancos As New ClsBancos
' ObjBancos.IniciaTransacSQL()
' Dim ErrorGenerar = False
' Dim Fecha As Date = TxtFecha.Text.ToDate
' IDPoliza = ObjConta.AddPoliza(3, "Fluctuación Cambiaria", (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, UsuarioActual.CveUsuario, Fecha)
' If IDPoliza > 0 Then
' 'COMIENZA: AGREGA CUENTAS BANCARIAS
' If AcumuladoGananciaBancos > 0 Or AcumuladoPerdidaBancos > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCuentas.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Cuentas Bancarias", If(Fluc > 0, "Ganancia", "Perdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 2195, AcumuladoGananciaBancos > 0, AcumuladoGananciaBancos, "", "Acumulado Ganancia Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaBancos > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, 4695, AcumuladoPerdidaBancos > 0, AcumuladoPerdidaBancos, "", "Acumulado Pérdida Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA CUENTAS BANCARIAS
' 'COMIENZA: AGREGA COMPRAS
' If AcumuladoGananciaCompras > 0 Or AcumuladoPerdidaCompras > 0 Then
' 'Agrega movimientos
' Dim Fluc As Double
' For Each gvr As GridViewRow In GvCompras.Rows
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Compras", If(Fluc > 0, "Ganancia", "Pérdida")), 0, Fecha, "") Then
' ErrorGenerar = True
' Exit For
' End If
' End If
' Next
' 'Agrega acumulados
' If Not ErrorGenerar AndAlso AcumuladoGananciaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, Not AcumuladoGananciaCompras > 0, AcumuladoGananciaCompras, "", "Acumulado Ganancia Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar AndAlso AcumuladoPerdidaCompras > 0 Then
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, Not AcumuladoPerdidaCompras > 0, AcumuladoPerdidaCompras, "", "Acumulado Pérdida Cambiaria de Compras", 0, Fecha, "") Then
' ErrorGenerar = True
' End If
' End If
' Else
' ErrorGenerar = True
' End If
' 'TERMINA: AGREGA COMPRAS
' Else
' ErrorGenerar = True
' End If
' 'Agrega en Bitacoras
' If Not ErrorGenerar Then
' If ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' If Not ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' ErrorGenerar = True
' End If
' Else
' ErrorGenerar = True
' End If
' End If
' If Not ErrorGenerar Then
' ObjConta.AjustaPoliza(IDPoliza)
' ObjConta.Commit()
' ObjBancos.Commit()
' Alert(String.Format("Fluctuación realizada con exito.<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza))
' Else
' ObjConta.RollBack()
' ObjBancos.RollBack()
' Alert("Ocurrio un error al generar la poliza", TipoMensaje.MsgAdvertencia)
' End If
' ObjConta.Dispose()
' ObjBancos.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

View File

@@ -2696,6 +2696,8 @@ Partial Class Bancos_IE
MsgError = "No se pudo insertar la póliza de saldo inicial."
End If
End If
Dim UsaComplementariaBancos As Boolean = False
If UsuarioActual.CveEmpresa = 119 Then UsaComplementariaBancos = True
If MsgError = "" Then
@@ -2887,14 +2889,18 @@ Partial Class Bancos_IE
importeMovimiento = TxtImporte.Text.ToDecimal
importeMX = importeMovimiento
If tCveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
If tCveMoneda > 1 AndAlso UsaComplementariaBancos Then
'Agregamos complementaria
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCuenta:=UsuarioActual.Empresa.CveCuentaIVAxTrasladar) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
Else
If tCveMoneda > 1 Then
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
importeMX = (importeMovimiento * TC).RoundSQL
End If
End If
End Select

View File

@@ -451,6 +451,23 @@ Partial Class Bancos_PopIECompras
End Set
End Property
Private Property CveSubProyecto As Integer
Get
If ViewState("CveSubProyecto") Is Nothing Then
Return -1
Else
Return ViewState("CveSubProyecto").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveSubProyecto") = value
End Set
End Property
#End Region
@@ -668,6 +685,8 @@ Partial Class Bancos_PopIECompras
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal
NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
LtlTitulo.Text = "Cuentas por Pagar"
LtlTipo2.Text = "Folio de la Compra"
LtlTipo3.Text = "Fecha de la Compra"
@@ -1473,8 +1492,9 @@ Partial Class Bancos_PopIECompras
Dim CveTipoPoliza As Integer = ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)
If RBLContado.SelectedValue = "6" Then CveTipoPoliza = 3
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/PopIECompras", CvePlantillaPoliza, ImportePagado, ImportePagado, CveMoneda, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=CveTipoPoliza)
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/PopIECompras", CvePlantillaPoliza, ImportePagado, ImportePagado, CveMoneda, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=CveTipoPoliza)
If Inserta Then
If CvePrePoliza > 0 Then
'SE AGREGA DETALLE DE UNA COMPRA
@@ -1534,6 +1554,9 @@ Partial Class Bancos_PopIECompras
'inserto las compras que voy a pagar
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
For Each Row As DataRow In ObjMov.DtResultados.Rows
Dim CveSubProyectoInsertar As Integer = -1
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
Dim ImporteMovimiento As Decimal = 0
@@ -2173,187 +2196,187 @@ Partial Class Bancos_PopIECompras
End If
End If
End If
End If
'Case 16 'Ret ISR X Acreditar
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = tipoCambioCompra
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 23 'Ret ISR Acreditable
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 243 'Ret ISR X Acreditar Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
End If
'Case 16 'Ret ISR X Acreditar
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = tipoCambioCompra
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 23 'Ret ISR Acreditable
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 243 'Ret ISR X Acreditar Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' 'Conta SIG
' If CveCuentaRetISR <> 0 Then
' CveCuenta = CveCuentaRetISR
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
' End If
' End If
' End If
' End If
Case 14 'Iva por Acreditar
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
@@ -2577,84 +2600,84 @@ Partial Class Bancos_PopIECompras
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), 280, ConceptoMovimiento, Fecha, IdCtaContableNoIVA, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMXNoDeducible, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
'Case 280 'Iva Acreditable No Deducible
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
' Dim TotalImporte As Decimal
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' End If
' If TotalImporte = CompraSaldo Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' Else
' ImporteMovimiento = 0
' ImporteMX = 0
' End If
' Else
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' End If
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
' Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
' End If
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
' End If
' End If
End If
'Case 280 'Iva Acreditable No Deducible
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
' Dim TotalImporte As Decimal
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' End If
' If TotalImporte = CompraSaldo Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' Else
' ImporteMovimiento = 0
' ImporteMX = 0
' End If
' Else
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' End If
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
' Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
' End If
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
' End If
' End If
Case 25 'IEPS por Acreditar
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IEPS * PorcentajePago
@@ -2703,7 +2726,15 @@ Partial Class Bancos_PopIECompras
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero
End If
End If
Case 64 'Ganancia
Case 64 'Ganancia
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
End If
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
@@ -2723,6 +2754,13 @@ Partial Class Bancos_PopIECompras
ImporteMovimiento = 0
End If
Case 65 'Perdida
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
End If
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
@@ -3323,15 +3361,19 @@ Partial Class Bancos_PopIECompras
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
''Conta SIG
'If CveCuenta = 0 Then
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
' CveCuentaContabilizacion = 0
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
End If
''Conta SIG
'If CveCuenta = 0 Then
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
' CveCuentaContabilizacion = 0
'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If

View File

@@ -3146,6 +3146,7 @@ Partial Class Bancos_ProveedoresAbonar
If gr.DataKey("CveTipoConcepto").ToEntero = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor
Dim ConceptoPartida As String = String.Format("Saldar compra {0}", gr.DataKey("SerieFolio").ToString)
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ProveedoresAbonar/Saldar", 98, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, TxtFechaIncobrable.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveMoneda > 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then
@@ -3223,15 +3224,23 @@ Partial Class Bancos_ProveedoresAbonar
If CveMoneda > 1 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCCompra)
If CveSubProyecto <= 0 Then
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
End If
If TCCompra > TCPago Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
End If

View File

@@ -77,7 +77,8 @@
<asp:UpdatePanel ID="UpDevolucionAlmacen" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li id="LiDevolucionAlmacen" runat="server" visible="false">
<asp:LinkButton Text="Solicitar Devolución" OnClick="LBDevolucionAlmacen_Click" ID="LBDevolucionAlmacen" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro de solicitar la Devolución de Almacén?" data-btn-ok-label="si" />
<%--<asp:LinkButton Text="Solicitar Devolución" OnClick="LBDevolucionAlmacen_Click" ID="LBDevolucionAlmacen" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro de solicitar la Devolución de Almacén?" data-btn-ok-label="si" />--%>
<asp:LinkButton ID="HplDevv" OnClick="LBDevolucionAlmacen_Click" runat="server"><i class='fa fa-plus'></i> Solicitar Devolución</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
@@ -4966,6 +4967,44 @@
</div>
</div>
<div id="DivDevolucion" class="modal fade">
<div class="modal-dialog">
<asp:UpdatePanel ID="UPPSolDev" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<h4>
Productos a devolver
</h4>
</div>
<div class="modal-body">
<div class="row">
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:GridView ID="GvSolDev" runat="server" AutoGenerateColumns="false" GridLines="none" BorderWidth="0" DataKeyNames="CveCompraDetalle,CvePS" CssClass="table GvPS table-striped table-hover table-advance Widthall ScrollAD mysmallbtn">
<Columns>
<asp:TemplateField ItemStyle-Width="55px" HeaderText="Cant">
<ItemTemplate>
<asp:TextBox ID="TxtCant" runat="server" Text='<%#Eval("Cantidad") %>' Width="50px" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UM" headertext="UM" />
<asp:BoundField DataField="CodigoPS" headertext="Producto" />
</Columns>
</asp:GridView>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnDevolucion" runat="server" Text="Solicitar Devolución" OnClick="BtnDevolucion_Click" ClientIDMode="Static" CssClass="btn btn-success" />
<button type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%-- MODAL FLETES E IMPORTACIONES --%>
<div id="ModalFletesImportaciones" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalFletesImportaciones" UpdateMode="Conditional">

View File

@@ -3896,6 +3896,7 @@ Partial Class Compras_Compras
'------------------INICIA VALIDACIONES------------------
Dim EstatusCredito As Integer = 0
Dim CveSubProyecto As Integer = 0
'Credito Multiple
If RBLPago.SelectedValue.ToEntero = 4 Then
@@ -4062,11 +4063,14 @@ Partial Class Compras_Compras
' Dim NotHas117 As Boolean = Not UsuarioActual.TienePermisoProceso(117)
' 'verifica que tenga proyecto y clasificacion
For Each Row As DataRow In TmpDT.Rows
If Row("CveSubProyecto").ToString.ToEntero <= 0 Then
Alert("No se ha completado la asignacion de proyectos en la compra. ", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
CveSubProyecto = Row("CveSubProyecto").ToString.ToEntero
If Row("CveClasificacionActualizar").ToString.ToEntero <= 0 Then 'If NotHas117 AndAlso Row("CveClasificacionActualizar").ToString.ToEntero <= 0 Then
Alert("Hay productos que no tienen clasificación asignada.<br> Favor de asignarle una y darle guardar.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -5690,6 +5694,8 @@ Partial Class Compras_Compras
For Each Row As DataRow In DTPlatilla.Rows
Dim CveSubProyectoInsertar As Integer = -1
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
Dim importeMovimiento As Decimal = 0
@@ -6291,6 +6297,15 @@ Partial Class Compras_Compras
' End If
' End If
Case 64 'Ganancia
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
ErrorPrepoliza = True
Alert("Concepto ganancia cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
End If
If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
@@ -6307,6 +6322,12 @@ Partial Class Compras_Compras
Case 65 'Perdida
CveSubProyectoInsertar = CveSubProyecto
If CveSubProyectoInsertar <= 0 Then
ErrorPrepoliza = True
Alert("Concepto perdida cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
End If
If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
@@ -6597,11 +6618,17 @@ Partial Class Compras_Compras
'SumatoriaOCINV = -SumatoriaOCINV
Dim CveClasificacionCostoOC = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
Dim CveSubProyecto69 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If CveSubProyecto69 <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de constos", TipoMensaje.MsgAdvertencia)
ErrorPrepoliza = True
Exit For
End If
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69) Then
ErrorPrepoliza = True
Exit For
End If
@@ -6717,10 +6744,10 @@ Partial Class Compras_Compras
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
Dim CveSubProyecto259 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then
ErrorPrepoliza = True
End If
Else
@@ -7528,7 +7555,8 @@ Partial Class Compras_Compras
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
End If
@@ -7552,7 +7580,7 @@ Partial Class Compras_Compras
End If
End If
If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) AndAlso UsuarioActual.CveEmpresa <> 72 Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
ErrorPrepolizaDescuadre = True
@@ -10485,7 +10513,7 @@ Partial Class Compras_Compras
If UsuarioActual.CveEmpresa.Contiene(119, 7) Then
node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces)
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
If ValorXML(node, "TipoRelacion").ToString.Contiene("04", "07") Then
If ValorXML(node, "TipoRelacion").ToString.Contiene("07") Then
Dim nodeDocumentosRelacionados As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionado", Prefijo), namespaces)
For Each documento As XmlNode In nodeDocumentosRelacionados
If documento.Attributes("UUID").Value <> "" Then
@@ -16933,6 +16961,8 @@ Partial Class Compras_Compras
CargaRetIVAConcepto()
CargaRetISRConcepto()
Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ")
If NumNoDed > 0 Then GvPS.Columns(10).Visible = True 'visualiza columnas de nodeducibles
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
InicializaAplicaNCFact()
@@ -18436,30 +18466,69 @@ Partial Class Compras_Compras
End If
If EstatusAlmacen = 1 Then
LBDevolucionAlmacen.Text = "<i class='fa fa-pencil'></i> Cancelar Devolución Almacén"
LBDevolucionAlmacen.ToolTip = "¿Está seguro de Cancelar la Devolución de Almacén?"
HplDevv.Text = "<i class='fa fa-pencil'></i> Cancelar Devolución Almacén"
HplDevv.ToolTip = "¿Está seguro de Cancelar la Devolución de Almacén?"
Else
LBDevolucionAlmacen.Text = "<i class='fa fa-pencil'></i> Solicitar Devolución Almacén"
LBDevolucionAlmacen.ToolTip = "¿Está seguro de Solicitar la Devolución de Almacén?"
HplDevv.Text = "<i class='fa fa-pencil'></i> Solicitar Devolución Almacén"
HplDevv.ToolTip = "¿Está seguro de Solicitar la Devolución de Almacén?"
End If
End If
'UpInvDev.Update()
End Sub
Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs)
GvSolDev.DataSource = TmpDT
GvSolDev.DataBind()
RegistraScript("$('#DivDevolucion').modal('show');", "DivDevolucion")
UPPSolDev.Update()
End Sub
Protected Sub BtnDevolucion_Click(sender As Object, e As EventArgs)
Dim ObjCompras As New ClsCompras
Dim TieneError As Boolean = False
ObjCompras.IniciaTransacSQL()
If EstatusAlmacen = 0 Then
For Each gvr As GridViewRow In GvSolDev.Rows
If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then
'actualiza el estatus del detalle
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0)
Else
ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1)
End If
Next
End If
If ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1)) Then
EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1)
Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente."))
End If
If Not TieneError Then
ObjCompras.Commit()
Else
ObjCompras.RollBack()
End If
ObjCompras.Dispose()
InicializaDevolucionAlmacen()
End Sub
'Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs)
' Dim ObjCompras As New ClsCompras
' If ObjCompras.UpdateEstatusAlmacen(CveCompra, If(EstatusAlmacen = 1, 0, 1)) Then
' EstatusAlmacen = If(EstatusAlmacen = 1, 0, 1)
' Alert(If(EstatusAlmacen = 1, "La solicitud de devolución de almacen se guardo correctamente.", "La solicitud de almacen se canceló correctamente."))
' End If
' ObjCompras.Dispose()
' InicializaDevolucionAlmacen()
'End Sub
Private Sub HabilitaNCInv()
If Not UsuarioActual.CveUsuario = 100 Then
@@ -19617,7 +19686,18 @@ Partial Class Compras_Compras
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
If DiferenciaInvOC.RoundSQL() <> 0 Then
If CveSubProyecto <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de constos.", TipoMensaje.MsgAdvertencia)
Retorno = False
End If
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePoliza > 0 Then
@@ -19960,6 +20040,8 @@ Partial Class Compras_Compras
End If
End Sub
End Class
Public Class MMensajeDevolucion

View File

@@ -199,10 +199,10 @@ Partial Class PopUpVerFactura
End If
End Sub
End Sub
#Region "U S U A R I O - T O K E N"
Private Function ValidaUsuarioSistema(CveEmpresa As Integer, Optional CveUsuario As Integer = 100) As Usuario
Dim UsuarioToken As Usuario = Nothing
@@ -236,9 +236,9 @@ Partial Class PopUpVerFactura
UsuarioToken.Empresa = ObjEmpresa.Empresa
End If
ObjEmpresa.Dispose()
End Sub
End Sub
#End Region
Private Sub SeleccionaReporte(UrlParametros As Hashtable)
'DESCARGA COMPROBANTE
@@ -493,10 +493,10 @@ Partial Class PopUpVerFactura
URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
Next
Return URLParametros
End Function
End Function
#Region "OP = CORT - IMPRIMIR CORTE"
Private Sub ImprimeCorte(CveCorte As Integer, Formato As String)
Dim ObjVenta As New ClsVentas
Dim ObjPuntoVenta As New ClsPuntoVenta
@@ -541,10 +541,10 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/RepCortes.rdlc", lrds, params, "ReporteCortes", Formato)
End If
End Sub
End Sub
#End Region
#Region " OP = FACTURA - IMPRIME COMPRA"
Private Sub DescargaComprobante(Parametros As Hashtable)
If Parametros("COMPROBANTE") IsNot Nothing Then
@@ -583,9 +583,9 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP DesXmlVIA- DESCARGAR XML DE VIATICOS"
Private Sub DescargaXMLViaticos(Parametros As Hashtable)
If Parametros("SERIEFOLIO") IsNot Nothing AndAlso Parametros("SERIEFOLIO").ToString <> "" Then
@@ -605,10 +605,10 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP DesXmlNom- DESCARGAR XML DE UTILIDADES"
Private Sub DescargaXMLUtilidades(Parametros As Hashtable)
If Parametros("SERIEFOLIO") IsNot Nothing AndAlso Parametros("SERIEFOLIO").ToString <> "" Then
@@ -628,9 +628,9 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP = 'CONG' - IMPRIME GASTO DE CONTRATO"
Private Sub ImprimeGastoContrato(CveContrato As Integer, CveContratoGasto As Integer)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -672,10 +672,10 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("LogoPath", ""))
End If
ImprimirPDF("Empresas/Grales/Formatos/ContratoGasto.rdlc", dt, params, $"{Nombre}-Gastos", Formato:="PDF")
End Sub
End Sub
#End Region
#Region "OP = 'CIC' - IMPRIME FORMATO CICOVISA"
Private Sub ImprimeFormatoCICOVISA(CveVenta As Integer)
If CveVenta > 0 Then
@@ -712,10 +712,10 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/Cicovisa.rdlc", Dt, params, String.Format("Formato Cicovisa -{0}", Now.ToDateTime.ToShortDateString))
End If
End If
End Sub
End Sub
#End Region
#Region "OP = 'CARPO' - IMPRIME FORMATO CARTA PORTE"
Private Sub ImprimeFormatoCartaPorte(CveMovimiento As Integer)
If CveMovimiento > 0 Then
@@ -788,7 +788,7 @@ Partial Class PopUpVerFactura
ResponsableRecibio = Dr("ResponsableRecibio").ToString
Identificacion = Dr("Identificacion").ToString
Domicilio = Dr("Domicilio").ToString
Telefono = Dr("Telefono").ToString
Telefono = Dr("Telefono1").ToString
Ciudad = Dr("Ciudad").ToString
Licencia = Dr("Licencia").ToString
End If
@@ -813,7 +813,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
params.Add(New ReportParameter("DomicilioFiscal", $"{UsuarioActual.Empresa.Direccion}, {UsuarioActual.Empresa.Colonia}, {UsuarioActual.Empresa.Localidad}, {UsuarioActual.Empresa.Estado}, Tel. {UsuarioActual.Empresa.Telefono}"))
params.Add(New ReportParameter("DomicilioFiscal", $"{UsuarioActual.Empresa.Direccion}, {UsuarioActual.Empresa.Colonia}, {UsuarioActual.Empresa.Localidad}, {UsuarioActual.Empresa.Estado}, Tel. {Telefono}"))
params.Add(New ReportParameter("SerieFolio", SerieFolio))
params.Add(New ReportParameter("DomicilioSucursal", DomicilioSucursal))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
@@ -826,7 +826,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Chofer", Chofer))
params.Add(New ReportParameter("Placa", Placa))
params.Add(New ReportParameter("Recibio", Recibio))
params.Add(New ReportParameter("FechaEntrega", FechaEntrega))
params.Add(New ReportParameter("FechaEntrega", FechaEntrega.ToString()))
params.Add(New ReportParameter("EspecifUnidad", EspecifUnidad))
params.Add(New ReportParameter("DireccionOrigen", SBDireccionO.ToString))
params.Add(New ReportParameter("DireccionDestino", SBDireccionD.ToString))
@@ -840,12 +840,12 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/CartaPorte.rdlc", Dt, params, String.Format("Carta Porte -{0}", Now.ToDateTime.ToShortDateString))
End If
End If
End Sub
End Sub
#End Region
#Region "OP = 'DesXmlTra' - IMPRIME XML TRASLADO"
Private Sub DescargaXMLTraslado(Parametros As Hashtable)
If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")
@@ -864,12 +864,12 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region "OP = 'DesPdfTra' - IMPRIME PDF TRASLADO"
Private Sub DescargaPDFTraslado(Parametros As Hashtable)
If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")
@@ -888,10 +888,10 @@ Partial Class PopUpVerFactura
End If
Archivo = Nothing
End If
End Sub
End Sub
#End Region
#Region " OP = 'Vta,Fact' - IMPRIME PDF VENTAS"
Private Sub DescargaFacturaVenta(Parametros As Hashtable)
If Parametros("CVEVENTA") IsNot Nothing AndAlso Parametros("CVEVENTA").ToString.ToEntero > 0 Then
@@ -1198,11 +1198,11 @@ Partial Class PopUpVerFactura
End If
End If
End Sub
End Sub
#End Region
#Region " - OP = 'Alm' - REPORTE ENTRADAS ALMACEN "
Private Sub CargaMovimientosAlmacen(CveMovimiento As Integer)
Dim ObjInventarios As New ClsInventarios
@@ -2465,19 +2465,19 @@ Partial Class PopUpVerFactura
If (UsuarioActual.CveEmpresa = 72) Then
params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios")
'Else
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("SubProyecto", SubProyecto))
' params.Add(New ReportParameter("Observaciones", Observaciones))
' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
'End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidasGarantia.rdlc", DtMovimientos, params, String.Format("SalidaGarantia{0}", Folio.ToString), RDSName:="DsInventarios")
'Else
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("SubProyecto", SubProyecto))
' params.Add(New ReportParameter("Observaciones", Observaciones))
' params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Salidas.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
'End If
Case 18 'D E V O L U C I O N D E L C L I E N T E
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DevolucionCliente.rdlc", UsuarioActual.Empresa.Ruta))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -2654,36 +2654,36 @@ Partial Class PopUpVerFactura
ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Salida por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
ElseIf CveConcepto = 22 Then
ImprimirPDF(Archivo, DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
'Case 22 'ENTRADA POR PRESTAMO
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim params As New List(Of ReportParameter)
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", logouri))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo"))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Descuentos", ""))
' params.Add(New ReportParameter("IVA", ""))
' params.Add(New ReportParameter("Total", ""))
' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' params.Add(New ReportParameter("FacturadoA", NombreCliente))
' If (UsuarioActual.CveEmpresa = 72) Then
' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
'Case 22 'ENTRADA POR PRESTAMO
' Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim params As New List(Of ReportParameter)
' Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", logouri))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
' params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo"))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("Fecha", Fecha))
' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Descuentos", ""))
' params.Add(New ReportParameter("IVA", ""))
' params.Add(New ReportParameter("Total", ""))
' 'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
' params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
' params.Add(New ReportParameter("FacturadoA", NombreCliente))
' If (UsuarioActual.CveEmpresa = 72) Then
' params.Add(New ReportParameter("DomicilioFiscal", DomicilioFiscalCompu))
' End If
' ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada por Prestamo - {0}", Folio.ToString), RDSName:="DsInventarios")
Case 24 'SALIDA POR RESGUARDO
If DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 20 Or DtMovimientos(0)("CveTipoAlmacen").ToString.ToEntero = 19 Then
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -3158,11 +3158,11 @@ Partial Class PopUpVerFactura
If CveConcepto = 2 Then
ElseIf CveConcepto = 3 Then
End If
End Sub
End Sub
#End Region
#Region "OP = 'OC' - IMPRIME PDF OC"
Private Sub ImprimePDFOC(CveOrdenCompra As Integer)
Dim reporte As Byte() = NewGeneraBytesOC(CveOrdenCompra, ConBitacora:=(UsuarioActual.Empresa.Funcionalidad(119) = "1"))
@@ -3198,10 +3198,10 @@ Partial Class PopUpVerFactura
ImprimirbytesPDF(reporte, $"OrdenCompra-{Folio.ToString}")
End If
End If
End Sub
End Sub
#End Region
#Region "OP = 'VAL' - IMPRIME PDF VAL"
Private Sub GenerarPDFVale(CveVale As Integer)
@@ -3231,9 +3231,9 @@ Partial Class PopUpVerFactura
'End If
End If
ObjAF.Dispose()
End Sub
End Sub
#End Region
#Region "OP = 'OS' - IMPRIMIR PDF OS"
Private Sub GenerarPDFOS(CveOS As Integer)
Dim ObjOS As New ClsOS()
@@ -3352,9 +3352,9 @@ Partial Class PopUpVerFactura
TmpDTMaterialesOS.Columns.Add("Clasificacion", GetType(String))
TmpDTMaterialesOS.Columns.Add("PS", GetType(String))
TmpDTMaterialesOS.Columns.Add("UM", GetType(String))
End Sub
End Sub
#End Region
#Region "OP = 'OI' - Crear Archivo "
Private Sub CrearArchivo(Archivo As String)
Dim ObjEventos As New ClsOIEventos
@@ -3363,11 +3363,11 @@ Partial Class PopUpVerFactura
Dim file As System.IO.FileInfo = New System.IO.FileInfo(path) '-- if the file exists on the server
DescargarArchivo(file)
End Sub
End Sub
#End Region
#Region "OP = 'Contratos' - Crear Archivo "
Private Sub CrearArchivoContratos(Archivo As String)
@@ -3375,11 +3375,11 @@ Partial Class PopUpVerFactura
Dim file As System.IO.FileInfo = New System.IO.FileInfo(Archivo) '-- if the file exists on the server
DescargarArchivo(file)
End Sub
End Sub
#End Region
#Region "OP = 'OI' - Descargar Archivo "
Private Sub DescargarArchivo(File As System.IO.FileInfo)
If File.Exists Then 'set appropriate headers
@@ -3409,11 +3409,11 @@ Partial Class PopUpVerFactura
Alert("Ocurrio un error al descargar el archivo", TipoMensaje.MsgAdvertencia, "window.close()")
End If 'nothing in the URL as HTTP GET
End Sub
End Sub
#End Region
#Region "OP = 'AFR' - AF"
Private Sub ImprimirPDFAFR(CveAFR As Integer, Tipo As Integer)
Dim ObjAF As New ClsAF
'Dim ObjSubProyecto As New ClsSubProyectos
@@ -3600,9 +3600,9 @@ Partial Class PopUpVerFactura
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/ResguardoAF.rdlc", dtVC, params, NomArchivo)
End Sub
End Sub
#End Region
#Region "OP = 'POL' "
Private Sub ImprimirPolizaPDF(IdPoliza As Integer)
'Dim ObjConta As New ClsContabilidad
@@ -3641,9 +3641,9 @@ Partial Class PopUpVerFactura
ObjPoliza.Dispose()
End Sub
End Sub
#End Region
#Region "OP = 'CAN' - CANCELACION"
Public Sub ImprimeCancelacion(CveVenta As Integer)
Dim ObjVentas As New ClsVentas
@@ -3668,9 +3668,9 @@ Partial Class PopUpVerFactura
End If
ObjVentas.Dispose()
End Sub
End Sub
#End Region
#Region "OP = 'DC' - DEPOSITOS CAJA"
Private Sub CargaDepositosCaja(CveIE As Integer, CuentaCaja As String, CuentaDeposito As String)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/DepositoCaja.rdlc", UsuarioActual.Empresa.Ruta))
@@ -3697,11 +3697,11 @@ Partial Class PopUpVerFactura
ObjIE.Dispose()
End Sub
End Sub
#End Region
#Region "I E C H E Q U E S"
Private Sub ImprimirIE(CveIE As Integer, CveEmpresa As Integer)
Dim CveTipoTransaccion = -1
Dim ObjIE As New ClsBancos()
@@ -4108,21 +4108,21 @@ Partial Class PopUpVerFactura
ParamComprobacion.Dispose()
ObjIE.Dispose()
End Sub
End Sub
#End Region
#Region "OP = RECIBO DE PAGOS"
Private Sub ImprimirReciboDePagos(CveIE As Integer, CveVenta As Integer)
PDFReciboDePagos(CveVenta, CveIE, -1)
End Sub
End Sub
#End Region
#Region "OP = VTA - PyME"
' 04/05/2018 - Pruebas de impresion de factura PyME
' 04/05/2018 - Pruebas de impresion de factura PyME
Private Sub GeneraPDFVtaPyMe(Venta As Modelos.Factura, Optional Formato As String = "PDF")
Dim Directorio1 As String = String.Format("{0}Empresas\{1}\Formatos\Factura.mrt", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
Dim File As FileInfo = New FileInfo(Directorio1)
@@ -4177,9 +4177,9 @@ Partial Class PopUpVerFactura
Else
RegistraScript("alert('No hay un formato de factura predefinido,favor de comunicar a soporte tecnico')")
End If
End Sub
End Sub
#End Region
#Region "OP = ENTREGAS - Entregas por realizar"
Public Sub ImprimeEntregasPorRealizar(CveAsignacionEntrega As Long, pUsuarioEntregar As String)
Dim Correcto As Boolean = False
@@ -4199,7 +4199,7 @@ Partial Class PopUpVerFactura
ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF", RDSName:="DsInventarios")
End If
End Sub
End Sub
#End Region
End Class

View File

@@ -2164,6 +2164,52 @@
</table>
</div>
</div>
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Pagos no bancarios</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel10">
<ContentTemplate>
<asp:LinkButton ID="LnkPagosNoBancariosPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkPagosNoBancariosExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkPagosNoBancariosPDF" />
<asp:PostBackTrigger ControlID="LnkPagosNoBancariosExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row col-md-12" align="right">
<input type="text" id="TxtBusquedaPagosNoBancarios" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="table-scrollable">
<asp:GridView ID="GvPagosNoBancarios" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron pagos no bancarios" Width="50%"
CssClass="table table-striped table-advance table-hover ScrollAD" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None" DataKeyNames="CvePrePoliza,CveCompra,CveVenta,CvePersonal,ImporteMN,VentaSerieFolio,CompraSerieFolio,NombreCompleto,FechaIng,Abreviatura">
<Columns>
<asp:BoundField HeaderText="Nombre Completo" DataField="NombreCompleto"/>
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString = "{0:dd/MM/yyyy}"/>
<asp:HyperLinkField HeaderText="Venta Serie Folio" DataTextField="VentaSerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
<asp:HyperLinkField HeaderText="Compra Serie Folio" DataTextField="CompraSerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}"/>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlImp" runat="server" Text='<%# Eval("ImporteMN", "{0:N2}")%>'></asp:Literal>
<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>

View File

@@ -511,7 +511,7 @@ Partial Class Compras_Proveedores
'CargaColectivas()
'CargaSaldosBeneficiarios()
CargaUsuariosPortal()
CargarPagosNoBancarios()
CargaFiltroMonedas()
MostrarFiltro()
@@ -6269,6 +6269,15 @@ Partial Class Compras_Proveedores
End If
End Sub
Private Sub CargarPagosNoBancarios()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetPagosNoBancarios(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) Then
GvPagosNoBancarios.DataSource = ObjBancos.DtResultados
GvPagosNoBancarios.DataBind()
End If
ObjBancos.Dispose()
End Sub
End Class

View File

@@ -291,7 +291,7 @@
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto">
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto">
<Columns>
<asp:TemplateField>
<HeaderTemplate>

View File

@@ -637,6 +637,9 @@ Partial Class Compras_ReembolsosComprobaciones
'inserto las compras que voy a pagar
For Each gvr As GridViewRow In GvCxP.Rows
If gvr.FCCheckBox("Chk").Checked Then
ConceptoMovimiento = $"{gvr.DataKey("Proveedor")} F:{gvr.DataKey("SerieFolio")} {If(DdlPersonal.Visible, DdlPersonal.SelectedItem.Text, DdlCajaChica.SelectedItem.Text)}"
Referencia = gvr.DataKey("SerieFolio").ToString
@@ -675,14 +678,19 @@ Partial Class Compras_ReembolsosComprobaciones
CveIEPago = CveIERegistrado
End If
'Otros Ingresos
If (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
If CveCajaChica > 0 AndAlso Not HdnCheque.Value.ToEntero > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
End If

View File

@@ -222,7 +222,7 @@
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1"><span>Comprobación:</span></div>
<div class="col-md-1" style="margin-left:20px"><span>Comprobación:</span></div>
<div class="col-md-1">
<asp:DropDownList ID="DdlComprobacion" runat="server" CssClass="select2me" AppendDataBoundItems="true" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
@@ -230,6 +230,14 @@
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1" style="margin-left:20px"><span>Aplica NC:</span></div>
<div class="col-md-1">
<asp:DropDownList ID="DdlAplicaNC" runat="server" CssClass="select2me" AppendDataBoundItems="true" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -379,7 +379,7 @@ Partial Class RepCxPDetalle
DdlUsuarioResponsable.SelectedValue.ToEntero, Anio, Mes, AnioMes, CveMoneda, CveSubProyecto, DdlEstatusCompra.SelectedValue.ToEntero,
Fecha, DdlGrupo.SelectedValue.ToEntero, Opcion, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero,
TCEspecifico, FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=IIf(CveTipoProveedor = 3,
-1, CveTipoProveedor), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero) Then
-1, CveTipoProveedor), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero, AplicaNC:=DdlAplicaNC.SelectedValue.ToEntero()) Then
Dim TMP_DTDatos As New DataTable

View File

@@ -98,8 +98,7 @@
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Notas de Crédito" OnRowDataBound="GvDatos_RowDataBound"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None"
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,IdCtaContProveedores,
IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio">
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,IdCtaContProveedores,IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio,CveSubProyecto">
<Columns>
<asp:TemplateField ItemStyle-Width="7%">
<ItemTemplate>

View File

@@ -145,6 +145,7 @@ Partial Class Compras_RepNotasCredito
CvePrePoliza = ObjConta.AddPrePolizas("Compras/RepNotasCredito", 103, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldado manual", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveMoneda > 1 Then
IdCtaContable = gr.DataKey("IdCtaContExtranjera").ToEntero
ImporteMN = (gr.DataKey("Saldo").ToDecimal * TCCompra).RoundSQL
@@ -165,7 +166,7 @@ Partial Class Compras_RepNotasCredito
End If
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToString.ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
MsgError = "Ocurrio un Error al saldar el movimiento"
End If

View File

@@ -67,7 +67,7 @@
<asp:LinkButton ID="LnkBitacotaFacturas" runat="server" OnClick="LnkBitacotaFacturas_Click"><i class="fa fa-book" ></i> Bitácora Facturas</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkVinculacionMasivaComplementos" runat="server" OnClick="LnkVinculacionMasivaComplementos_Click" Visible ="true" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea realizar la vinculación masiva de complementos?" data-btn-ok-label="si"><i class="fa fa-tasks" ></i> Vinculación Masiva Complementos</asp:LinkButton>
<asp:LinkButton ID="LnkVinculacionMasivaComplementos" runat="server" OnClick="LnkVinculacionMasivaComplementos_Click" Visible ="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea realizar la vinculación masiva de complementos?" data-btn-ok-label="si"><i class="fa fa-tasks" ></i> Vinculación Masiva Complementos</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>

View File

@@ -816,13 +816,17 @@ Partial Class ContabilidadC_RegPrePolizaS
TipoMovto = False
End If
If CveConcepto = 41 Then
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
Else
CveIE = -1
End If
If CveConcepto <> 30 Then
If CveConcepto = 41 Then
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
Else
CveIE = -1
End If
End If
If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then
idCuentaContabilizacion = 0
End If

View File

@@ -101,11 +101,12 @@
</ContentTemplate>
</asp:UpdatePanel>
<%-- CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true"--%>
<asp:UpdatePanel ID="UpAnual" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvAnual" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none"
CssClass="ADSCROLLER2 table table-striped table-advance table-hover" data-cols="2" data-heightmenos="300">
<asp:GridView ID="GvAnual" runat="server" DataKeyNames="Level,CveCuenta" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none"
CssClass="ADSCROLLER2 table table-striped table-advance table-hover" data-cols="2" data-heightmenos="300" data-sort="true" OnDataBound="GvAnual_DataBound" >
<Columns>
<asp:TemplateField>
<HeaderTemplate>

View File

@@ -42,6 +42,63 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
End Set
End Property
Public Property DtHeadersCount As Integer
Get
If ViewState("DtHeadersCount") Is Nothing Then
Return -1
Else
Return ViewState("DtHeadersCount").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("DtHeadersCount") = value
End Set
End Property
Private Property DTHeaders As DataTable
Get
If ViewState("DTHeaders") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DTHeaders"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTHeaders") = value
End Set
End Property
Private Property DTDatos As DataTable
Get
If ViewState("DTDatos") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DTDatos"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTDatos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -121,20 +178,33 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Private Sub CargaDatos()
DTHeaders = New DataTable
DTDatos = New DataTable
Dim Conta As New ClsContabilidad
DtHeadersCount = 0
If Conta.GetAnexoCatalogoAnual(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEjercicio2.SelectedValue.ToEntero, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlPeriodo.SelectedValue.ToEntero) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
'Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
DTHeaders = Conta.DSResultados.Tables(0)
DTDatos = Conta.DSResultados.Tables(1)
DtHeadersCount = DTHeaders.Rows.Count
GvAnual.DataSource = Conta.DSResultados.Tables(1)
Dim Index = 2
For Index = 2 To GvAnual.Columns.Count - 1
GvAnual.Columns(Index).Visible = False
Next Index
listaCamposanios.Clear()
Index = 2
For Each Dr As DataRow In DtHeaders.Rows
For Each Dr As DataRow In DTHeaders.Rows
GvAnual.Columns(Index).Visible = True
CType(GvAnual.Columns(Index), BoundField).DataField = String.Format("Ejercicio{0}", Dr("Ejercicio"))
GvAnual.Columns(Index).HeaderText = Dr("Ejercicio").ToString
@@ -166,7 +236,9 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
UpAnual.Update()
'RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
RegistraScript($"LimpiaCeros();")
'RegistraScript($"LimpiaCeros();")
Conta.Dispose()
@@ -191,10 +263,61 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
setgraficaCC(e)
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
If e.Row.DataKey("Level").ToEntero = 0 Then
e.Row.CssClass = "Totales"
End If
If e.Row.DataKey("Level").ToEntero = 1 Then
e.Row.CssClass = "SubTotales"
End If
Dim CveCunetaRow As Integer = e.Row.DataKey("CveCuenta").ToEntero
Dim inicial As Boolean = True
Dim Index As Integer = 2
For Each DRow As DataRow In DTHeaders.Rows
Dim Importe As Decimal = e.Row.DBCampo($"Ejercicio{DRow("Ejercicio")}").ToDecimal
Dim Anio As Integer = DRow("Ejercicio").ToString.ToEntero
If Importe <> 0 Then
e.Row.Cells(Index).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF=31/12/{Anio}&FI=01/01/{Anio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue.ToEntero}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
End If
If e.Row.Cells(Index + 1).Text.ToDecimal = 0 Then
e.Row.Cells(Index + 1).Text = "-"
ElseIf e.Row.Cells(Index + 1).Text.ToDecimal < 0 Then
e.Row.Cells(Index + 1).ForeColor = Drawing.Color.Red
End If
If e.Row.Cells(Index + 2).Text.Replace("%", "").ToDecimal = 0 Then
e.Row.Cells(Index + 2).Text = "-"
ElseIf e.Row.Cells(Index + 2).Text.Replace("%", "").ToDecimal < 0 Then
e.Row.Cells(Index + 2).ForeColor = Drawing.Color.Red
End If
'If inicial Then
' Index = Indice + 1
' inicial = False
' Continue For
'End If
Index += 3
Next
'e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
End Sub
@@ -231,4 +354,56 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
Protected Sub GvAnual_DataBound(sender As Object, e As EventArgs)
'If DtHeadersCount > 0 Then
' '96 32
' Dim NColumns As Integer = GvAnual.Columns.Count
' Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
' Dim cell1 As New TableHeaderCell()
' cell1.Text = ""
' cell1.ColumnSpan = 1
' row.Controls.Add(cell1)
' Dim cell2 As New TableHeaderCell()
' cell2.Text = ""
' cell2.ColumnSpan = 1
' row.Controls.Add(cell2)
' Dim cell3 As New TableHeaderCell()
' cell3.Text = ""
' cell3.ColumnSpan = 1
' row.Controls.Add(cell3)
' Dim cell4 As New TableHeaderCell()
' cell4.Text = ""
' cell4.ColumnSpan = 1
' row.Controls.Add(cell4)
' For x = 0 To DtHeadersCount
' Dim cell As New TableHeaderCell()
' cell.Text = ""
' cell.ColumnSpan = 1
' row.Controls.Add(cell)
' Dim cellColspan2 = New TableHeaderCell()
' cellColspan2.ColumnSpan = 2
' cellColspan2.Text = "Variación"
' row.Controls.Add(cellColspan2)
' x = x + 1
' Next
' GvAnual.HeaderRow.Parent.Controls.AddAt(0, row)
'End If
End Sub
End Class

View File

@@ -103,7 +103,7 @@
<div>
<div style="background-color: #fff;">
<asp:GridView ID="GvCC" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none"
CssClass="ADSCROLLER2 table table-striped table-advance table-hover" data-cols="2" data-heightmenos="300">
DataKeyNames="Level,CveCuenta" CssClass="ADSCROLLER2 table table-striped table-advance table-hover" data-cols="2" data-heightmenos="300">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
@@ -124,141 +124,144 @@
<asp:Label runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoGeneral" HeaderText="Total" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoNA" HeaderText="Sin SubProyecto" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}" DataField="SubProyectoNAPorcentaje" HeaderText="%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
<asp:BoundField DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="100px" />
<asp:BoundField DataFormatString="{0:N2}%" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="ceros" ItemStyle-Width="50px" />
</Columns>
</asp:GridView>
</div>

View File

@@ -33,6 +33,39 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
End Set
End Property
Private Property DTHeaders As DataTable
Get
If ViewState("DTHeaders") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DTHeaders"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTHeaders") = value
End Set
End Property
Private Property DTDatos As DataTable
Get
If ViewState("DTDatos") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DTDatos"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTDatos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -112,12 +145,16 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
CargaDatos()
End Sub
Private Sub CargaDatos()
Private Sub CargaDatos()
DTHeaders = New DataTable
DTDatos = New DataTable
Dim Conta As New ClsContabilidad
If Conta.GetAnexoCatalagoCC(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlDivisor.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
DTHeaders = Conta.DSResultados.Tables(0)
DTDatos = Conta.DSResultados.Tables(1)
GvCC.DataSource = Conta.DSResultados.Tables(1)
Dim Index = 4
@@ -127,18 +164,19 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
listaCampos.Clear()
Index = 4
For Each Dr As DataRow In DtHeaders.Rows
For Each Dr As DataRow In DTHeaders.Rows
GvCC.Columns(Index).Visible = True
CType(GvCC.Columns(Index), BoundField).DataField = String.Format("SubProyecto{0}", Dr("SubProyecto"))
GvCC.Columns(Index).HeaderText = Dr("SubProyecto").ToString()
listaCampos.Add(New String() {String.Format("SubProyecto{0}", Dr("SubProyecto")), Dr("SubProyecto").ToString()})
GvCC.Columns(Index + 1).Visible = True
CType(GvCC.Columns(Index + 1), BoundField).DataField = String.Format("SubProyecto{0}Porcentaje", Dr("SubProyecto"))
GvCC.Columns(Index + 1).HeaderText = "%"
Index += 2
listaCampos.Add(New String() {String.Format("SubProyecto{0}", Dr("SubProyecto")), Dr("SubProyecto").ToString()})
'GvCC.Columns(Index + 1).Visible = True
'CType(GvCC.Columns(Index + 1), BoundField).DataField = String.Format("SubProyecto{0}Porcentaje", Dr("SubProyecto"))
'GvCC.Columns(Index + 1).HeaderText = "%"
'Index += 2
Index += 1
Next
GvCC.DataBind()
@@ -156,7 +194,7 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
End If
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
'RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
Conta.Dispose()
End Sub
@@ -164,16 +202,119 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
#Region " GV ROW DATABOUND "
Protected Sub GvCC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCC.RowDataBound
Protected Sub GvCC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
setgraficaCC(e)
e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
setgraficaCC(e)
If e.Row.DataKey("Level").ToEntero = 0 Then
e.Row.CssClass = "Totales"
End If
If e.Row.DataKey("Level").ToEntero = 1 Then
e.Row.CssClass = "SubTotales"
End If
Dim Index As Integer = 2
For Each DRow As DataRow In DTHeaders.Rows
Dim Importe As Decimal = e.Row.DBCampo($"SubProyecto{DRow("SubProyecto")}").ToDecimal
'Dim Anio As Integer = DRow("SubProyecto").ToString.ToEntero
If e.Row.CssClass = "Totales" And Index = 2 Then
e.Row.Cells(Index).ForeColor = Drawing.ColorTranslator.FromHtml("#337ab7")
End If
If e.Row.Cells(Index).Text.Replace("%", "").ToDecimal = 0 Then
e.Row.Cells(Index).Text = "-"
ElseIf e.Row.Cells(Index).Text.Replace("%", "").ToDecimal < 0 Then
e.Row.Cells(Index).ForeColor = Drawing.Color.Red
End If
Index += 1
Next
Dim CveCunetaRow As Integer = e.Row.DataKey("CveCuenta").ToEntero
Dim inicial As Boolean = True
Index = 4
For Each DRow As DataRow In DTHeaders.Rows
Dim Importe As Decimal = e.Row.DBCampo($"SubProyecto{DRow("SubProyecto")}").ToDecimal
'Dim Anio As Integer = DRow("SubProyecto").ToString.ToEntero
If e.Row.Cells(Index).Text.Replace("%", "").ToDecimal = 0 Then
e.Row.Cells(Index).Text = "-"
ElseIf e.Row.Cells(Index).Text.Replace("%", "").ToDecimal < 0 Then
e.Row.Cells(Index).ForeColor = Drawing.Color.Red
End If
If Importe <> 0 Then
e.Row.Cells(Index).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue.ToEntero}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
End If
'If e.Row.Cells(Index + 1).Text.ToDecimal = 0 Then
' e.Row.Cells(Index + 1).Text = "-"
'ElseIf e.Row.Cells(Index + 1).Text.ToDecimal < 0 Then
' e.Row.Cells(Index + 1).ForeColor = Drawing.Color.Red
'End If
Index += 1
Next
'Index = 4
'For Each DRow As DataRow In DTHeaders.Rows
' Dim Importe As Decimal = e.Row.DBCampo($"SubProyecto{DRow("SubProyecto")}").ToDecimal
' 'Dim Anio As Integer = DRow("SubProyecto").ToString.ToEntero
' If Importe > 0 Then
' e.Row.Cells(Index).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF=31/12/{DdlEjercicio.SelectedValue}&FI=01/01/{DdlEjercicio.SelectedValue}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue.ToEntero}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
' Else
' e.Row.Cells(Index).Text = "-"
' End If
' If e.Row.Cells(Index + 1).Text.ToDecimal = 0 Then
' e.Row.Cells(Index + 1).Text = "-"
' ElseIf e.Row.Cells(Index + 1).Text.ToDecimal < 0 Then
' e.Row.Cells(Index + 1).ForeColor = Drawing.Color.Red
' End If
' If e.Row.Cells(Index + 2).Text.Replace("%", "").ToDecimal = 0 Then
' e.Row.Cells(Index + 2).Text = "-"
' ElseIf e.Row.Cells(Index + 2).Text.Replace("%", "").ToDecimal < 0 Then
' e.Row.Cells(Index + 2).ForeColor = Drawing.Color.Red
' End If
' Index += 1
'Next
' e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
End Sub
Public Sub setgraficaCC(e As GridViewRowEventArgs)
@@ -198,7 +339,7 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
SubProyecto = DdlSubProyecto.SelectedItem.Text
End If
GvCC.ExportToExcelGembox("AnexoCatálogoMensual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio.SelectedValue}", "Anexo del Catálogo - Mensual", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}")
GvCC.ExportToExcelGembox("AnexoCatálogoMensual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio.SelectedValue}", $"Estado de Resultados Horizontal por {LblSubProyecto.Text}", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}")
End Sub

View File

@@ -121,6 +121,7 @@
<div class="col-md-12">
<div style="background-color: #fff;">
<asp:GridView ID="GvMensual2" runat="server" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron datos" GridLines="none"
DataKeyNames="Level,CveCuenta"
CssClass="ADSCROLLER2 table table-striped table-advance table-hover" data-cols="2" data-heightmenos="300">
<Columns>

View File

@@ -169,7 +169,7 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual
End If
RegistraScript($"LimpiaCeros();")
'RegistraScript($"LimpiaCeros();")
Conta.Dispose()
End Sub
@@ -183,9 +183,127 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
setgrafica(e)
e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
setgrafica(e)
If e.Row.DataKey("Level").ToEntero = 0 Then
e.Row.CssClass = "Totales"
End If
If e.Row.DataKey("Level").ToEntero = 1 Then
e.Row.CssClass = "SubTotales"
End If
Dim Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre As Decimal
Enero = e.Row.DBCampo("Enero").ToDecimal()
Febrero = e.Row.DBCampo("Febrero").ToDecimal()
Marzo = e.Row.DBCampo("Marzo").ToDecimal()
Abril = e.Row.DBCampo("Abril").ToDecimal()
Mayo = e.Row.DBCampo("Mayo").ToDecimal()
Junio = e.Row.DBCampo("Junio").ToDecimal()
Julio = e.Row.DBCampo("Julio").ToDecimal()
Agosto = e.Row.DBCampo("Agosto").ToDecimal()
Septiembre = e.Row.DBCampo("Septiembre").ToDecimal()
Octubre = e.Row.DBCampo("Octubre").ToDecimal()
Noviembre = e.Row.DBCampo("Noviembre").ToDecimal()
Diciembre = e.Row.DBCampo("Diciembre").ToDecimal()
Dim CveCunetaRow As Integer = e.Row.DataKey("CveCuenta").ToEntero
For x = 2 To GvMensual2.Columns.Count - 1
If e.Row.Cells(x).Text.Replace("%", "").ToDecimal = 0 Then
e.Row.Cells(x).Text = "-"
ElseIf e.Row.Cells(x).Text.Replace("%", "").ToDecimal < 0 Then
e.Row.Cells(x).ForeColor = Drawing.Color.Red
End If
If x = 2 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/01/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/01/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
If x = 3 Then
e.Row.Cells(x).Text = $"<a { If(Febrero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/02/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/02/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Febrero.ToString("###,###,##0"), Febrero.ToString("###,###,###.00")) }</a>"
End If
If x = 6 Then
e.Row.Cells(x).Text = $"<a { If(Marzo < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/03/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/03/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Marzo.ToString("###,###,##0"), Marzo.ToString("###,###,###.00")) }</a>"
End If
If x = 10 Then
e.Row.Cells(x).Text = $"<a { If(Abril < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/04/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/04/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Abril.ToString("###,###,##0"), Abril.ToString("###,###,###.00")) }</a>"
End If
If x = 14 Then
e.Row.Cells(x).Text = $"<a { If(Marzo < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/05/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/05/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Marzo.ToString("###,###,##0"), Marzo.ToString("###,###,###.00")) }</a>"
End If
If x = 17 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/06/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/06/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
If x = 21 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/07/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/07/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
If x = 24 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/08/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/08/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
If x = 28 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/09/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/09/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
If x = 32 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/10/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/10/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
If x = 35 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/11/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/11/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
If x = 38 Then
e.Row.Cells(x).Text = $"<a { If(Enero < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF={ $"01/12/{DdlEjercicio.SelectedValue}".ToDate.LastDayOfMonth.ToShortDateString }&FI=01/12/{DdlEjercicio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Enero.ToString("###,###,##0"), Enero.ToString("###,###,###.00")) }</a>"
End If
Next
If Enero = 0 Then
e.Row.Cells(2).Text = "-"
Else
End If
' e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
' Level 0 Total 1 SubTotal 1
End If
End Sub

File diff suppressed because it is too large Load Diff

View File

@@ -130,11 +130,11 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo
TxtFechaDel.Text = FechaInicio.ToShortDateString
End If
'If Request("CveSubProyecto") IsNot Nothing Then
' If IsNumeric(Request("CveSubProyecto")) Then
' CveSubProyecto = Request("CveSubProyecto").ToString
' End If
'End If
If Request("CveSubProyecto") IsNot Nothing Then
If IsNumeric(Request("CveSubProyecto")) Then
DdlSubproyecto.SelectedValueExist(Request("CveSubProyecto").ToString)
End If
End If
ErrorParametros = False

View File

@@ -705,9 +705,12 @@ Partial Class Contratos_Default
End If
TipoContrato = DdlTipoContrato.SelectedValue.ToEntero
TxtDescripcionTipoContrato.Text = GlobalDTContratosTipos(UsuarioActual.CveEmpresa).FiltraParametros("CveContratoTipo = " & DdlTipoContrato.SelectedValue)(0)("Descripcion").ToString()
TxtDescripcionTipoContrato.Visible = True
If GlobalDTContratosTipos(UsuarioActual.CveEmpresa).FiltraParametros("CveContratoTipo = " & DdlTipoContrato.SelectedValue).Rows.Count > 0 Then
TxtDescripcionTipoContrato.Text = GlobalDTContratosTipos(UsuarioActual.CveEmpresa).FiltraParametros("CveContratoTipo = " & DdlTipoContrato.SelectedValue)(0)("Descripcion").ToString()
TxtDescripcionTipoContrato.Visible = True
End If
CargaContratoPadre()
UpProyecto.Update()
End Sub
@@ -725,6 +728,15 @@ Partial Class Contratos_Default
TableDatosCabecera.Visible = True
End If
If CveTipoContrato = 25 Then
DvMax.Visible = False
DvMin.Visible = False
DvTotal.Visible = False
DivFianzas.Visible = False
DivImpuestosLocales.Visible = False
End If
ElseIf modalidadDetalleInt = 2 Then
ModalidadDetalle = 2
@@ -735,6 +747,15 @@ Partial Class Contratos_Default
If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
TableDatosCabecera.Visible = True
End If
If CveTipoContrato = 25 Then
DvMax.Visible = False
DvMin.Visible = False
DvTotal.Visible = False
DivFianzas.Visible = False
DivImpuestosLocales.Visible = False
End If
End If
@@ -755,11 +776,13 @@ Partial Class Contratos_Default
Exit Sub
End If
Me.CveTipoContrato = DdlTipoContrato.SelectedValue.ToEntero
'Dim TipoMov = GlobalDTContratosTipos.FiltroPrimeroValor("TipoMovimiento", $"CveContratoTipo='{CveTipoContrato}'").ToEntero
If rpCompra.Checked Then
Dim CveContratoTipo = DdlTipoContrato.SelectedValue.ToEntero
Response.Redirect($"/Contratos/Presupuestos.aspx?CveContrato=-1&CveContratoTipo={CveContratoTipo}")
If rpCompra.Checked Then
Response.Redirect($"/Contratos/Presupuestos.aspx?CveContrato=-1&CveContratoTipo={Me.CveTipoContrato}")
'RegistraScript("window.location='/Contratos/Presupuestos.aspx")
Else

View File

@@ -93,7 +93,7 @@
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvCiclosComerciales" runat="server" DataKeyNames="CveCicloComercial, NumeroContrato, CveSubProyecto" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se encontraron pendientes por facturar" GridLines="none" ToolTip="Listado de Pendientes" CssClass="table table-striped table-hover Widthall">
<asp:GridView ID="GvCiclosComerciales" runat="server" DataKeyNames="CveCicloComercial, NumeroContrato, CveSubProyecto, FechaVenc" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se encontraron pendientes por facturar" GridLines="none" ToolTip="Listado de Pendientes" CssClass="table table-striped table-hover Widthall">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" headertext="" ItemStyle-Width="10%">
<ItemTemplate>

View File

@@ -166,350 +166,279 @@ Partial Class Contratos_FacturacionMasiva
End Sub
Protected Sub ImgFacturarTodos_Click(sender As Object, e As EventArgs) Handles BtnFacturar.Click
Dim FacturadoCorrecto = True
EjecutarFacturacion()
End Sub
Private Sub EjecutarFacturacion()
Dim FacturadoCorrecto = True
Dim sb As New StringBuilder()
For Each row As GridViewRow In GvCiclosComerciales.Rows
If row.FCCheckBox("chkDis").Checked Then
FacturadoCorrecto = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero)
Dim fecha As DateTime = DateTime.Now ', row.DataKey("FechaVenc").ToString.ToDateTime()
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
Dim Etiqueta As String = String.Format("{0} - {1}", nombreMes, fecha.Year)
Dim Resp = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero, Etiqueta)
For Each Msg In Resp.Mensajes
sb.AppendFormat("{0}</br></br>", Msg)
Next
If Not FacturadoCorrecto Then
If Mensaje = "" Then
Alert("Ocurrió un error al facturar masivamente, por favor contacte a soporte técnico", TipoMensaje.MsgAdvertencia)
Else
Alert($"{Mensaje} en el contrato {row.DataKey("NumeroContrato").ToString}", TipoMensaje.MsgAdvertencia)
End If
Exit For
End If
End If
Next
If FacturadoCorrecto Then
Alert("Los periodos se facturaron correctamente")
TxtObservaciones.Text = ""
End If
If sb.ToString().Length > 0 Then
Alert($"Se generaron las siguientes facturas: </br></br> {sb.ToString()}")
Else
Alert("No se generaron facturas", TipoMensaje.MsgAdvertencia)
End If
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
RegistraScript("$('#divAgregar').modal('hide')")
UpBodyEstatus.Update()
UpBodyEstatus.Update()
End Sub
Protected Sub btnFacturarAqui_Click(sender As Object, e As EventArgs)
CveCicloComercial = CType(sender, LinkButton).CommandArgument.ToEntero
CreaObjetosVenta()
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
ObjFactura = Nothing
Exit Sub
End If
If ObjFactura.CveCliente > 0 Then
If DTDetalle.Rows.Count > 0 Then
Dim ObjVentas As New ClsVentas()
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
Dim ObjContPaq As ClsContPAQi = Nothing
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
ErrorList = New List(Of String)
MensajeAlert = New StringBuilder
'CONTABILIDAD AUTOMATICA Y AC
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
End If
'GUARDA VENTA
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
If CveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
If Not ObjContr.CicloComercialUpdate(CveCicloComercial, True, UsuarioActual.CveEmpresa) Then
ErrorList.Add("No se pudo actualizar ")
End If
End If
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
ObjVentas.Commit()
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
ViewState("CveVenta") = ObjFactura.CveVenta
Dim SeTimbro As Boolean = False
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
Dim sw As New Diagnostics.Stopwatch
sw.Start()
'FACTURA INGRESO/EGRESO
Dim ObjTimbrado As New Timbrado
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
sw.Stop()
GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
End If
'MENSAJE PRINCIPAL
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
If SeTimbro Then
'XML
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
If File.Exists(ArchivoXML) Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
End If
'IMPRESION
GeneraPDFFactura(False)
Else
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
End If
'MUESTA ALERT OK
Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
Alert(MensajeAlert.ToString, TipoMensaje.MsgInformacion)
ObjFactura = Nothing
Else
ObjVentas.RollBack()
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
For Each ErrorItem In ErrorList
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
Next
'MUESTA ALERT ERROR
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
End If
ObjVentas.Dispose()
ObjConta.Dispose()
ObjInventario.Dispose()
ObjContr.Dispose()
ErrorList = Nothing
MensajeAlert = Nothing
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
Else
ObjVentas.RollBack()
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
For Each ErrorItem In ErrorList
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
Next
'MUESTA ALERT ERROR
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
ObjVentas.Dispose()
ObjConta.Dispose()
ObjInventario.Dispose()
ObjContr.Dispose()
'ObjFolios.Dispose()
ErrorList = Nothing
MensajeAlert = Nothing
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
End If
Else
Mensaje = "Las facturas del contrato"
End If
End If
Protected Sub btnFacturarAqui_Click(sender As Object, e As EventArgs)
EjecutarFacturacion()
End Sub
Private Function EmitirImprimir(pCveCicloComercial As Integer) As Boolean
Dim retorno As Boolean = False
Private Function EmitirImprimir(pCveCicloComercial As Integer, Etiqueta As String) As Modelos.Factura.MMensajeFactura
Dim Resp As New Modelos.Factura.MMensajeFactura
ViewState("CveCicloComercial") = pCveCicloComercial
CreaObjetosVenta()
CreaObjetosVenta(Etiqueta)
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
ObjFactura = Nothing
Return False
Return Resp
End If
If ObjFactura.CveCliente > 0 Then
If DTDetalle.Rows.Count > 0 Then
If DTDetalle.Rows.Count > 0 Then
Resp = ObjFactura.EmitirFactura()
Dim ObjVentas As New ClsVentas()
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
Dim ObjContPaq As ClsContPAQi = Nothing
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
ErrorList = New List(Of String)
MensajeAlert = New StringBuilder
'Dim ObjVentas As New ClsVentas()
'Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
'Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
'Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
'Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
'Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
'Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
'Dim ObjContPaq As ClsContPAQi = Nothing
''Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
'ErrorList = New List(Of String)
'MensajeAlert = New StringBuilder
'CONTABILIDAD AUTOMATICA Y AC
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
End If
''CONTABILIDAD AUTOMATICA Y AC
'If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
' ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
'End If
'GUARDA VENTA
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
''GUARDA VENTA
'GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
If pCveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
If Not ObjContr.CicloComercialUpdate(pCveCicloComercial, True, UsuarioActual.CveEmpresa) Then
ErrorList.Add("No se pudo actualizar ")
End If
End If
'If pCveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
' If Not ObjContr.CicloComercialUpdate(pCveCicloComercial, True, UsuarioActual.CveEmpresa) Then
' ErrorList.Add("No se pudo actualizar ")
' End If
'End If
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
ObjVentas.Commit()
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
ViewState("CveVenta") = ObjFactura.CveVenta
'If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
' ObjVentas.Commit()
' If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
' ViewState("CveVenta") = ObjFactura.CveVenta
Dim SeTimbro As Boolean = False
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
' Dim SeTimbro As Boolean = False
' 'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
' If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
' If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
Dim sw As New Diagnostics.Stopwatch
sw.Start()
' Dim sw As New Diagnostics.Stopwatch
' sw.Start()
'FACTURA INGRESO/EGRESO
Dim ObjTimbrado As New Timbrado
' 'FACTURA INGRESO/EGRESO
' Dim ObjTimbrado As New Timbrado
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
sw.Stop()
GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
End If
' sw.Stop()
' GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
' End If
'MENSAJE PRINCIPAL
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
' 'MENSAJE PRINCIPAL
' MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
If SeTimbro Then
'XML
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
If File.Exists(ArchivoXML) Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
End If
' If SeTimbro Then
' 'XML
' Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
' If File.Exists(ArchivoXML) Then
' MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
' End If
'IMPRESION
GeneraPDFFactura(False)
Else
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
End If
' 'IMPRESION
' GeneraPDFFactura(False)
' Else
' MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
' End If
'MUESTA ALERT OK
Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
retorno = True
ObjFactura = Nothing
Else
ObjVentas.RollBack()
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
' 'MUESTA ALERT OK
' Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
' retorno = True
' ObjFactura = Nothing
' Else
' ObjVentas.RollBack()
' If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
For Each ErrorItem In ErrorList
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
Next
' For Each ErrorItem In ErrorList
' Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
' Next
'MUESTA ALERT ERROR
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
End If
' 'MUESTA ALERT ERROR
' Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
' End If
ObjVentas.Dispose()
ObjConta.Dispose()
ObjInventario.Dispose()
ObjContr.Dispose()
ErrorList = Nothing
MensajeAlert = Nothing
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
Else
ObjVentas.RollBack()
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
' ObjVentas.Dispose()
' ObjConta.Dispose()
' ObjInventario.Dispose()
' ObjContr.Dispose()
' ErrorList = Nothing
' MensajeAlert = Nothing
' If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
'Else
' ObjVentas.RollBack()
' If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
For Each ErrorItem In ErrorList
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
Next
' For Each ErrorItem In ErrorList
' Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
' Next
'MUESTA ALERT ERROR
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
ObjVentas.Dispose()
ObjConta.Dispose()
ObjInventario.Dispose()
ObjContr.Dispose()
'ObjFolios.Dispose()
ErrorList = Nothing
MensajeAlert = Nothing
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
End If
' 'MUESTA ALERT ERROR
' Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
' ObjVentas.Dispose()
' ObjConta.Dispose()
' ObjInventario.Dispose()
' ObjContr.Dispose()
' 'ObjFolios.Dispose()
' ErrorList = Nothing
' MensajeAlert = Nothing
' If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
'End If
Else
Mensaje = "No se pudo completar facturación por que no se encontraron partidas "
End If
End If
TmpDT.Clear()
Return retorno
Return Resp
End Function
Private Sub CreaDTVentas()
Private Sub CreaDTVentas()
TmpDT = New DataTable
TmpDT.Columns.Add("CveVenta", GetType(Integer))
TmpDT.Columns.Add("Consec", GetType(Integer))
TmpDT.Columns.Add("Cantidad", GetType(Double))
TmpDT.Columns.Add("Codigo", GetType(String))
TmpDT.Columns.Add("CveUM", GetType(Integer))
TmpDT.Columns.Add("UM", GetType(String))
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
TmpDT.Columns.Add("Clasificacion", GetType(String))
TmpDT.Columns.Add("CvePS", GetType(Integer))
TmpDT.Columns.Add("PS", GetType(String))
TmpDT.Columns.Add("CodigoPS", GetType(String))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("SerieLote", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
TmpDT.Columns.Add("PU", GetType(Double))
TmpDT.Columns.Add("IVA", GetType(Double))
TmpDT.Columns.Add("IEPS", GetType(Double))
TmpDT.Columns.Add("Descuento", GetType(Double))
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
TmpDT.Columns.Add("Total", GetType(Double))
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
TmpDT.Columns.Add("Proyecto", GetType(String))
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
TmpDT.Columns.Add("SubProyecto", GetType(String))
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDT.Columns.Add("Observacion", GetType(String))
TmpDT.Columns.Add("SATClaveUM", GetType(String))
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("TotalImporte", GetType(Double))
TmpDT.Columns.Add("PorcentajeIVA", GetType(Double))
TmpDT.Columns.Add("ImporteIVA", GetType(Double))
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Double))
TmpDT.Columns.Add("ImporteIEPS", GetType(Double))
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Double))
TmpDT.Columns.Add("ImporteRetIVA", GetType(Double))
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Double))
TmpDT.Columns.Add("ImporteRetISR", GetType(Double))
TmpDT.Columns.Add("CveVenta", GetType(Integer))
TmpDT.Columns.Add("Consec", GetType(Integer))
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
TmpDT.Columns.Add("Codigo", GetType(String))
TmpDT.Columns.Add("CveUM", GetType(Integer))
TmpDT.Columns.Add("UM", GetType(String))
TmpDT.Columns.Add("SATClaveUM", GetType(String))
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
TmpDT.Columns.Add("Clasificacion", GetType(String))
TmpDT.Columns.Add("CvePS", GetType(Integer))
TmpDT.Columns.Add("PS", GetType(String))
TmpDT.Columns.Add("CodigoPS", GetType(String))
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("Serie", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
TmpDT.Columns.Add("PU", GetType(Decimal))
TmpDT.Columns.Add("IVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
TmpDT.Columns.Add("IEPS", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
TmpDT.Columns.Add("Descuento", GetType(Decimal))
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal))
'Para uso del módulo contable
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
TmpDT.Columns.Add("Proyecto", GetType(String))
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
TmpDT.Columns.Add("SubProyecto", GetType(String))
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
'Contratos
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
'Remisiones a Facturas
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
'Pedido2 a Facturas
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
TmpDT.Columns.Add("Origen", GetType(Integer))
'Ordenes Servicio
TmpDT.Columns.Add("CveOS", GetType(Integer))
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
TmpDT.Columns.Add("Folio", GetType(Integer))
TmpDT.Columns.Add("Estatus", GetType(String))
'Ordenamiento
TmpDT.Columns.Add("Orden", GetType(Integer))
TmpDT.Columns.Add("TipoDocto", GetType(String))
'OC
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
End Sub
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
Private Sub CreaObjetosVenta(Etiqueta As String, Optional VistaPrevia As Boolean = False)
Dim ObjFolios As New ClsGralFolios()
Dim Folio As String = ""
Dim Serie As String = ""
@@ -518,10 +447,9 @@ Partial Class Contratos_FacturacionMasiva
Dim Proyecto As String = ""
Dim SubProyecto As String = ""
ObjFactura = New Modelos.Factura
Dim objContratos As New ClsContratos
ObjFactura = New Modelos.Factura(UsuarioActual)
ObjFactura.DirectorioServidor = Server.MapPath("/")
ObjFactura.CveCicloComercial = CveCicloComercial
Dim DR As DataRow = DTCicloComercial.FiltroPrimero($"CveCicloComercial = {CveCicloComercial}")
ObjFactura.Version = "3.3"
@@ -544,7 +472,7 @@ Partial Class Contratos_FacturacionMasiva
ObjFactura.MetodoPago = "Efectivo"
ObjFactura.FechaPago = DateTime.Today
ObjFactura.MotivoDescuento = ""
ObjFactura.Observaciones = DR("Observaciones").ToString
ObjFactura.Observaciones = Etiqueta + " " + TxtObservaciones.Text + " " + DR("Observaciones").ToString
ObjFactura.FechaEjecucion = DateTime.Today
'ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {1}")
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
@@ -587,15 +515,16 @@ Partial Class Contratos_FacturacionMasiva
End If
DT.Dispose()
End If
ObjFolios.Dispose()
ObjFolios.Dispose()
Dim objContratos As New ClsContratos
If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then
DTDetalle = objContratos.DtResultados
Else
DTDetalle = Nothing
End If
objContratos.Dispose()
objContratos.Dispose()
Dim DtR As DataRow
ObjFactura.SubTotal = SUM(DTDetalle, "Total").ToDecimal
ObjFactura.IVA = SUM(DTDetalle, "ImporteIVA").ToDecimal
@@ -607,34 +536,27 @@ Partial Class Contratos_FacturacionMasiva
ObjFactura.Folio = Folio.ToEntero
For Each row As DataRow In DTDetalle.Rows
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
DtR = TmpDT.NewRow
DtR("CveVenta") = -1
DtR("Codigo") = row("Codigo")
DtR("Consec") = TmpDT.Rows.Count + 1
DtR("Cantidad") = row("CantidadContratada")
DtR("CveUM") = row("CveUM")
DtR("UM") = row("UM")
DtR("UM") = row("UM")
DtR("SATClaveUM") = row("SATClaveUM")
DtR("CveClasificacion") = row("CveClasificacion")
DtR("Clasificacion") = row("Clasificacion")
DtR("CvePS") = row("CvePS")
DtR("PS") = row("PS")
DtR("CodigoPS") = row("CodigoPS")
DtR("Obs") = ""
DtR("PU") = row("PU")
DtR("Descuento") = 0
DtR("TipoDescuento") = 0
DtR("CveProyecto") = CveProyecto
DtR("Proyecto") = Proyecto
DtR("CveSubProyecto") = CveSubProyecto
DtR("SubProyecto") = SubProyecto
DtR("CveVentaDetalle") = 0
DtR("CveContratoDetalle") = row("CveContratoDetalle")
DtR("Observacion") = row("Observacion")
DtR("SATClaveUM") = row("SATClaveUM")
DtR("CodigoPS") = row("CodigoPS")
DtR("SATClaveProdServ") = row("SATClaveProdServ")
DtR("CuentaPredial") = row("CuentaPredial")
DtR("NoIdentificacion") = row("NoIdentificacion")
DtR("TotalImporte") = row("Total")
DtR("NoIdentificacion") = row("NoIdentificacion")
DtR("CveTipoPS") = DrPS("CveTipoPS")
DtR("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
DtR("Obs") = Etiqueta + " " + TxtObservaciones.Text + " " + row("Observacion").ToString
DtR("PU") = row("PU")
DtR("IVA") = row("PorcentajeIVA")
DtR("PorcentajeIVA") = row("PorcentajeIVA")
DtR("ImporteIVA") = row("ImporteIVA")
@@ -644,6 +566,17 @@ Partial Class Contratos_FacturacionMasiva
DtR("ImporteRetIVA") = row("ImporteRetIVA")
DtR("PorcentajeRetISR") = row("PorcentajeRetISR")
DtR("ImporteRetISR") = row("ImporteRetISR")
DtR("Descuento") = 0
DtR("TipoDescuento") = 0
DtR("CveProyecto") = CveProyecto
DtR("Proyecto") = Proyecto
DtR("CveSubProyecto") = CveSubProyecto
DtR("SubProyecto") = SubProyecto
DtR("CveVentaDetalle") = 0
DtR("CveContratoDetalle") = row("CveContratoDetalle")
DtR("CuentaPredial") = row("CuentaPredial")
DtR("TotalImporte") = row("Total")
TmpDT.Rows.Add(DtR)
Next
@@ -952,7 +885,9 @@ Partial Class Contratos_FacturacionMasiva
IdCtaContable = 0
CveCuenta = 0
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", "")
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", "")
Dim PorcentajeImpuesto As Decimal = 0
Select Case ConceptoContable
Case 1 'Cliente
@@ -1077,6 +1012,7 @@ Partial Class Contratos_FacturacionMasiva
FechaMovimiento = ObjFactura.FechaPago
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal
Case 38 'IEPS por Trasladar
If Not ObjFactura.TipoDocto.Contiene("Rem") Then
@@ -1089,7 +1025,8 @@ Partial Class Contratos_FacturacionMasiva
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladarSIG").ToString.ToEntero
End If
End If
End If
PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIEPS").ToDecimal
End If
End Select
@@ -1101,7 +1038,7 @@ Partial Class Contratos_FacturacionMasiva
idCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto) Then
ErrorPrepoliza = True
Else
ViewState("SeGuardoPrePoliza") = True

View File

@@ -460,7 +460,7 @@
</Paragraphs>
<rd:DefaultName>Textbox1</rd:DefaultName>
<Top>0.9533cm</Top>
<Left>0.23022cm</Left>
<Left>0.21008cm</Left>
<Height>0.66127cm</Height>
<Width>9.36417cm</Width>
<ZIndex>2</ZIndex>
@@ -769,10 +769,11 @@
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<Format>dd/MM/yyyy</Format>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!FechaEntrega.Value</Value>
<Value>=Left(Parameters!FechaEntrega.Value,10)</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
@@ -1869,7 +1870,7 @@
<Height>8.91698in</Height>
<Style />
</Body>
<Width>7.657in</Width>
<Width>7.66009in</Width>
<Page>
<PageHeader>
<Height>3.39287cm</Height>
@@ -2201,7 +2202,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Fecha Impresión:</Value>
<Value>Fecha Impresion:</Value>
<Style>
<FontSize>9pt</FontSize>
<FontWeight>Bold</FontWeight>
@@ -2520,8 +2521,9 @@
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="FechaEntrega">
<DataType>DateTime</DataType>
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="ResponsableCarga">

View File

@@ -4204,7 +4204,7 @@ Partial Class Inventarios_EntradasSalidas
TxtnSerie.Text = ""
TxtnLote.Text = ""
TxtnFechaCaducidad.Text = ""
DdlSeccionAlmacen.SelectedValue = "-1"
'DdlSeccionAlmacen.SelectedValue = "-1"
NumAgregados = NumAgregados + 1
End If

View File

@@ -199,7 +199,10 @@ Partial Class Inventarios_PrestamosdeProveedor
CveSubProyecto = ObjInventario.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero } ").FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
End If
If CveSubProyecto <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
ErrorMovInv = True
End If
Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS))
IdCtaContableOtro = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasifCosto}").ToEntero

View File

@@ -283,7 +283,7 @@
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -360,6 +360,18 @@
</div>
</div>
</div>
<%--ADVERTENCIA--%>
<div class="row">
<div class="col-md-12" style="vertical-align: middle;" align="center">
<div style="z-index: 5; position: relative;">
<div id="DivTraspasoDevolucion" visible="false" clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
<asp:Literal Text="La mercancía sera trasladada desde el almacen seleccionado al almacén de devolución" ID="LtlTextoDevolucion" runat="server"></asp:Literal>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -418,7 +430,7 @@
</asp:UpdatePanel>
<asp:GridView ID="GvInv" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño,Lote,AplicaSeccion,AplicaLote,AplicaCaducidad,AplicaSerie,CveAlmacenDevolucionProveedor" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño,Lote,AplicaSeccion,AplicaLote,AplicaCaducidad,AplicaSerie" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
<HeaderStyle Height="58px" />
<Columns>
<asp:TemplateField>
@@ -1005,6 +1017,13 @@
});
}
if ($('#DivTraspasoDevolucion')) {
$("#DivTraspasoDevolucion").pulsate("destroy");
jQuery('#DivTraspasoDevolucion').pulsate({
color: "#faebcc"
});
}
});
}

View File

@@ -377,7 +377,7 @@ Partial Class Inventarios_RecepcionAlmacen
ViewState("CveVendedor") = value
End Set
End Property
Private Property RealizarTraspasoAlmacenDevolucion() As Boolean
Private Property RealizarTraspasoAlmacenDevolucion As Boolean
Get
Return If(IsNothing(ViewState("RealizarTraspasoAlmacenDevolucion")), False, CBool(ViewState("RealizarTraspasoAlmacenDevolucion")))
End Get
@@ -725,7 +725,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim DtPendientes As New DataTable
If ObjInventarios.ComprasPendientesAlmacenGet(-1, TxtFechaPendientes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Dim FiltroTemporal = If(UsuarioActual.CveEmpresa.Contiene(119, 140), "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')")
Dim FiltroTemporal = If(UsuarioActual.CveEmpresa.Contiene(119, 140, 1, 72, 80), "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')")
DtPendientes = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}")
Else
DtPendientes = Nothing
@@ -926,11 +926,16 @@ Partial Class Inventarios_RecepcionAlmacen
DtRecepcion = ObjInventario.DtResultados.Copy()
End If
If TipoMovimiento = 2 AndAlso GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=21).Rows.Count > 0 Then
CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero
If TipoMovimiento = 2 AndAlso CveAlmacenDevolucionProveedor > 0 Then
RealizarTraspasoAlmacenDevolucion = True
CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero
'CreaDTAlmacenDevolucion()
'CargaAlmacenes(-1, "21", CveTipoCompra)
DivTraspasoDevolucion.Visible = True
LtlTextoDevolucion.Text = "La mercancía sera trasladada desde el almacen seleccionado al almacén de devolución"
ElseIf TipoMovimiento = 2 AndAlso GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=21).Rows.Count = 0 Then
LtlTextoDevolucion.Text = "La mercancía sera devuelta ha el almacen seleccionado."
DivTraspasoDevolucion.Visible = True
End If
DtDatosDetalle = Nothing
@@ -1115,6 +1120,7 @@ Partial Class Inventarios_RecepcionAlmacen
CveFleteSurtir = pCveImportacion
CveFleteOrdenCompra = ObjInventario.DtResultados.Rows(0)("CveOC").ToString.ToEntero
CveFleteCompra = ObjInventario.DtResultados.Rows(0)("CveCompra").ToString.ToEntero
CveImportacionCompra = CveFleteCompra ' se iguala para que al guardar el movimiento, se toma esta variable
LbProveedor.Text = ObjInventario.DtResultados.Rows(0)("RazonSocial").ToString
HLFolio.Text = ObjInventario.DtResultados.Rows(0)("Folio").ToString
If UsuarioActual.TienePermisoProceso(201) Then
@@ -3261,7 +3267,7 @@ Partial Class Inventarios_RecepcionAlmacen
Msg.AppendFormat("Movimiento de Salida: Folio: <b>{0}</b>", String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoSalidaTraspaso, FolioSalidaTraspaso))
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalidaTraspaso)))
Msg.AppendFormat("<br/>Movimiento de Entrada: Folio: <b>{0}</b>", link)
Msg.AppendFormat("<br/><br/>Movimiento de control: Folio: <b>{0}</b>", link)
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
End If

View File

@@ -259,8 +259,7 @@
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar autorización?" data-btn-ok-label="Si" OnClick="LnkAceptarTraslado_Click"></asp:LinkButton>
</div>
<div class="col-md-6" style="text-align:center!important">
<asp:LinkButton runat="server" Text ="Rechazar" ID="LnkRechazarTraslado" CssClass="btn btn-danger"
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar rechazo?" data-btn-ok-label="Si" OnClick="LnkRechazarTraslado_Click" ></asp:LinkButton>
<asp:LinkButton runat="server" Text ="Rechazar" ID="LnkRechazarTraslado" CssClass="btn btn-danger" OnClick="LnkRechazarTraslado_Click" ></asp:LinkButton>
</div>
</div>
@@ -308,7 +307,7 @@
<%--<asp:BoundField HeaderText="Direccion Envio" HeaderStyle-HorizontalAlign="Left" DataField="DireccionEnvio" ItemStyle-Width="20%" />--%>
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="20%" />
<asp:BoundField HeaderText="Precio" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:c}" ItemStyle-HorizontalAlign="Right" DataField="Precio" Visible="false" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Serie" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" DataField="Serie" Visible="false" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Serie" DataField="Serie" Visible="false" ItemStyle-Width="5%" />
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="Si" />
@@ -500,6 +499,51 @@
</div>
</div>
<div id="ModalRechazarTraslado" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalRechazo" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal3" runat="server">Rechazar solicitud</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-10 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMotivoRechazo" CssClass="form-control marginFixRow" runat="server" MaxLength="200" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtMotivoRechazo.ClientID.ToString()%>">Motivo de rechazo:</label>
<asp:RequiredFieldValidator ID="RfvTxtMotivoRechazo" runat="server" ControlToValidate="TxtMotivoRechazo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo de rechazo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRechazo"></asp:RequiredFieldValidator>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="row">
<div class="col-md-12">
<asp:Button ID="BtnModalRechazo" runat="server" class="btn btn-danger" Text="Rechazar" Style="margin-left: -100px;" ValidationGroup="GrpRechazo"
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar rechazo?" data-btn-ok-label="Si" OnClick="BtnModalRechazo_Click" />
<button id="btnModalRechazoCerrar" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -4,10 +4,10 @@ Option Explicit On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Inventarios_TrasladoSolicitud
Inherits ClsPaginas
Inherits ClsPaginas
#Region "Propiedades"
Private Property TempDT As DataTable
Get
@@ -36,19 +36,19 @@ Partial Class Inventarios_TrasladoSolicitud
ViewState("CveDireccionEnvio") = value
End Set
End Property
'Private Property CveUsuarioAutoriza As Integer
' Get
' If ViewState("CveUsuarioAutoriza") Is Nothing Then
' Return -1
' Else
' Return CType(ViewState("CveUsuarioAutoriza"), Integer)
' End If
Private Property CveUsuarioSolicita As Integer
Get
If ViewState("CveUsuarioSolicita") Is Nothing Then
Return -1
Else
Return CType(ViewState("CveUsuarioSolicita"), Integer)
End If
' End Get
' Set(value As Integer)
' ViewState("CveUsuarioAutoriza") = value
' End Set
'End Property
End Get
Set(value As Integer)
ViewState("CveUsuarioSolicita") = value
End Set
End Property
#End Region
@@ -64,10 +64,10 @@ Partial Class Inventarios_TrasladoSolicitud
End If
End If
End Sub
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
CveTraspasoSolicitud = -1
@@ -140,10 +140,10 @@ Partial Class Inventarios_TrasladoSolicitud
'DdlProductoServicio.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
'DdlProductoServicio.DataBind()
'DdlProductoServicio.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
End Sub
#End Region
#Region " CARGA DATOS "
Private Sub CargaDatos()
Dim ObjInventarios As New ClsInventarios
@@ -158,7 +158,7 @@ Partial Class Inventarios_TrasladoSolicitud
LbFolio.Text = ObjInventarios.DtResultados.Rows(0)("FolioTraspaso").ToString
TxtObservaciones.Text = ObjInventarios.DtResultados.Rows(0)("ObservacionesTraspaso").ToString
TempDT = ObjInventarios.DtResultados
GvDatos.DataSource = ObjInventarios.DtResultados
GvDatos.DataBind()
@@ -178,6 +178,8 @@ Partial Class Inventarios_TrasladoSolicitud
HplContrato.Text = ObjInventarios.DtResultados.Rows(0)("DescripcionContrato").ToString
HplContrato.NavigateUrl = $"/Contratos/Contrato.aspx?CveContrato={ObjInventarios.DtResultados.Rows(0)("CveContrato").ToString.ToEntero}"
CveUsuarioSolicita = ObjInventarios.DtResultados.Rows(0)("CveUsuario").ToString.ToEntero
'25/04/2018
CveDireccionEnvio = ObjInventarios.DtResultados.Rows(0)("CveDireccionEnvio").ToString.ToEntero
If CveDireccionEnvio > 0 And ObjClientes.DireccionEnvioGet(CveDireccionEnvio, -1, -1) Then
@@ -269,6 +271,7 @@ Partial Class Inventarios_TrasladoSolicitud
LblEstatusAutorizo.Text = If(EstatusAlmacen = 2, "Aceptado", "Rechazado")
LblUsaurioAutorizo.Text = ObjInventarios.DtResultados.Rows(0)("NombreAutoriza").ToString()
LblFechaAutoriza.Text = ObjInventarios.DtResultados.Rows(0)("FechaAutorizacion").ToString().ToDate().ToString("dd/MM/yyyy")
GvDatos.Columns(6).Visible = False ' se oculta la columna de eliminar
End If
@@ -993,15 +996,85 @@ Partial Class Inventarios_TrasladoSolicitud
CargaDatos()
End Sub
Protected Sub LnkRechazarTraslado_Click(sender As Object, e As EventArgs)
TxtMotivoRechazo.Text = ""
UpModalRechazo.Update()
RegistraScript("$('#ModalRechazarTraslado').modal();")
End Sub
Protected Sub BtnModalRechazo_Click(sender As Object, e As EventArgs)
RechazarTraslado()
End Sub
Private Sub RechazarTraslado()
Dim ErrorProceso As Boolean = False
If TxtMotivoRechazo.Text.Trim.Length.ToEntero = 0 Then
Alert("El motivo de rechazo es necesario", TipoMensaje.MsgAdvertencia)
End If
Dim ObjInven As New ClsInventarios
If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 3, UsuarioActual.CveUsuario, Now) Then
Alert("Rechazado correctamente.")
ErrorProceso = False
Else
ErrorProceso = True
End If
ObjInven.Dispose()
CargaDatos()
If Not ErrorProceso Then
MandaCorreoRechazo(LbFolio.Text.ToEntero, CveTraspasoSolicitud, CveUsuarioSolicita, TxtMotivoRechazo.Text)
CargaDatos()
RegistraScript("$('#ModalRechazarTraslado').modal('hide');")
End If
End Sub
Private Sub MandaCorreoRechazo(Folio As Integer, CveTraspasoSolicitud As Integer, CveUsuarioSolicita As Integer, MotivoRechazo As String)
Dim SB As New StringBuilder
Dim CorreoDestino As String = GlobalDTUsuarios(CveUsuarioSolicita)(0)("Correo").ToString.Trim
If CorreoDestino.Length > 0 Then
SB.AppendLine($"<p>Se ha rechazado la solicitud de traspaso con folio {Folio}, el traspaso fue rechazado por el usuario {UsuarioActual.Nombre }, el traspaso fue rechazado por el motivo: {MotivoRechazo} </p>")
SB.AppendLine("<br>")
SB.AppendLine("<table border = '0'>")
SB.AppendLine("<tr style='color:white;background-color:#808080;' ><th>Cantidad</th> <th>U.M.</th> <th>Producto</th> <th>Observaciones</th> </tr>")
For Each GvRow As GridViewRow In GvDatos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
SB.AppendLine($"<tr style='background-color:#F2F2F0;'> <td>{GvRow.DataKey("Cantidad")}</td> <td>{GvRow.DataKey("UnidadMedida")}</td> <td>{GvRow.DataKey("CodigoPS")}</td> <td>{GvRow.DataKey("Observaciones")}</td> </tr>")
End If
Next
SB.AppendLine("</table>")
SB.AppendLine("<br>")
SB.AppendLine($"<strong> <a href='{Request.Url.GetLeftPart(UriPartial.Authority)}/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}'>Ir a solicitud de traspaso folio {Folio}</a></strong>")
Dim MandaCorre As New ClsSisMail
MandaCorre.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, $"Rechazo de Autorización de traspaso #{Folio}", SB.ToString, Displayname:="SIG Notificaciones: Rechazo de Traspaso")
End If
End Sub
@@ -1056,5 +1129,6 @@ Partial Class Inventarios_TrasladoSolicitud
Next
GvDatos.Columns(5).Visible = Mostrar
End Sub
End Class

View File

@@ -174,6 +174,8 @@
<label class="col-md-2">Chofer:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="Chofer" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-2">F. Entrega:</label>
<div class="col-md-2" style="padding-left: 5px; padding-top: 0px;">
@@ -196,15 +198,21 @@
</div>
<div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="Placa"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div id="divPlacaEspecificacion" runat="server">
<label class="col-md-2">Placa:</label>
<div class="col-md-2">
<asp:TextBox runat="server" Text="" ID="TxtPlaca" CssClass="form-control" />
<asp:RequiredFieldValidator ID="RfvTxtPlaca" runat="server" Enabled="false" ControlToValidate="TxtPlaca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Placa''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceTxtPlaca" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtPlaca" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-2">Especificación de la Unidad:</label>
<div class="col-md-2">
<asp:TextBox runat="server" Text="" ID="TxtEspecifUnidad" CssClass="form-control" />
<asp:RequiredFieldValidator ID="RfvTxtEspecifUnidad" runat="server" Enabled="false" ControlToValidate="TxtEspecifUnidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Especificación Unidad''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceTxtEspecifUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtEspecifUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
@@ -383,7 +391,7 @@
<th width="160px">Comandos</th>
</tr>
</thead>
</thea>
<tr>
<td></td>
<td align="center">
@@ -396,6 +404,8 @@
</td>
<td>
<asp:DropDownList ID="DdlUnidad" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me" Style="width: 85px !important;"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidad" runat="server" ControlToValidate="DdlUnidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: left;">
<asp:UpdatePanel runat="server">

View File

@@ -209,6 +209,14 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then
DivEmitirTimbrado.Visible = True
LblEmitirTimbrado.Visible = True
ChkEmitirTimbrado.Checked = True
Dim HabilitarValidators As Boolean = UsuarioActual.CveEmpresa.Contiene(119)
RfvDdlChofer.Enabled = HabilitarValidators
RfvDdlUnidadCamion.Enabled = HabilitarValidators
RfvTxtPlaca.Enabled = HabilitarValidators
RfvTxtEspecifUnidad.Enabled = HabilitarValidators
End If
CantidadTotal = 0
@@ -1448,6 +1456,8 @@ Partial Class Inventarios_TraspasoAlmacen
TxtResponsable.Text = ""
TxtGastoIndirecto.Text = ""
RegistraScript("$('#DivTransitorio').show(200);$('#DivGastoIndirecto').show(100);$('#DivDocChofer').show(100);")
ChkEmitirTimbrado.Checked = LblEmitirTimbrado.Visible
Else
RegistraScript("$('#DivTransitorio').hide(500);$('#DivGastoIndirecto').hide(500);$('#DivDocChofer').hide(500);")
End If

View File

@@ -2819,6 +2819,12 @@ Partial Class OC
If CvePrePoliza > 0 Then
If DdlSubProyecto.SelectedValue <= 0 Then
Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
TieneError = True
Exit For
End If
If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL()
ImporteMEComp = (DiferenciaInvOC - ImporteME).RoundSQL()
@@ -2834,8 +2840,6 @@ Partial Class OC
' Exit For
'End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
TieneError = True
Exit For

View File

@@ -2822,6 +2822,32 @@
</asp:GridView>
</div>
</div>
<div class="portlet box blue-hoki">
<div class="portlet-title">
<div class="caption ">
<i class="icon-user-following bold "></i>
<span class="caption-subject uppercase">Pagos no bancarios</span>
</div>
<div class="tools"><a href="javascript;" class="collapse" data-original-title="" title=""></a></div>
</div>
<div class="portlet-body ">
<asp:GridView ID="GvPagosNoBancarios" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron pagos no bancarios" Width="50%"
CssClass="table table-striped table-advance table-hover ScrollAD" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None" DataKeyNames="CvePrePoliza,CveCompra,CveVenta,CvePersonal,ImporteMN,VentaSerieFolio,CompraSerieFolio,NombreCompleto,FechaIng,Abreviatura">
<Columns>
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString = "{0:dd/MM/yyyy}"/>
<asp:HyperLinkField HeaderText="Venta Serie Folio" DataTextField="VentaSerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
<asp:HyperLinkField HeaderText="Compra Serie Folio" DataTextField="CompraSerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}"/>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlImp" runat="server" Text='<%# Eval("ImporteMN", "{0:N2}")%>'></asp:Literal>
<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="portlet box blue-hoki">
<div class="portlet-title">
<div class="caption ">

View File

@@ -1509,7 +1509,8 @@ Partial Class RH_Personal
'Carga Conceptos de Nómina
CarcaConceptosNomina()
'Carga Pagos no Bancarios
CargarPagosNoBancarios()
'Carga Resguardos
Dim ObjResguardos As New ClsAF
If ObjResguardos.GetActivosFijosResguardos(-1, -1, CvePersonal, -1) Then
@@ -6338,4 +6339,13 @@ Partial Class RH_Personal
End Sub
Private Sub CargarPagosNoBancarios()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetPagosNoBancarios(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
GvPagosNoBancarios.DataSource = ObjBancos.DtResultados
GvPagosNoBancarios.DataBind()
End If
ObjBancos.Dispose()
End Sub
End Class

View File

@@ -2396,6 +2396,54 @@
</div>
</div>
</div>
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Pagos no bancarios</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel10">
<ContentTemplate>
<asp:LinkButton ID="LnkPagosNoBancariosPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkPagosNoBancariosExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkPagosNoBancariosPDF" />
<asp:PostBackTrigger ControlID="LnkPagosNoBancariosExcel" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row col-md-12" align="right">
<input type="text" id="TxtBusquedaPagosNoBancarios" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="table-scrollable">
<asp:GridView ID="GvPagosNoBancarios" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron pagos no bancarios" Width="50%"
CssClass="table table-striped table-advance table-hover ScrollAD" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None" DataKeyNames="CvePrePoliza,CveCompra,CveVenta,CvePersonal,ImporteMN,VentaSerieFolio,CompraSerieFolio,NombreCompleto,FechaIng,Abreviatura">
<Columns>
<asp:BoundField HeaderText="Nombre Completo" DataField="NombreCompleto"/>
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}"/>
<asp:HyperLinkField HeaderText="Venta Serie Folio" DataTextField="VentaSerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}"/>
<asp:HyperLinkField HeaderText="Compra Serie Folio" DataTextField="CompraSerieFolio" DataNavigateUrlFields="CveCompra" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}"/>
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlImp" runat="server" Text='<%# Eval("ImporteMN", "{0:N2}")%>'></asp:Literal>
<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>

File diff suppressed because it is too large Load Diff

View File

@@ -2662,12 +2662,17 @@ Partial Class Ventas_ClientesAbonar
If tCveMoneda = 2 Then
Dim ImporteFluctuacion As Decimal = 0
ImporteFluctuacion = Saldo * (TCPago - TCVenta)
If CveSubProyecto <= 0 Then
MsgError = $"No se pudo obtener el sub proyecto de la venta {gr.DataKey("SerieFolio").ToString}"
End If
If TCPago > TCVenta Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If

View File

@@ -277,7 +277,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false)
{
Modelos.Factura.MCancelacionVentaMensaje retorno = null;
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa);
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:true);
if (EsRefacturacion)
{
retorno = factura.CancelarPorRefacturacion();

View File

@@ -119,7 +119,7 @@ Partial Class Ventas_RepRecuperacion
End If
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero,
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados

View File

@@ -21048,7 +21048,7 @@ Partial Class Ventas
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next
@@ -22843,12 +22843,55 @@ Partial Class Ventas
'codigo para ajuste de centavo, si el importe total no cuadra con los totales
Dim difTmp As Decimal = Importe - importeNC
'el ajuste procede si no tiene iva,ni ieps, con iva sin ieps,
If Math.Abs(difTmp) > 0.00D Then
'asusto la diferencia en el último concepto
Dim ImporteAjustado As Decimal = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString().ToDecimal + difTmp
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal") = ImporteAjustado
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImportePU") = ImporteAjustado
'filtro si hay renglon sin impuestos.
Dim drDIF As DataRow() = DtImpuestosLocal.Select("ImporteIVA = 0 AND ImporteIEPS = 0")
If drDIF IsNot Nothing AndAlso drDIF.Length > 0 Then
Dim ImporteAjustado0 As Decimal = drDIF(0)("ImporteTotal").ToString().ToDecimal + difTmp
drDIF(0)("ImporteTotal") = ImporteAjustado0
drDIF(0)("ImportePU") = ImporteAjustado0
Else
'filtro si hay renglon sin impuestos.
Dim drDIF2 As DataRow() = DtImpuestosLocal.Select("ImporteIVA > 0 AND ImporteIEPS = 0")
If drDIF2 IsNot Nothing AndAlso drDIF2.Length > 0 Then
Dim PorIVA As Decimal = drDIF2(0)("PorcentajeIVA").ToString().ToDecimal
Dim ImporteAjustado1 As Decimal = drDIF2(0)("ImporteTotal").ToString().ToDecimal + (difTmp / (1 + PorIVA)) 'saco el PU sin iva
drDIF2(0)("ImportePU") = ImporteAjustado1
drDIF2(0)("ImporteTotal") = ImporteAjustado1
drDIF2(0)("ImporteIVA") = (ImporteAjustado1) * drDIF2(0)("PorcentajeIVA").ToString().ToDecimal
Else
' ajustar cuando tiene ieps y no iva
Dim drDIF3 As DataRow() = DtImpuestosLocal.Select("ImporteIVA = 0 AND ImporteIEPS > 0")
If drDIF3 IsNot Nothing AndAlso drDIF3.Length > 0 Then
Dim PorIEPS As Decimal = drDIF3(0)("PorcentajeIEPS").ToString().ToDecimal
Dim ImporteAjustado1 As Decimal = drDIF3(0)("ImporteTotal").ToString().ToDecimal + (difTmp / (1 + PorIEPS)) 'saco el PU sin iva
drDIF3(0)("ImportePU") = ImporteAjustado1
drDIF3(0)("ImporteTotal") = ImporteAjustado1
drDIF3(0)("ImporteIEPS") = (ImporteAjustado1) * drDIF3(0)("PorcentajeIEPS").ToString().ToDecimal
Else
' ajustar cuando tiene ieps e iva
Dim drDIF4 As DataRow() = DtImpuestosLocal.Select("ImporteIVA > 0 AND ImporteIEPS > 0")
If drDIF4 IsNot Nothing AndAlso drDIF4.Length > 0 Then
Dim PorIEPS As Decimal = drDIF4(0)("PorcentajeIEPS").ToString().ToDecimal
Dim PorIVA As Decimal = drDIF4(0)("PorcentajeIVA").ToString().ToDecimal
Dim ImporteAntesIVA As Decimal = (difTmp / (1 + PorIVA))
Dim ImporteAjustado1 As Decimal = drDIF4(0)("ImporteTotal").ToString().ToDecimal + +(ImporteAntesIVA / (1 + PorIEPS)) 'saco el PU sin iva
drDIF4(0)("ImportePU") = ImporteAjustado1
drDIF4(0)("ImporteTotal") = ImporteAjustado1
drDIF4(0)("ImporteIEPS") = (ImporteAjustado1) * drDIF4(0)("PorcentajeIEPS").ToString().ToDecimal
drDIF4(0)("ImporteIVA") = (ImporteAjustado1 + drDIF4(0)("ImporteIEPS").ToString.ToDecimal) * drDIF4(0)("PorcentajeIVA").ToString().ToDecimal
End If
End If
End If
End If
End If
If Not NCDescuento Then