This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-04-01 21:24:32 -07:00
7 changed files with 1254 additions and 1166 deletions

View File

@@ -5961,6 +5961,31 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function CierreEjercicio(CveEmpresa As Integer, Ejercicio As Integer, CveCuentaCierre As Integer, FechaI As String, FechaF As String, CveUsuario As Integer) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Conta_CierreEjercicio")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
.Add("@CveCuentaCierre", SqlDbType.Int).Value = CveCuentaCierre
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CvePrePoliza", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrePoliza").Value.ToString.ToEntero
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar el catálogo de Conta Ejercicios", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#Region " RECONSTRUCCION DE PREPOLIZAS " #Region " RECONSTRUCCION DE PREPOLIZAS "
Public Function ReconstruirPP_PagoCompra(CvePrePoliza As Integer) As Boolean Public Function ReconstruirPP_PagoCompra(CvePrePoliza As Integer) As Boolean
Dim Retorno = False Dim Retorno = False

View File

@@ -2986,8 +2986,6 @@ Namespace Modelos
If ObjConta.DtResultados.Rows.Count > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then
'Conta ContPAQ 'Conta ContPAQ
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
'Conta SIG
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero
End If End If
End If End If

View File

@@ -1295,80 +1295,83 @@ Partial Class Compras_Compras
ViewState("CveFactura") = Request("CveFactura").ToEntero ViewState("CveFactura") = Request("CveFactura").ToEntero
Dim RFC As String = CargaFactura(CveFactura) Dim RFC As String = CargaFactura(CveFactura)
DdlProveedor.Visible = False If RFC.Trim <> String.Empty Then
HplProveedor.Visible = True DdlProveedor.Visible = False
GvInv.Visible = True HplProveedor.Visible = True
CargaProveedor(-1, RFC) GvInv.Visible = True
CargaProveedor(-1, RFC)
If Not DdlTipoComprobante.SelectedValue = "NC" Then If Not DdlTipoComprobante.SelectedValue = "NC" Then
If UsuarioActual.Empresa.Funcionalidad(128) = "1" And Not UsuarioActual.TienePermisoProceso(213) Then If UsuarioActual.Empresa.Funcionalidad(128) = "1" And Not UsuarioActual.TienePermisoProceso(213) Then
If TmpDT.MAX("CvePS").ToEntero > 0 Then If TmpDT.MAX("CvePS").ToEntero > 0 Then
BtnGuardar.Enabled = False BtnGuardar.Enabled = False
RegistraScript("$('#ImgBtnBuscarOC').click()") RegistraScript("$('#ImgBtnBuscarOC').click()")
End If
End If
End If
If DdlTipoComprobante.SelectedValue = "NC" Then
paneldevolucion.Visible = True
Pnlalmaceninventarios.Visible = False
cargaddldevoluciones(CveProveedor, TxtSubTotal.Text.ToDouble)
InicializaAplicaNCFact()
DivReembolso.Visible = False
RBLPago.Items(2).Enabled = False
End If
If UsuarioActual.Empresa.UsaAC Then
CambiaEjercicioAC()
End If
' ''Fecha limite para ingreso de facturas
''Dim DtEmpresa As DataTable = GlobalDTEmpresas(UsuarioActual.CveEmpresa)
''If DtEmpresa.Rows.Count > 0 Then
'' Dim FechaLimite = DateSerial(DtEmpresa.Rows(0)("EjercicioActual").ToString.ToEntero, DtEmpresa.Rows(0)("PeriodoActual").ToString.ToEntero, DtEmpresa.Rows(0)("DiasPermitidos").ToString.ToEntero)
'' If Month(TxtFecha.Text.ToDate) < (Month(FechaLimite) - 1) Or (Month(TxtFecha.Text.ToDate) = (Month(FechaLimite) - 1) And Day(Date.Now) > Day(FechaLimite)) Then
'' Alert("La factura actual ya no aplica para ingresarse al sístema.", TipoMensaje.MsgAdvertencia)
'' BtnGuardar.Enabled = False
'' Else
'' Alert("En tiempo")
'' End If
''Else
'' Alert("No se pudieron cargar los datos de la empresa", TipoMensaje.MsgAdvertencia)
''End If
'Carga Compra
If UsuarioActual.Empresa.Funcionalidad(123).ToEntero > 0 And Not UsuarioActual.TienePermisoProceso(156) Then
If Not ValidaCierrePeriodo() Then
Alert("El periodo de la compra actual ya se encuentra cerrado. No podra registrar la compra.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False
TxtOC.Enabled = False
ImgBtnBuscarOC.Enabled = False
CierrePeriodo = True
DivRestriccionAdvertencia.Visible = True
LtRestriccionAdvertencia.Text = "El periodo de la compra actual ya se encuentra cerrado."
End If
End If
Dim HayDifIEPS As Boolean = False
For Each Gvr As GridViewRow In GvPS.Rows
If Gvr.DataKey("CvePS").ToEntero > 0 AndAlso Gvr.DataKey("IEPSPSPorcentaje").ToDouble > 0 Then
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Gvr.DataKey("CvePS").ToEntero).Rows.Count > 0 Then
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Gvr.DataKey("CvePS").ToEntero).Rows(0)
If DrPS IsNot Nothing Then
If DrPS("IEPSPorcentaje").ToString.ToDouble <> Gvr.DataKey("IEPSPSPorcentaje").ToDouble Then
HayDifIEPS = True
End If
End If End If
End If End If
End If End If
Next
If HayDifIEPS Then Alert("El porcentaje de IEPS del producto no coincide con el especificado.", TipoMensaje.MsgAdvertencia) If DdlTipoComprobante.SelectedValue = "NC" Then
paneldevolucion.Visible = True
Pnlalmaceninventarios.Visible = False
cargaddldevoluciones(CveProveedor, TxtSubTotal.Text.ToDouble)
InicializaAplicaNCFact()
DivReembolso.Visible = False
RBLPago.Items(2).Enabled = False
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero) End If
If UsuarioActual.Empresa.UsaAC Then
CambiaEjercicioAC()
End If
' ''Fecha limite para ingreso de facturas
''Dim DtEmpresa As DataTable = GlobalDTEmpresas(UsuarioActual.CveEmpresa)
''If DtEmpresa.Rows.Count > 0 Then
'' Dim FechaLimite = DateSerial(DtEmpresa.Rows(0)("EjercicioActual").ToString.ToEntero, DtEmpresa.Rows(0)("PeriodoActual").ToString.ToEntero, DtEmpresa.Rows(0)("DiasPermitidos").ToString.ToEntero)
'' If Month(TxtFecha.Text.ToDate) < (Month(FechaLimite) - 1) Or (Month(TxtFecha.Text.ToDate) = (Month(FechaLimite) - 1) And Day(Date.Now) > Day(FechaLimite)) Then
'' Alert("La factura actual ya no aplica para ingresarse al sístema.", TipoMensaje.MsgAdvertencia)
'' BtnGuardar.Enabled = False
'' Else
'' Alert("En tiempo")
'' End If
''Else
'' Alert("No se pudieron cargar los datos de la empresa", TipoMensaje.MsgAdvertencia)
''End If
'Carga Compra
If UsuarioActual.Empresa.Funcionalidad(123).ToEntero > 0 And Not UsuarioActual.TienePermisoProceso(156) Then
If Not ValidaCierrePeriodo() Then
Alert("El periodo de la compra actual ya se encuentra cerrado. No podra registrar la compra.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Visible = False
TxtOC.Enabled = False
ImgBtnBuscarOC.Enabled = False
CierrePeriodo = True
DivRestriccionAdvertencia.Visible = True
LtRestriccionAdvertencia.Text = "El periodo de la compra actual ya se encuentra cerrado."
End If
End If
Dim HayDifIEPS As Boolean = False
For Each Gvr As GridViewRow In GvPS.Rows
If Gvr.DataKey("CvePS").ToEntero > 0 AndAlso Gvr.DataKey("IEPSPSPorcentaje").ToDouble > 0 Then
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Gvr.DataKey("CvePS").ToEntero).Rows.Count > 0 Then
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Gvr.DataKey("CvePS").ToEntero).Rows(0)
If DrPS IsNot Nothing Then
If DrPS("IEPSPorcentaje").ToString.ToDouble <> Gvr.DataKey("IEPSPSPorcentaje").ToDouble Then
HayDifIEPS = True
End If
End If
End If
End If
Next
If HayDifIEPS Then Alert("El porcentaje de IEPS del producto no coincide con el especificado.", TipoMensaje.MsgAdvertencia)
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then CargaGastosServicios(UsuarioActual.Empresa.Funcionalidad(562).ToEntero)
End If
ElseIf Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then ElseIf Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then
@@ -1741,10 +1744,14 @@ Partial Class Compras_Compras
XMLDoc.Load(Archivo) XMLDoc.Load(Archivo)
Catch ex As Exception Catch ex As Exception
Try
Dim oReader = New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
XMLDoc.Load(oReader)
oReader.Dispose()
Catch ex2 As Exception
GuardaLog("Error al intentar leer el XML del SAT. Error:" & ex2.ToString())
End Try
Dim oReader = New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
XMLDoc.Load(oReader)
oReader.Dispose()
End Try End Try
@@ -2083,19 +2090,22 @@ Partial Class Compras_Compras
ObjeFacturas.Dispose() ObjeFacturas.Dispose()
Dim ObjSAT As New ClsSAT If RFC <> "" Then
Dim RFCRequest As String = Request("RFC").ToString Dim ObjSAT As New ClsSAT
If ObjSAT.GetListado69B(2, UsuarioActual.CveEmpresa, RFCRequest) Then
If ObjSAT.DtResultados.Rows.Count > 0 Then
Dim Estatus As String = ObjSAT.DtResultados.Rows(0)("Situacion").ToString
BtnGuardar.Enabled = False
UpParametros.Update()
Alert($"El RFC del proveedor se encuentra en estado <b>{Estatus}</b> en el Listado EFOS (69B) del SAT", TipoMensaje.MsgAdvertencia) If ObjSAT.GetListado69B(2, UsuarioActual.CveEmpresa, RFC) Then
System.Threading.Thread.Sleep(5) If ObjSAT.DtResultados.Rows.Count > 0 Then
Dim Estatus As String = ObjSAT.DtResultados.Rows(0)("Situacion").ToString
BtnGuardar.Enabled = False
UpParametros.Update()
Alert($"El RFC del proveedor se encuentra en estado <b>{Estatus}</b> en el Listado EFOS (69B) del SAT", TipoMensaje.MsgAdvertencia)
System.Threading.Thread.Sleep(5)
End If
End If End If
ObjSAT.Dispose()
End If End If
ObjSAT.Dispose()
Return RFC Return RFC
@@ -2942,9 +2952,10 @@ Partial Class Compras_Compras
'TIENE AMORTIZACIÓN 'TIENE AMORTIZACIÓN
If GvAnticiposSel.Rows.Count > 0 Then If GvAnticiposSel.Rows.Count > 0 Then
BtnEliminarCompra.Visible = False
If Not DdlTipoComprobante.SelectedValue.Contiene("NC") Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC") Then
BtnCancelarCompra.Visible = False BtnCancelarCompra.Visible = False
BtnEliminarCompra.Visible = False
End If End If
End If End If
@@ -5074,8 +5085,8 @@ Partial Class Compras_Compras
For Each dr As DataRow In DtInv.Rows For Each dr As DataRow In DtInv.Rows
If dr("cvealmacen").ToString.ToEntero = tcvealmacen Then If dr("cvealmacen").ToString.ToEntero = tcvealmacen Then
'hay que restarle descuento
importeconcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, dr("pu").ToString.ToDouble, dr("pu").ToString.ToDouble * TipoCambioGuardar) importeconcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, dr("pu").ToString.ToDouble, dr("pu").ToString.ToDouble * TipoCambioGuardar) - (If(DdlMoneda.SelectedValue.ToEntero = 1, dr("descuento").ToString.ToDouble, dr("descuento").ToString.ToDouble * TipoCambioGuardar) / dr("cantidad").ToString.ToDouble)
If Not ObjInventario.AddMovimientoDetalle(cvemovimientoentrada, dr("cantidad").ToString.ToDouble, dr("cveum").ToString.ToEntero, dr("cveps").ToString.ToEntero, importeconcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, dr("pu").ToString.ToDouble), CveCompraDetalle:=dr("CveCompraDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(cvemovimientoentrada, dr("cantidad").ToString.ToDouble, dr("cveum").ToString.ToEntero, dr("cveps").ToString.ToEntero, importeconcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, dr("pu").ToString.ToDouble), CveCompraDetalle:=dr("CveCompraDetalle").ToString.ToEntero) Then
ErrorMovInv = True ErrorMovInv = True
@@ -5158,6 +5169,7 @@ Partial Class Compras_Compras
Dim PUInv As Double Dim PUInv As Double
Dim CveUnidad As Integer Dim CveUnidad As Integer
Dim CostoIndirecto As Double Dim CostoIndirecto As Double
Dim tDescuento As Decimal = 0
ListaMovimientosAlmacen.Add(CveMovimientoInventario) ListaMovimientosAlmacen.Add(CveMovimientoInventario)
@@ -5168,6 +5180,7 @@ Partial Class Compras_Compras
CveUnidad = Dr("CveUM").ToString.ToEntero CveUnidad = Dr("CveUM").ToString.ToEntero
CantidadInv = Dr("Cantidad").ToString.ToDouble CantidadInv = Dr("Cantidad").ToString.ToDouble
PUInv = Dr("PU").ToString.ToDouble PUInv = Dr("PU").ToString.ToDouble
tDescuento = Dr("Descuento").ToString.ToDecimal / CantidadInv.ToDecimal
CostoIndirecto = Dr("CostoIndirectoAlmacen").ToString.ToDouble CostoIndirecto = Dr("CostoIndirectoAlmacen").ToString.ToDouble
If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then If Dr("CveMetodoInventario").ToString.ToEntero = 5 Then
@@ -5202,7 +5215,7 @@ Partial Class Compras_Compras
End If End If
'si no es por serie lote 'si no es por serie lote
ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) ImporteConcepto = If(DdlMoneda.SelectedValue.ToEntero = 1, PUInv, PUInv * TipoCambioGuardar) - If(DdlMoneda.SelectedValue.ToEntero = 1, tDescuento, tDescuento * TipoCambioGuardar)
ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto) ImporteConcepto = If(UsuarioActual.Empresa.UsaAC, ImporteConcepto * IVA, ImporteConcepto)
If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then If Dr("CveAlmacen").ToString.ToEntero = tCveAlmacen Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDouble), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, CantidadInv, CveUnidad, Dr("CvePS").ToString.ToEntero, ImporteConcepto, -1, PUTC:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, Dr("PU").ToString.ToDouble), CostoIndirecto:=CostoIndirecto, CveCompraDetalle:=Dr("CveCompraDetalle").ToString.ToEntero, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then

View File

@@ -24,7 +24,7 @@
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView runat="server" ID="GvDatos" EmptyDataText="No se encontraron Motivo de Baja Registrados" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover ScrollAD" <asp:GridView runat="server" ID="GvDatos" EmptyDataText="No se encontraron Motivo de Baja Registrados" ToolTip="Listado de Motivo de Baja" CssClass="table table-striped table-advance table-hover ScrollAD"
DataKeyNames="CveEjercicio,Ejercicio,PeriodoActual,CuentaNombre,PolizoFolio,PrePolizaCierreFolio,Estatus" AutoGenerateColumns="False" DataKeyNames="CveEjercicio,Ejercicio,PeriodoActualNumero,CuentaNombre,CveCuentaCierre,PolizoFolio,PrePolizaCierreFolio,Estatus" AutoGenerateColumns="False"
Style="text-align: center; width: 100%" GridLines="None"> Style="text-align: center; width: 100%" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="Ejercicio" HeaderText="Ejercicio" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Ejercicio" HeaderText="Ejercicio" ItemStyle-HorizontalAlign="Left" />
@@ -33,12 +33,17 @@
<asp:BoundField DataField="PolizoFolio" HeaderText="Póliza Folio" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="PolizoFolio" HeaderText="Póliza Folio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="PrePolizaCierreFolio" HeaderText="PrePóliza Cierre Folio" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="PrePolizaCierreFolio" HeaderText="PrePóliza Cierre Folio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-Width="99px"> <asp:TemplateField ItemStyle-Width="80px">
<ItemTemplate>
<asp:LinkButton ID="ImgC" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="PolizaCierre" CssClass="btn btn-circle btn-sm blue" Text="<i class='glyphicon glyphicon-ok'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="80px">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaModulo" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaModulo" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="83px"> <asp:TemplateField ItemStyle-Width="80px">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="ImgEE" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="EliminarRow" 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" /> <asp:LinkButton ID="ImgEE" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="EliminarRow" 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" />
</ItemTemplate> </ItemTemplate>
@@ -60,14 +65,33 @@
</h4> </h4>
</div> </div>
<div class="modal-body" style="text-align: left"> <div class="modal-body" style="text-align: left">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlCuentas" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveCuenta" DataTextField="CtaCodigo" Style="width: 50%">
</asp:DropDownList>
<label for="<%= DdlCuentas.ClientID.ToString()%>">Periodo Actual:</label>
</div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEjercicio" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true" Style="width: 100%"></asp:TextBox> <asp:TextBox ID="TxtEjercicio" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true" Style="width: 100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVClave" runat="server" ControlToValidate="TxtEjercicio" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Ejercicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModulo"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVClave" runat="server" ControlToValidate="TxtEjercicio" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Ejercicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModulo"></asp:RequiredFieldValidator>
<label for="<%= TxtEjercicio.ClientID.ToString()%>">Ejercicio:</label> <label for="<%= TxtEjercicio.ClientID.ToString()%>">Ejercicio:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkPeriodoActual" runat="server" data-toggle="toggle"/> <asp:DropDownList ID="DdlPeriodoActual" runat="server" CssClass="form-control input-sm select2me" Style="width: 50%">
<label for="<%= ChkPeriodoActual.ClientID.ToString()%>">Periodo Actual:</label> <asp:ListItem Value="0" Text="seleccione"/>
<asp:ListItem Value="1" Text="Enero"/>
<asp:ListItem Value="2" Text="Febrero"/>
<asp:ListItem Value="3" Text="Marzo"/>
<asp:ListItem Value="4" Text="Abril"/>
<asp:ListItem Value="5" Text="Mayo"/>
<asp:ListItem Value="6" Text="Junio"/>
<asp:ListItem Value="7" Text="Julio"/>
<asp:ListItem Value="8" Text="Agosto"/>
<asp:ListItem Value="9" Text="Septiembre"/>
<asp:ListItem Value="10" Text="Octubre"/>
<asp:ListItem Value="11" Text="Noviembre"/>
<asp:ListItem Value="12" Text="Diciembre"/>
</asp:DropDownList>
<label for="<%= DdlPeriodoActual.ClientID.ToString()%>">Periodo Actual:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkEstatus" runat="server" data-toggle="toggle"/> <asp:CheckBox ID="ChkEstatus" runat="server" data-toggle="toggle"/>

View File

@@ -25,14 +25,20 @@ Partial Class Contabilidad2_CatContaEjercicios
If ObjConta.GetContaEjercicio(UsuarioActual.CveEmpresa) Then If ObjConta.GetContaEjercicio(UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjConta.DtResultados GvDatos.DataSource = ObjConta.DtResultados
End If End If
If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DdlCuentas.DataSource = ObjConta.DtResultados
End If
ObjConta.Dispose() ObjConta.Dispose()
GvDatos.DataBind() GvDatos.DataBind()
DdlCuentas.DataBind()
DdlCuentas.Items.Insert(0, New ListItem("seleccione", "-1"))
End Sub End Sub
Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click
TxtEjercicio.Text = "" TxtEjercicio.Text = ""
ChkEstatus.Checked = 0 ChkEstatus.Checked = 0
ChkPeriodoActual.Checked = 0 DdlPeriodoActual.SelectedValue = 0
UpModalModulos.Update() UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();") RegistraScript("$('#ModalCat').modal();")
End Sub End Sub
@@ -42,12 +48,12 @@ Partial Class Contabilidad2_CatContaEjercicios
Dim errorString As String = "" Dim errorString As String = ""
If LbAgregar.Text = "Agregar" Then If LbAgregar.Text = "Agregar" Then
If Not ObjConta.AddContaEjercicio(DateTime.Today, UsuarioActual.CvePersonal, UsuarioActual.CveEmpresa, Ejercicio:=TxtEjercicio.Text, If Not ObjConta.AddContaEjercicio(DateTime.Today, UsuarioActual.CvePersonal, UsuarioActual.CveEmpresa, Ejercicio:=TxtEjercicio.Text,
PeriodoActual:=If(ChkPeriodoActual.Checked, 1, 0), Estatus:=ChkEstatus.Checked) Then PeriodoActual:=DdlPeriodoActual.SelectedValue.ToEntero, CveCuentaCierre:=DdlCuentas.SelectedValue.ToEntero, Estatus:=ChkEstatus.Checked) Then
errorString = "Error al agregar" errorString = "Error al agregar"
End If End If
ElseIf LbAgregar.Text = "Actualizar" Then ElseIf LbAgregar.Text = "Actualizar" Then
If Not ObjConta.UpdateContaEjercicio(CveEjercicio, Ejercicio:=TxtEjercicio.Text, If Not ObjConta.UpdateContaEjercicio(CveEjercicio, Ejercicio:=TxtEjercicio.Text, PeriodoActual:=DdlPeriodoActual.SelectedValue.ToEntero,
PeriodoActual:=If(ChkPeriodoActual.Checked, 1, 0), Estatus:=ChkEstatus.Checked) Then CveCuentaCierre:=DdlCuentas.SelectedValue.ToEntero, Estatus:=ChkEstatus.Checked) Then
errorString = "Error al actualizar" errorString = "Error al actualizar"
End If End If
End If End If
@@ -71,7 +77,8 @@ Partial Class Contabilidad2_CatContaEjercicios
CveEjercicio = GvRow.DataKey("CveEjercicio").ToEntero CveEjercicio = GvRow.DataKey("CveEjercicio").ToEntero
TxtEjercicio.Text = GvRow.DataKey("Ejercicio") TxtEjercicio.Text = GvRow.DataKey("Ejercicio")
ChkEstatus.Checked = GvRow.DataKey("Estatus") ChkEstatus.Checked = GvRow.DataKey("Estatus")
ChkPeriodoActual.Checked = If(GvRow.DataKey("PeriodoActual").ToEntero > 0, True, False) DdlPeriodoActual.SelectedValue = GvRow.DataKey("PeriodoActualNumero")
DdlCuentas.SelectedValue = GvRow.DataKey("CveCuentaCierre")
LbAgregar.Text = "Actualizar" LbAgregar.Text = "Actualizar"
UpModalModulos.Update() UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();") RegistraScript("$('#ModalCat').modal();")
@@ -87,4 +94,20 @@ Partial Class Contabilidad2_CatContaEjercicios
CargaDatos() CargaDatos()
UpDatos.Update() UpDatos.Update()
End Sub End Sub
Protected Sub PolizaCierre(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim ObjConta As New ClsContabilidad
Dim FechaI As String = $"01/01/{DateTime.Now.Year}"
Dim FechaF As String = $"{DateTime.DaysInMonth(DateTime.Now.Year, 12)}/12/{DateTime.Now.Year}"
Dim CvePrePolizaCierre As Integer = -1
CvePrePolizaCierre = ObjConta.CierreEjercicio(UsuarioActual.CveEmpresa, GvRow.DataKey("Ejercicio").ToEntero, GvRow.DataKey("CveCuentaCierre").ToEntero, FechaI, FechaF, UsuarioActual.CvePersonal)
If CvePrePolizaCierre > 0 Then
If ObjConta.UpdateContaEjercicio(CveEjercicio, Ejercicio:=GvRow.DataKey("Ejercicio").ToEntero, PeriodoActual:=GvRow.DataKey("PeriodoActualNumero").ToEntero,
CveCuentaCierre:=GvRow.DataKey("CveCuentaCierre").ToEntero, CvePrePoliza:=CvePrePolizaCierre, Estatus:=GvRow.DataKey("Estatus")) Then
Alert("Cierre de ejercicio correcto")
End If
End If
ObjConta.Dispose()
End Sub
End Class End Class

View File

@@ -55,8 +55,7 @@ Partial Class Inicio
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
'Hola caudillo
'Dim obj2 As Object() = CType(obj.[GetType]().GetField("_caches", Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance).GetValue(obj), Object())
If Not IsNothing(Request("logout")) AndAlso Request("logout").ToString() = "1" Then If Not IsNothing(Request("logout")) AndAlso Request("logout").ToString() = "1" Then
Usuario.CerrarSession() Usuario.CerrarSession()
Exit Sub Exit Sub

View File

@@ -22252,7 +22252,13 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
LBAplicaDevolucion.Visible = True
If VentaSaldoAlmacen < 0 Then
LBAplicaDevolucion.Visible = True
ElseIf VentaSaldoAlmacen >= 0 Then
LBAplicaDevolucion.Visible = False
End If
Dim SeEsconde As Boolean = False Dim SeEsconde As Boolean = False
If DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then If DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then