-- mejora
This commit is contained in:
@@ -153,9 +153,9 @@
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvESC" runat="server" DataKeyNames="CveIE, Saldo, CveMoneda, CveConceptoContable, CveProveedor, CvePersonal,CveSubProyecto" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros de Egresos sin Comprobar de Proveedores" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
|
||||
<asp:GridView ID="GvESC" runat="server" DataKeyNames="CveIE, Saldo, CveMoneda, CveConceptoContable, CveProveedor, CvePersonal,CveSubProyecto,Folio" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros de Egresos sin Comprobar de Proveedores" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="10%">
|
||||
<asp:TemplateField ItemStyle-Width="5%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chk" Checked="false" Visible="false" runat="server" />
|
||||
<asp:Literal ID="LtlTip" runat="server" Text='<%# Eval("ConceptoTexto") %>' ></asp:Literal>
|
||||
@@ -166,32 +166,28 @@
|
||||
<asp:HyperLink ID="Hpl" runat="server" NavigateUrl='<%# String.Format("/Compras/Proveedores.aspx?CveProveedor={0}&Opt=3", Eval("CveProveedor"))%>' Text='<%# Eval("RazonSocial") %>'></asp:HyperLink>
|
||||
<asp:Literal Text='<%# Eval("Moneda")%>' ID="LtMoneda" runat="server" Visible="false" />
|
||||
</ItemTemplate>
|
||||
<ControlStyle CssClass="Texto" />
|
||||
<ItemStyle HorizontalAlign="Left" Width="250px" />
|
||||
<ControlStyle CssClass="Texto" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LitFechaDocumento" runat="server" Text='<%# Bind("FechaDocumento", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="25px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LitImporte" runat="server" Text='<%# Bind("Importe", "{0:N2}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="25px" HorizontalAlign="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Tipo Transacción">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LitTipoTransaccion" runat="server" Text='<%# Bind("TipoTransaccion")%>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="125px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Folio">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLFolio" runat="server" Target="_blank" Text='<%# Bind("Folio")%>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="75px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Saldo" ItemStyle-CssClass="fixMargin">
|
||||
<ItemTemplate>
|
||||
@@ -199,7 +195,7 @@
|
||||
<asp:Literal runat="server" Text=" "></asp:Literal>
|
||||
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="65px" Font-Bold="True" HorizontalAlign="Right" />
|
||||
<ItemStyle Font-Bold="True" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
|
||||
@@ -202,76 +202,86 @@ Partial Class Bancos_RepEgresosSinComprobante
|
||||
Dim CvePrePoliza As Integer = 0
|
||||
Dim MsgError As String = ""
|
||||
Try
|
||||
Dim Contador As Integer = 0
|
||||
For Each gr As GridViewRow In GvESC.Rows
|
||||
If gr.FCCheckBox("Chk").Checked Then
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim TipoMovtoOtIngresos As Boolean = False
|
||||
Dim TipoMovtoConcepto As Boolean = True
|
||||
Dim CveConceptoContable As Integer
|
||||
|
||||
Select Case gr.DataKey("CveConceptoContable").ToEntero
|
||||
Case 10
|
||||
CveConceptoContable = 21
|
||||
Case 28
|
||||
CveConceptoContable = 29
|
||||
TipoMovtoOtIngresos = False
|
||||
TipoMovtoConcepto = True
|
||||
Case 37
|
||||
CveConceptoContable = 43
|
||||
Case 42
|
||||
CveConceptoContable = 41
|
||||
Case 43
|
||||
CveConceptoContable = 37
|
||||
End Select
|
||||
|
||||
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, gr.DataKey("CveProveedor").ToEntero, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjProveedor.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjProveedor.IdCtaContProveedores
|
||||
End If
|
||||
End If
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now,
|
||||
"Saldo de ExC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, gr.DataKey("Saldo").ToDecimal, "", CveConceptoContable, "Saldo de ExC por Sistema", Now, IdCtaContable, -1,
|
||||
gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero,
|
||||
ImporteMX:=gr.DataKey("Saldo").ToDecimal, Contabilizable:=EsContabilizable) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOtIngresos, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de ExC por Sistema", Now, UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, gr.DataKey("CveIE").ToEntero,
|
||||
ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, Contabilizable:=EsContabilizable) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
Contador += 1
|
||||
End If
|
||||
Next
|
||||
|
||||
If Contador > 0 Then
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, 0, 0, 1, Now,
|
||||
"Saldo de Egresos por comprobar", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
For Each gr As GridViewRow In GvESC.Rows
|
||||
If gr.FCCheckBox("Chk").Checked Then
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim TipoMovtoOtIngresos As Boolean = False
|
||||
Dim TipoMovtoConcepto As Boolean = True
|
||||
Dim CveConceptoContable As Integer
|
||||
|
||||
Select Case gr.DataKey("CveConceptoContable").ToEntero
|
||||
Case 10
|
||||
CveConceptoContable = 21
|
||||
Case 28
|
||||
CveConceptoContable = 29
|
||||
TipoMovtoOtIngresos = False
|
||||
TipoMovtoConcepto = True
|
||||
Case 37
|
||||
CveConceptoContable = 43
|
||||
Case 42
|
||||
CveConceptoContable = 41
|
||||
Case 43
|
||||
CveConceptoContable = 37
|
||||
Case 48
|
||||
CveConceptoContable = 56
|
||||
End Select
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Folio"), CveConceptoContable, "Saldo de ExC por Sistema", Now, IdCtaContable, -1,
|
||||
gr.DataKey("CveIE").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CvePersonal:=gr.DataKey("CvePersonal").ToEntero,
|
||||
ImporteMX:=gr.DataKey("Saldo").ToDecimal, Contabilizable:=EsContabilizable) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOtIngresos, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Folio"), 211, "Saldo de ExC por Sistema", Now, UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, gr.DataKey("CveIE").ToEntero,
|
||||
ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, Contabilizable:=EsContabilizable) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
Alert("No se especificaron")
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgError = "Ocurrió un error al generar la prepoliza"
|
||||
OnError(MsgError, ex)
|
||||
End Try
|
||||
|
||||
|
||||
If MsgError = "" Then
|
||||
If MsgError = "" Then
|
||||
LnkSaldar.Visible = False
|
||||
LnkHabilitarSaldar.Visible = True
|
||||
ObjConta.Commit()
|
||||
CargaDatos()
|
||||
Alert("Los movimientos se saldaron correctamente.")
|
||||
CargaDatos()
|
||||
Alert(String.Format("Los movimientos se saldaron correctamente <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}' class='Texto'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
|
||||
Else
|
||||
ObjConta.RollBack()
|
||||
Alert(MsgError, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
LnkSaldar.Visible = False
|
||||
LnkHabilitarSaldar.Visible = True
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
ObjConta.Dispose()
|
||||
ObjProveedor.Dispose()
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user