Otros Egresos, 119 seleccion de personal

This commit is contained in:
Oscar Irigoyen
2023-05-29 14:09:54 -07:00
parent d0fb221126
commit c159c7409a
2 changed files with 79 additions and 294 deletions

View File

@@ -100,10 +100,12 @@
<div class="col-md-8"> <div class="col-md-8">
<%--<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" /> <%--<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" />
<asp:Button ID="BtnBuscarProveedor" runat="server" ClientIDMode="Static" Text="Buscar Proveedor" Style="display: none;" class="btn btn-primary" /> <asp:Button ID="BtnBuscarProveedor" runat="server" ClientIDMode="Static" Text="Buscar Proveedor" Style="display: none;" class="btn btn-primary" />
<asp:TextBox ID="TxtPagueseA" CssClass="form-control input-sm" runat="server" MaxLength="70" Width="394px"></asp:TextBox>
<a ID="HplBuscar" class="btn btn-primary" runat="server" onclick="javascript:AbrirVentana('/Compras/PopUpBuscarProveedor.aspx?Opt=Poliza', 800, 547, 'N', 'PopUpBuscar')" ><i class="fa fa-search"></i> Buscar</a>--%> <a ID="HplBuscar" class="btn btn-primary" runat="server" onclick="javascript:AbrirVentana('/Compras/PopUpBuscarProveedor.aspx?Opt=Poliza', 800, 547, 'N', 'PopUpBuscar')" ><i class="fa fa-search"></i> Buscar</a>--%>
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 100%;" DataTextField="RazonSocial" DataValueField="CveProveedor" Visible="true" ></ADS:Dropdownlost>
<asp:DropDownList ID="DdlPersonal" runat="server" AppendDataBoundItems="true" DataTextField="NombreCompletoNombre" DataValueField="CvePersonal" CssClass="form-control input-sm input-medium select2me" Visible="false" Width="100%" ></asp:DropDownList> <asp:TextBox ID="TxtPagueseA" CssClass="form-control input-sm" runat="server" MaxLength="70" Width="394px" > </asp:TextBox>
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 394px;" DataTextField="RazonSocial" DataValueField="CveProveedor" Visible="true" Onselectedindexchange="DdlProveedores_selectedindexchange" ></ADS:Dropdownlost>
<asp:DropDownList ID="DdlPersonal" runat="server" AppendDataBoundItems="true" DataTextField="NombreCompletoNombre" DataValueField="CvePersonal" CssClass="form-control input-sm input-medium select2me" Visible="false" Width="394px" AutoPostBack="true" OnSelectedIndexChanged="DdlPersonal_SelectedIndexChanged" ></asp:DropDownList>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">

View File

@@ -8,7 +8,6 @@ Imports Stimulsoft.Report.BarCodes
Partial Class Bancos_PolizaCheque Partial Class Bancos_PolizaCheque
Inherits ClsPaginas Inherits ClsPaginas
' Private Shared missing As Object = System.Reflection.Missing.Value
#Region "Propiedades" #Region "Propiedades"
Private Property NombreArchivo As String Private Property NombreArchivo As String
@@ -188,10 +187,9 @@ Partial Class Bancos_PolizaCheque
DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "36")) DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "36"))
DdlPlantilla.SelectedValue = "36" DdlPlantilla.SelectedValue = "36"
DdlPlantilla.Enabled = False DdlPlantilla.Enabled = False
End If End If
''DdlProveedores.txtText.Value = ""
DdlProveedores.txtText.Value = "Seleccione un proveedor" DdlProveedores.txtText.Value = "Seleccione un proveedor"
DdlProveedores.txtValue.Value = "-1" DdlProveedores.txtValue.Value = "-1"
DdlProveedores.setEsWebService(True) DdlProveedores.setEsWebService(True)
@@ -201,35 +199,13 @@ Partial Class Bancos_PolizaCheque
End If End If
End Sub End Sub
'Protected Sub BtnBuscarProveedor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnBuscarProveedor.Click
' ViewState("CveProveedor") = HdnCveProveedor.Value.ToEntero Private Sub CargaPlantillas(TipoPlantilla As Integer)
' CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1")
' DdlPlantilla_SelectedIndexChanged(DdlPlantilla, e)
'End Sub
'Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String)
' Dim ObjProveedor As New ClsCompProveedores()
' If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", RFC, "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
' If ObjProveedor.DtResultados.Rows.Count > 0 Then
' TxtPagueseA.Text = ObjProveedor.RazonSocial
' TxtNotificarA.Text = ObjProveedor.NotificarA.Trim
' Else
' Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia)
' End If
' End If
' ObjProveedor.Dispose()
'End Sub
Private Sub CargaPlantillas(TipoPlantilla As Integer)
'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
'GvPlantillas.DataBind()
DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
DdlPlantilla.DataBind() DdlPlantilla.DataBind()
DdlPlantilla.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlPlantilla.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -238,16 +214,9 @@ Partial Class Bancos_PolizaCheque
Private Sub CargaCuenta() Private Sub CargaCuenta()
DdlCuenta.Items.Clear() DdlCuenta.Items.Clear()
Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Dim dt As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
'cuando es layout
'If DdlTipoTransaccion.SelectedValue.ToEntero = 3 Then
' dt = dt.FiltraParametros("CveTipoCuenta = 7")
'End If
'cuando es layout
If DdlTipoTransaccion.SelectedValue.ToEntero = 9 Then If DdlTipoTransaccion.SelectedValue.ToEntero = 9 Then
dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1)) dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", 1))
dt = dt.FiltraParametros("UsaLayout = 1") dt = dt.FiltraParametros("UsaLayout = 1")
@@ -262,7 +231,7 @@ Partial Class Bancos_PolizaCheque
DdlCuenta.DataSource = dt 'GlobalDTBancosCuentas(UsuarioActual.CveUsuario) DdlCuenta.DataSource = dt
DdlCuenta.DataBind() DdlCuenta.DataBind()
DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -272,33 +241,16 @@ Partial Class Bancos_PolizaCheque
Private Sub CargaTipoTransaccion(TipoPlantilla As Integer) Private Sub CargaTipoTransaccion(TipoPlantilla As Integer)
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros(String.Format("Tipo = '{0}' ", If(TipoPlantilla = 0, "Egs", "Ing"))) DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros(String.Format("Tipo = '{0}' ", If(TipoPlantilla = 0, "Egs", "Ing")))
DdlTipoTransaccion.DataBind() DdlTipoTransaccion.DataBind()
End Sub End Sub
'Private Sub CargaProyecto()
' DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa) Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged
' DdlProyecto.DataBind()
'End Sub
'Private Sub CargaSubProyecto()
' DdlSubProyecto.Items.Clear()
' DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero)
' DdlSubProyecto.DataBind()
' DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
'End Sub
'Protected Sub DdlProyectoAsignado_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
' CargaSubProyecto()
'End Sub
Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged
'CargaFolio()
CargaCuenta() CargaCuenta()
End Sub End Sub
Private Sub CargaFolio() Private Sub CargaFolio()
If HdnTipoTransaccion.Value = "" Then CargaHdnTipoTransaccion() If HdnTipoTransaccion.Value = "" Then CargaHdnTipoTransaccion()
'If HdnTipoTransaccion.Value = "Egs" Then
If DdlTipoTransaccion.SelectedValue.ToEntero > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(505) <> "1" Then If DdlTipoTransaccion.SelectedValue.ToEntero > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(505) <> "1" Then
If UsuarioActual.CveEmpresa = 119 AndAlso IfNull(Request("Tipo"), "") = "Ing" Then If UsuarioActual.CveEmpresa = 119 AndAlso IfNull(Request("Tipo"), "") = "Ing" Then
Dim ObjFolios As New ClsGralFolios Dim ObjFolios As New ClsGralFolios
@@ -316,11 +268,9 @@ Partial Class Bancos_PolizaCheque
Banco.Dispose() Banco.Dispose()
TxtFolio.Text = Folio.ToString TxtFolio.Text = Folio.ToString
End If End If
End If End If
'Else
'TxtFolio.Text = ""
'End If
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue))
If dr IsNot Nothing Then If dr IsNot Nothing Then
CveMoneda = dr("CveMoneda").ToString.ToEntero CveMoneda = dr("CveMoneda").ToString.ToEntero
@@ -347,11 +297,6 @@ Partial Class Bancos_PolizaCheque
<WebMethodAttribute()> <Script.Services.ScriptMethodAttribute()> <WebMethodAttribute()> <Script.Services.ScriptMethodAttribute()>
Public Shared Function wsGetCuentas(ByVal prefixText As String, ByVal count As Integer) As String() Public Shared Function wsGetCuentas(ByVal prefixText As String, ByVal count As Integer) As String()
'Dim dt As DataTable = CType(Session("DtCuentas"), DataTable)
'Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
'dt = Conta.getCuentasCheque(Prefijo)
'Conta.Dispose()
Dim items As New List(Of String)(count) Dim items As New List(Of String)(count)
Dim dbrows As DataRow() Dim dbrows As DataRow()
@@ -385,8 +330,10 @@ Partial Class Bancos_PolizaCheque
Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged
DdlPersonal.SelectedValueExist(-1) DdlPersonal.SelectedValueExist(-1)
DdlProveedores.txtText.Value = "Seleccione un proveedor" DdlProveedores.txtText.Value = "Seleccione"
DdlProveedores.txtValue.Value = "-1" DdlProveedores.txtValue.Value = "-1"
TxtPagueseA.Text = ""
If DdlPlantilla.SelectedValue.ToEntero = 56 Then If DdlPlantilla.SelectedValue.ToEntero = 56 Then
DdlProveedores.Visible = False DdlProveedores.Visible = False
@@ -451,7 +398,7 @@ Partial Class Bancos_PolizaCheque
CveCuenta = drt("CveCuenta").ToString.ToEntero CveCuenta = drt("CveCuenta").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
End If End If
EsComodin = 0 EsComodin = 0
End If End If
@@ -463,7 +410,7 @@ Partial Class Bancos_PolizaCheque
IdCuenta = drt("IdCtaContable").ToString.ToEntero IdCuenta = drt("IdCtaContable").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
End If End If
EsComodin = 0 EsComodin = 0
@@ -476,7 +423,6 @@ Partial Class Bancos_PolizaCheque
IdCuenta = drr("Id").ToString.ToEntero IdCuenta = drr("Id").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
' Cuenta = drr("Nombre").ToString()
EsComodin = 1 EsComodin = 1
End If End If
End If End If
@@ -487,7 +433,7 @@ Partial Class Bancos_PolizaCheque
IdCuenta = IdCtaFondoGarantia IdCuenta = IdCtaFondoGarantia
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
EsComodin = 0 EsComodin = 0
End If End If
@@ -500,7 +446,7 @@ Partial Class Bancos_PolizaCheque
dr("IdCuenta") = IdCuenta dr("IdCuenta") = IdCuenta
dr("CveCuenta") = CveCuenta dr("CveCuenta") = CveCuenta
dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta
dr("Cuenta") = Cuenta 'TxtCuentaContable.Text dr("Cuenta") = Cuenta
dr("RazonSocial") = drt("RazonSocial") dr("RazonSocial") = drt("RazonSocial")
dr("Concepto") = TxtObservaciones.Text dr("Concepto") = TxtObservaciones.Text
dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1)
@@ -512,7 +458,7 @@ Partial Class Bancos_PolizaCheque
dr("Proyecto") = drt("Proyecto") dr("Proyecto") = drt("Proyecto")
dr("Personal") = drt("Personal") dr("Personal") = drt("Personal")
dr("CvePersonal") = drt("CvePersonal") dr("CvePersonal") = drt("CvePersonal")
'dr("CveConcepto") = drt("CveConcepto")
DtMovimientos.Rows.Add(dr) DtMovimientos.Rows.Add(dr)
@@ -794,9 +740,7 @@ Partial Class Bancos_PolizaCheque
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(110) e.Row.Cells(0).Width = Unit.Pixel(110)
e.Row.Cells(1).Width = Unit.Pixel(200) e.Row.Cells(1).Width = Unit.Pixel(200)
'e.Row.Cells(2).Width = Unit.Pixel(150)
'e.Row.Cells(3).Width = Unit.Pixel(150)
e.Row.Cells(2).Width = Unit.Pixel(120) e.Row.Cells(2).Width = Unit.Pixel(120)
e.Row.Cells(3).Width = Unit.Pixel(303) e.Row.Cells(3).Width = Unit.Pixel(303)
e.Row.Cells(4).Width = Unit.Pixel(72) e.Row.Cells(4).Width = Unit.Pixel(72)
@@ -833,43 +777,15 @@ Partial Class Bancos_PolizaCheque
Dim CvePrePoliza As Integer Dim CvePrePoliza As Integer
Dim ValidaConcepto30 As Boolean = False Dim ValidaConcepto30 As Boolean = False
Dim PaguesA As String = "" Dim PaguesA As String = TxtPagueseA.Text.Trim
Dim CveProveedorSeleccionado As Integer = -1 Dim CveProveedorSeleccionado As Integer = -1
Dim CvePersonalSeleccionado As Integer = -1 Dim CvePersonalSeleccionado As Integer = -1
If DdlPlantilla.SelectedValue.ToEntero = 56 Then If DdlPlantilla.SelectedValue.ToEntero = 56 Then
CvePersonalSeleccionado = DdlPersonal.SelectedValue.ToEntero CvePersonalSeleccionado = DdlPersonal.SelectedValue.ToEntero
'If Not CvePersonalSeleccionado > 0 Then
' Alert("Debe de seleccionar un personal.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
PaguesA = DdlPersonal.SelectedItem.Text
Else Else
CveProveedorSeleccionado = DdlProveedores.txtValue.Value.ToEntero CveProveedorSeleccionado = DdlProveedores.txtValue.Value.ToEntero
'If Not CveProveedorSeleccionado > 0 Then
' Alert("Debe de seleccionar un proveedor.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
If CveProveedorSeleccionado > 0 Then
PaguesA = DdlProveedores.txtText.Value
Else
PaguesA = TxtObservaciones.Text.Trim
If TxtObservaciones.Text.Length = 0 Then
Alert("Debe de proporsionar las Observaciones.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If End If
@@ -883,9 +799,6 @@ Partial Class Bancos_PolizaCheque
End If End If
For Each Gvr As GridViewRow In GvMov.Rows For Each Gvr As GridViewRow In GvMov.Rows
TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
@@ -922,24 +835,14 @@ Partial Class Bancos_PolizaCheque
Dim ObjIE As New ClsBancos() Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL) Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL)
'Dim Conta As ClsContPAQi = Nothing
Dim IDPoliza As Integer = 0 Dim IDPoliza As Integer = 0
Dim CveIE As Integer Dim CveIE As Integer
Dim MsgError As String = "" Dim MsgError As String = ""
Dim idCuentaContabilizacion As Long = 1 Dim idCuentaContabilizacion As Long = 1
'If ChkContabilizar.Checked AndAlso UsuarioActual.Empresa.UsaContabilidad Then
' Conta = New ClsContPAQi(UsuarioActual.Empresa)
' Conta.IniciaTransacSQL()
' IDPoliza = Conta.AddPoliza(2, TxtObservaciones.Text, TotalCargos, TotalAbonos, UsuarioActual.CveUsuario, TxtFechaDocumento.Text.ToDate)
' 'inserto la póliza
' NumPoliza = Conta.Folio
' If IDPoliza = 0 Then
' MsgError = "No se pudo insertar la póliza contable."
' End If
'End If
If MsgError = "" Then If MsgError = "" Then
ImporteDocumento = TxtImporte.Text.ToDecimal ImporteDocumento = TxtImporte.Text.ToDecimal
@@ -993,19 +896,11 @@ Partial Class Bancos_PolizaCheque
If Not CvePersonalSeleccionado > 0 Then If Not CvePersonalSeleccionado > 0 Then
CvePersonalSeleccionado = gvr.DataKey("CvePersonal").ToEntero CvePersonalSeleccionado = gvr.DataKey("CvePersonal").ToEntero
End If End If
'CveProveedor = gvr.DataKey("CveProveedor").ToEntero If Importe <> 0 Then
'If HdnCveProveedor.Value.ToEntero > 0 Then CveProveedor = HdnCveProveedor.Value.ToEntero
If Importe <> 0 Then
'If ChkContabilizar.Checked AndAlso UsuarioActual.Empresa.UsaContabilidad Then
' If Not Conta.AddMovimiento(IDPoliza, gvr.DataKey("IDCuenta").ToEntero, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.FCTextBox("TxtConcepto").Text, 0, TxtFechaDocumento.Text.ToDate, "") Then
' MsgError = "No se pudo insertar movimiento contable"
' Exit For
' End If
'End If
If MsgError = "" Then If MsgError = "" Then
If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then
@@ -1049,10 +944,8 @@ Partial Class Bancos_PolizaCheque
If CvePeriodo > 0 Then If CvePeriodo > 0 Then
If Not ObjNom.UpdatePagoNomina(CvePeriodo, CveIE, CvePrePoliza, UsuarioActual.CveEmpresa) Then If Not ObjNom.UpdatePagoNomina(CvePeriodo, CveIE, CvePrePoliza, UsuarioActual.CveEmpresa) Then
MsgError = "No se pudo actualizar el periodo de la nómina" MsgError = "No se pudo actualizar el periodo de la nómina"
End If End If
'Generamos el Layout
'GeneraLayout()
End If End If
Else Else
@@ -1069,8 +962,7 @@ Partial Class Bancos_PolizaCheque
If MsgError = "" Then If MsgError = "" Then
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
If ObjMov.ValorPolizaDescuadre > 0 Then If ObjMov.ValorPolizaDescuadre > 0 Then
' MsgError = ObjMov.MensajePolizaDescuadre
GuardaLogAD($"PolizaCheque/Guardar Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"PolizaCheque/Guardar Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If End If
Else Else
@@ -1082,7 +974,6 @@ Partial Class Bancos_PolizaCheque
If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
'Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
IDPoliza = ObjMov.ContaIdPoliza IDPoliza = ObjMov.ContaIdPoliza
Else Else
MsgError = "Error al contabilizar" MsgError = "Error al contabilizar"
@@ -1094,9 +985,8 @@ Partial Class Bancos_PolizaCheque
If MsgError = "" Then If MsgError = "" Then
ObjIE.Commit() ObjIE.Commit()
'If Conta IsNot Nothing Then Conta.Commit()
If filemove <> "" Then If filemove <> "" Then
filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
End If End If
@@ -1110,7 +1000,7 @@ Partial Class Bancos_PolizaCheque
DdlCuenta.SelectedValue = "-1" DdlCuenta.SelectedValue = "-1"
TxtFechaDocumento.Text = "" TxtFechaDocumento.Text = ""
TxtImporte.Text = "" TxtImporte.Text = ""
'TxtPagueseA.Text = "" TxtPagueseA.Text = ""
TxtObservaciones.Text = "" TxtObservaciones.Text = ""
Dim StrMsg As New StringBuilder Dim StrMsg As New StringBuilder
StrMsg.AppendFormat("El Movimiento se guardo correctamente <br><br> <a href=""/Bancos/IE.aspx?CveIE={0}"" target=""_blank"" class='Texto'>Movimiento</a><br/>", CveIE) StrMsg.AppendFormat("El Movimiento se guardo correctamente <br><br> <a href=""/Bancos/IE.aspx?CveIE={0}"" target=""_blank"" class='Texto'>Movimiento</a><br/>", CveIE)
@@ -1123,148 +1013,29 @@ Partial Class Bancos_PolizaCheque
Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "window.location.reload();") Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "window.location.reload();")
Else Else
Alert(MsgError.ToString, TipoMensaje.MsgError) Alert(MsgError.ToString, TipoMensaje.MsgError)
ObjIE.RollBack() ObjIE.RollBack()
'If Conta IsNot Nothing Then Conta.RollBack()
End If End If
Else Else
Alert("Debe de llevar un importe", TipoMensaje.MsgAdvertencia) Alert("Debe de llevar un importe", TipoMensaje.MsgAdvertencia)
'If Conta IsNot Nothing Then Conta.RollBack()
End If End If
Else
'If Conta IsNot Nothing Then Conta.RollBack()
End If End If
ObjIE.Dispose() ObjIE.Dispose()
ObjMov.Dispose() ObjMov.Dispose()
ObjNom.Dispose() ObjNom.Dispose()
'If Conta IsNot Nothing Then Conta.Dispose()
Else Else
Alert("La suma de los movimientos no son iguales", TipoMensaje.MsgAdvertencia) Alert("La suma de los movimientos no son iguales", TipoMensaje.MsgAdvertencia)
End If End If
End Sub End Sub
'' -------------------------------------- codigo para generar la poliza del cheque
'If pIDPoliza > 0 Then
'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa)
' If ObjPoliza.GetPoliza(pIDPoliza, -1, -1, -1, -1) Then
' dtMovs = ObjPoliza.DtResultados
' End If
' ObjPoliza.Dispose()
' ''Movimientos Póliza
' If dtMovs IsNot Nothing Then
'Dim TotalAbonos, TotalCargos As Double
' TotalAbonos = 0 : TotalCargos = 0
' For Each Row As DataRow In dtMovs.Rows
''Cantidad
''If Row("AplicaParaConcepto").ToString.ToEntero > 0 Then
' Hoja.Range("B" & CeldaF & ": B" & CeldaF).Value = Row("CuentaFormato").ToString
''Unidad
''If Row("AplicaParaConcepto").ToString.ToEntero > 0 Then
' Hoja.Range("C" & CeldaF & ":C" & CeldaF).Value = Row("Nombre").ToString
''Concepto y Descripción
' Hoja.Range("F" & CeldaF & ":F" & CeldaF).Value = If(Row("Cargo").ToString.ToDouble > 0, Row("Cargo").ToString.ToDouble.FormatoNumero, "")
''P Unitario
''Morro el precio unitario si va a ir?
' Hoja.Range("G" & CeldaF & ":G" & CeldaF).Value = If(Row("Abono").ToString.ToDouble > 0, Row("Abono").ToString.ToDouble.FormatoNumero, "")
' TotalCargos += Row("Cargo").ToString.ToDouble
' TotalAbonos += Row("Abono").ToString.ToDouble
' If dtMovs.Rows.Count > 1 AndAlso CeldaF - CeldaI < dtMovs.Rows.Count - 1 Then
' CeldaF = CeldaF + 1
' Libro.Application.Run("AddRow", (CeldaF - 1).ToString, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing,
' missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
' Libro.Save()
' Libro.Application.DisplayAlerts = False
' Libro.Application.ScreenUpdating = False
' End If
' Next
'Dim AddedRow As Integer = CeldaF - CeldaI
' Hoja.Range("F" & (50 + AddedRow).ToString & ":F" & (50 + AddedRow).ToString).Value = TotalCargos.FormatoNumero
' Hoja.Range("G" & (50 + AddedRow).ToString & ":G" & (50 + AddedRow).ToString).Value = TotalAbonos.FormatoNumero
' Hoja.Range("C" & (52 + AddedRow).ToString & ":C" & (52 + AddedRow).ToString).Value = UsuarioRegistro
''Hoja.Range("E" & (13 + AddedRow).ToString & ":E" & (13 + AddedRow).ToString).Value = LblAmortizacion.Text.Trim.ToDouble(TC).FormatoNumero
''Hoja.Range("E" & (14 + AddedRow).ToString & ":E" & (14 + AddedRow).ToString).Value = TxtSubTotal2.Text.Trim.ToDouble(TC).FormatoNumero
''Hoja.Range("E" & (15 + AddedRow).ToString & ":E" & (15 + AddedRow).ToString).Value = TxtIVA.Text.Trim.ToDouble(TC).FormatoNumero
' End If
' End If
'Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs) Handles LnkAgregar.Click
' If HdnCveCuenta.Value.ToEntero = 0 Then
' Alert("Seleccione una cuenta contable")
' Exit Sub
' End If
' If TxtCargoImporte.Text = "" AndAlso TxtAbonoImporte.Text = "" Then
' Alert("Ingrese un importe.")
' Exit Sub
' End If
' If HdnCveCuenta.Value.ToEntero > 0 AndAlso (TxtCargoImporte.Text.ToDouble > 0 Or TxtAbonoImporte.Text.ToDouble > 0) Then
' Dim Cuenta As String = ""
' Dim CodigoCuenta As String = ""
' If DdlCuentaContable.SelectedValue.ToEntero > 0 Then 'DtCuentasContables
' Dim drr As DataRow = DtCuentasContables.FiltroPrimero("Id=" & DdlCuentaContable.SelectedValue)
' If drr IsNot Nothing Then
' CodigoCuenta = drr("CuentaFormato").ToString()
' Cuenta = drr("Nombre").ToString()
' End If
' End If
' Dim dr As DataRow = DtMovimientos.NewRow
' dr("IdCuenta") = HdnCveCuenta.Value.ToEntero
' dr("CodigoCuenta") = CodigoCuenta
' dr("Cuenta") = Cuenta 'TxtCuentaContable.Text
' dr("Referencia") = TxtReferencia.Text
' dr("Concepto") = TxtConceptoContable.Text
' dr("Cargo") = TxtCargoImporte.Text.ToDouble
' dr("Abono") = TxtAbonoImporte.Text.ToDouble
' DtMovimientos.Rows.Add(dr)
' TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero
' TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero
' 'ArregloMovs.Add(Mov)
' GvMov.DataSource = DtMovimientos
' GvMov.DataBind()
' 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria
' If DdlCuenta.SelectedValue.ToEntero > 0 Then
' Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue)
' If drr IsNot Nothing Then
' TxtImporte.Text = (DtMovimientos.SUM("Abono", "IdCuenta =" & drr("IdCtaContable").ToString) - DtMovimientos.SUM("Cargo", "IdCuenta =" & drr("IdCtaContable").ToString)).ToString.FormatoNumero
' UPPDocumento.Update()
' End If
' End If
' HdnCveCuenta.Value = "0"
' DdlCuentaContable.SelectedValue = "0"
' TxtReferencia.Text = ""
' TxtConceptoContable.Text = ""
' TxtCargoImporte.Text = ""
' TxtAbonoImporte.Text = ""
' End If
'End Sub
Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting
Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero
@@ -1310,10 +1081,22 @@ Partial Class Bancos_PolizaCheque
Protected Sub CargaDDLPersonal() Protected Sub CargaDDLPersonal()
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
DdlPersonal.DataBind() DdlPersonal.DataBind()
DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1")) DdlPersonal.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs)
TxtPagueseA.Text = DdlPersonal.SelectedItem.Text
UPPDocumento.Update()
End Sub
Protected Sub DdlProveedores_selectedindexchange(sender As Object, e As EventArgs)
TxtPagueseA.Text = DdlProveedores.txtText.Value
UPPDocumento.Update()
End Sub
End Class End Class