Otros Egresos paguese a seleccion por dropdown list
This commit is contained in:
@@ -98,10 +98,12 @@
|
||||
<label class="col-md-2">
|
||||
<asp:Label ID="LblPagueseA" runat="server" Text="Páguese a:"></asp:Label></label>
|
||||
<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: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>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
||||
|
||||
@@ -3,12 +3,13 @@ Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports System.Linq
|
||||
Imports System.Web.Services
|
||||
|
||||
Imports Stimulsoft.Report.BarCodes
|
||||
|
||||
Partial Class Bancos_PolizaCheque
|
||||
Inherits ClsPaginas
|
||||
|
||||
' Private Shared missing As Object = System.Reflection.Missing.Value
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
' Private Shared missing As Object = System.Reflection.Missing.Value
|
||||
|
||||
#Region "Propiedades"
|
||||
Private Property NombreArchivo As String
|
||||
Get
|
||||
@@ -92,9 +93,9 @@ Partial Class Bancos_PolizaCheque
|
||||
Get
|
||||
Return CType(ViewState("CveTurno"), Integer)
|
||||
End Get
|
||||
End Property
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
@@ -188,30 +189,41 @@ Partial Class Bancos_PolizaCheque
|
||||
DdlPlantilla.SelectedValue = "36"
|
||||
DdlPlantilla.Enabled = False
|
||||
End If
|
||||
|
||||
|
||||
''DdlProveedores.txtText.Value = ""
|
||||
DdlProveedores.txtText.Value = "Seleccione un proveedor"
|
||||
DdlProveedores.txtValue.Value = "-1"
|
||||
DdlProveedores.setEsWebService(True)
|
||||
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
|
||||
|
||||
CargaDDLPersonal()
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnBuscarProveedor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnBuscarProveedor.Click
|
||||
ViewState("CveProveedor") = HdnCveProveedor.Value.ToEntero
|
||||
CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1")
|
||||
DdlPlantilla_SelectedIndexChanged(DdlPlantilla, e)
|
||||
End Sub
|
||||
'Protected Sub BtnBuscarProveedor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnBuscarProveedor.Click
|
||||
' ViewState("CveProveedor") = HdnCveProveedor.Value.ToEntero
|
||||
' 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()
|
||||
'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()
|
||||
' 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
|
||||
'End Sub
|
||||
|
||||
Private Sub CargaPlantillas(TipoPlantilla As Integer)
|
||||
|
||||
@@ -371,6 +383,19 @@ Partial Class Bancos_PolizaCheque
|
||||
End Function
|
||||
|
||||
Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged
|
||||
|
||||
DdlPersonal.SelectedValueExist(-1)
|
||||
DdlProveedores.txtText.Value = "Seleccione un proveedor"
|
||||
DdlProveedores.txtValue.Value = "-1"
|
||||
|
||||
If DdlPlantilla.SelectedValue.ToEntero = 56 Then
|
||||
DdlProveedores.Visible = False
|
||||
DdlPersonal.Visible = True
|
||||
Else
|
||||
DdlProveedores.Visible = True
|
||||
DdlPersonal.Visible = False
|
||||
End If
|
||||
|
||||
Dim IdCtaFondoGarantia As Integer
|
||||
If ViewState("CveProveedor").ToString.ToEntero > 0 Then
|
||||
|
||||
@@ -582,7 +607,7 @@ Partial Class Bancos_PolizaCheque
|
||||
GeneraLayout()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#Region "LAYOUT"
|
||||
Private Function CreaArchivo() As Boolean
|
||||
DirectoryExistsCreate(String.Format("{0}Layout", UsuarioActual.Empresa.Ruta))
|
||||
@@ -706,65 +731,65 @@ Partial Class Bancos_PolizaCheque
|
||||
End If
|
||||
|
||||
Return UCase(Retorno)
|
||||
End Function
|
||||
|
||||
'Este metodo es el de las altas
|
||||
'Private Function GeneraLineaLayout(CvePersonal As Integer, ObjPersonal As ClsRH) As String
|
||||
' Dim Retorno As String = ""
|
||||
|
||||
' If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
||||
' Dim TipoRegistro As String = "02" 'Estatico
|
||||
' Dim Nombre As String = GeneraCampo(ObjPersonal.DtResultados(0)("Nombres").ToString, 20)
|
||||
' Dim ApellidoPaterno As String = GeneraCampo(ObjPersonal.DtResultados(0)("APaterno").ToString, 20)
|
||||
' Dim ApellidoMaterno As String = GeneraCampo(ObjPersonal.DtResultados(0)("AMaterno").ToString, 20)
|
||||
' Dim FechaNacimiento As String = ObjPersonal.DtResultados(0)("FechaNacimiento").ToString.ToDate.ToString("yyyy-MM-dd")
|
||||
' Dim EstadoCivil As String = "S" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim Curp As String = GeneraCampo(ObjPersonal.DtResultados(0)("CURP").ToString, 18)
|
||||
' Dim Sexo As String = GeneraCampo(ObjPersonal.DtResultados(0)("Genero").ToString, 1)
|
||||
' Dim Nacionalidad As String = GeneraCampo("M", 3) 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim PaisOrigen As String = "MEX" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim Ocupacion As String = "OFI" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim FechaIngreso As String = ObjPersonal.DtResultados(0)("FechaIngreso").ToString.ToDate.ToString("yyyy-MM-dd")
|
||||
' Dim Calle As String = GeneraCampo(ObjPersonal.DtResultados(0)("Calle").ToString, 50)
|
||||
' Dim NumeroExterior As String = GeneraCampo(ObjPersonal.DtResultados(0)("NumExt").ToString, 8)
|
||||
' Dim NumeroInterior As String = GeneraCampo(ObjPersonal.DtResultados(0)("NumInt").ToString, 8)
|
||||
' Dim Colonia As String = GeneraCampo(ObjPersonal.DtResultados(0)("Colonia").ToString, 30)
|
||||
' Dim CP As String = GeneraCampo(ObjPersonal.DtResultados(0)("CP").ToString, 5)
|
||||
' Dim Poblacion As String = GeneraCampo("MEXICO", 30)
|
||||
' Dim Estado As String = GeneraCampo(ObjPersonal.DtResultados(0)("Estado").ToString, 25)
|
||||
' Dim TelefonoParticular As String = GeneraCampo(ObjPersonal.DtResultados(0)("Telefono").ToString, 10)
|
||||
' Dim TelefonoOficina As String = GeneraCampo(ObjPersonal.DtResultados(0)("Telefono").ToString, 10)
|
||||
' Dim ExtensionOficina As String = "000000" 'No tenemos este campo
|
||||
' Dim Celular As String = GeneraCampo(ObjPersonal.DtResultados(0)("Celular").ToString, 10)
|
||||
' Dim CorreoElectronico As String = GeneraCampo(ObjPersonal.DtResultados(0)("Correo").ToString, 50)
|
||||
' Dim TipoProducto As String = "A0" 'Estatico
|
||||
' Dim SubProducto As String = "245" 'Estatico
|
||||
' Dim CuentaUniversal As String = GeneraCampo("", 2) 'Este valor se captura vacío
|
||||
' Dim TipoCuenta As String = GeneraCampo("A", 2) 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim NumeroTDD As String = GeneraCampo("0000" + ObjPersonal.DtResultados(0)("Correo").ToString, 20)
|
||||
' Dim Oficina As String = GeneraCampo(ObjPersonal.DtResultados(0)("Sucursal").ToString, 4)
|
||||
' Dim MontoDisperciones As String = "000000000000000" 'Estatico
|
||||
' Dim NumeroDisperciones As String = "0" 'Estatico
|
||||
' Dim OficinaEntrega As String = "0000" 'Estatico
|
||||
' Dim Beneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("Nombres").ToString, 20)
|
||||
' Dim ApellidoPaternoBeneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("APaterno").ToString, 20)
|
||||
' Dim ApellidoMaternoBeneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("AMaterno").ToString, 20)
|
||||
' Dim ParentescoBeneficiario As String = "SD" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim SexoBeneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("Genero").ToString, 1)
|
||||
' Dim FechaNacimientoBeneficiario As String = ObjPersonal.DtResultados(0)("FechaNacimiento").ToString.ToDate.ToString("yyyy-MM-dd")
|
||||
|
||||
' Retorno = TipoRegistro + Nombre + ApellidoPaterno + ApellidoMaterno + FechaNacimiento + EstadoCivil + Curp + Sexo + Nacionalidad + PaisOrigen + Ocupacion + FechaIngreso + Calle + NumeroExterior + NumeroInterior +
|
||||
' Colonia + CP + Poblacion + Estado + TelefonoParticular + TelefonoOficina + ExtensionOficina + Celular + CorreoElectronico + TipoProducto + SubProducto + CuentaUniversal + TipoCuenta + NumeroTDD + Oficina +
|
||||
' MontoDisperciones + NumeroDisperciones + OficinaEntrega + Beneficiario + ApellidoPaternoBeneficiario + ApellidoMaternoBeneficiario + ParentescoBeneficiario + SexoBeneficiario + FechaNacimientoBeneficiario
|
||||
|
||||
' End If
|
||||
|
||||
' Return Retorno
|
||||
'End Function
|
||||
|
||||
End Function
|
||||
|
||||
'Este metodo es el de las altas
|
||||
'Private Function GeneraLineaLayout(CvePersonal As Integer, ObjPersonal As ClsRH) As String
|
||||
' Dim Retorno As String = ""
|
||||
|
||||
' If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
||||
' Dim TipoRegistro As String = "02" 'Estatico
|
||||
' Dim Nombre As String = GeneraCampo(ObjPersonal.DtResultados(0)("Nombres").ToString, 20)
|
||||
' Dim ApellidoPaterno As String = GeneraCampo(ObjPersonal.DtResultados(0)("APaterno").ToString, 20)
|
||||
' Dim ApellidoMaterno As String = GeneraCampo(ObjPersonal.DtResultados(0)("AMaterno").ToString, 20)
|
||||
' Dim FechaNacimiento As String = ObjPersonal.DtResultados(0)("FechaNacimiento").ToString.ToDate.ToString("yyyy-MM-dd")
|
||||
' Dim EstadoCivil As String = "S" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim Curp As String = GeneraCampo(ObjPersonal.DtResultados(0)("CURP").ToString, 18)
|
||||
' Dim Sexo As String = GeneraCampo(ObjPersonal.DtResultados(0)("Genero").ToString, 1)
|
||||
' Dim Nacionalidad As String = GeneraCampo("M", 3) 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim PaisOrigen As String = "MEX" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim Ocupacion As String = "OFI" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim FechaIngreso As String = ObjPersonal.DtResultados(0)("FechaIngreso").ToString.ToDate.ToString("yyyy-MM-dd")
|
||||
' Dim Calle As String = GeneraCampo(ObjPersonal.DtResultados(0)("Calle").ToString, 50)
|
||||
' Dim NumeroExterior As String = GeneraCampo(ObjPersonal.DtResultados(0)("NumExt").ToString, 8)
|
||||
' Dim NumeroInterior As String = GeneraCampo(ObjPersonal.DtResultados(0)("NumInt").ToString, 8)
|
||||
' Dim Colonia As String = GeneraCampo(ObjPersonal.DtResultados(0)("Colonia").ToString, 30)
|
||||
' Dim CP As String = GeneraCampo(ObjPersonal.DtResultados(0)("CP").ToString, 5)
|
||||
' Dim Poblacion As String = GeneraCampo("MEXICO", 30)
|
||||
' Dim Estado As String = GeneraCampo(ObjPersonal.DtResultados(0)("Estado").ToString, 25)
|
||||
' Dim TelefonoParticular As String = GeneraCampo(ObjPersonal.DtResultados(0)("Telefono").ToString, 10)
|
||||
' Dim TelefonoOficina As String = GeneraCampo(ObjPersonal.DtResultados(0)("Telefono").ToString, 10)
|
||||
' Dim ExtensionOficina As String = "000000" 'No tenemos este campo
|
||||
' Dim Celular As String = GeneraCampo(ObjPersonal.DtResultados(0)("Celular").ToString, 10)
|
||||
' Dim CorreoElectronico As String = GeneraCampo(ObjPersonal.DtResultados(0)("Correo").ToString, 50)
|
||||
' Dim TipoProducto As String = "A0" 'Estatico
|
||||
' Dim SubProducto As String = "245" 'Estatico
|
||||
' Dim CuentaUniversal As String = GeneraCampo("", 2) 'Este valor se captura vacío
|
||||
' Dim TipoCuenta As String = GeneraCampo("A", 2) 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim NumeroTDD As String = GeneraCampo("0000" + ObjPersonal.DtResultados(0)("Correo").ToString, 20)
|
||||
' Dim Oficina As String = GeneraCampo(ObjPersonal.DtResultados(0)("Sucursal").ToString, 4)
|
||||
' Dim MontoDisperciones As String = "000000000000000" 'Estatico
|
||||
' Dim NumeroDisperciones As String = "0" 'Estatico
|
||||
' Dim OficinaEntrega As String = "0000" 'Estatico
|
||||
' Dim Beneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("Nombres").ToString, 20)
|
||||
' Dim ApellidoPaternoBeneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("APaterno").ToString, 20)
|
||||
' Dim ApellidoMaternoBeneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("AMaterno").ToString, 20)
|
||||
' Dim ParentescoBeneficiario As String = "SD" 'Requiere cuadre entre nuestra tabla y el catalogo del banco
|
||||
' Dim SexoBeneficiario As String = GeneraCampo(ObjPersonal.DtResultados(0)("Genero").ToString, 1)
|
||||
' Dim FechaNacimientoBeneficiario As String = ObjPersonal.DtResultados(0)("FechaNacimiento").ToString.ToDate.ToString("yyyy-MM-dd")
|
||||
|
||||
' Retorno = TipoRegistro + Nombre + ApellidoPaterno + ApellidoMaterno + FechaNacimiento + EstadoCivil + Curp + Sexo + Nacionalidad + PaisOrigen + Ocupacion + FechaIngreso + Calle + NumeroExterior + NumeroInterior +
|
||||
' Colonia + CP + Poblacion + Estado + TelefonoParticular + TelefonoOficina + ExtensionOficina + Celular + CorreoElectronico + TipoProducto + SubProducto + CuentaUniversal + TipoCuenta + NumeroTDD + Oficina +
|
||||
' MontoDisperciones + NumeroDisperciones + OficinaEntrega + Beneficiario + ApellidoPaternoBeneficiario + ApellidoMaternoBeneficiario + ParentescoBeneficiario + SexoBeneficiario + FechaNacimientoBeneficiario
|
||||
|
||||
' End If
|
||||
|
||||
' Return Retorno
|
||||
'End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.RowIndex = 0 Then
|
||||
@@ -806,9 +831,49 @@ Partial Class Bancos_PolizaCheque
|
||||
|
||||
Dim TotalCargos, TotalAbonos, ImporteDocumento As Decimal
|
||||
Dim CvePrePoliza As Integer
|
||||
Dim ValidaConcepto30 As Boolean = False
|
||||
|
||||
Dim PaguesA As String = ""
|
||||
Dim CveProveedorSeleccionado As Integer = -1
|
||||
Dim CvePersonalSeleccionado As Integer = -1
|
||||
|
||||
|
||||
If DdlPlantilla.SelectedValue.ToEntero = 56 Then
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
|
||||
Dim ValidaConcepto30 As Boolean = False
|
||||
|
||||
If DdlCuenta.SelectedValue.ToEntero <= 0 Then
|
||||
If UsuarioActual.CveEmpresa <> 126 Then
|
||||
Alert("Seleccione la Cuenta Bancaria", TipoMensaje.MsgAdvertencia)
|
||||
@@ -817,6 +882,10 @@ Partial Class Bancos_PolizaCheque
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
For Each Gvr As GridViewRow In GvMov.Rows
|
||||
|
||||
TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
|
||||
@@ -879,7 +948,7 @@ Partial Class Bancos_PolizaCheque
|
||||
|
||||
Try
|
||||
Dim ConceptoPoliza As String = TxtObservaciones.Text
|
||||
If ConceptoPoliza = "" Then ConceptoPoliza = TxtPagueseA.Text
|
||||
If ConceptoPoliza = "" Then ConceptoPoliza = PaguesA
|
||||
Dim CveMoneda As Integer = 1
|
||||
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue))
|
||||
If dr IsNot Nothing Then
|
||||
@@ -889,7 +958,7 @@ Partial Class Bancos_PolizaCheque
|
||||
Dim TC As Decimal = If(CveMoneda > 1, GlobalTipoCambio(TxtFechaDocumento.Text.ToDate), 1)
|
||||
Dim CveTipoPoliza As Integer = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla).FiltroPrimeroValor("TipoPoliza", String.Format("CvePlantillaPoliza={0}", DdlPlantilla.SelectedValue)).ToEntero
|
||||
CvePrePoliza = ObjMov.AddPrePolizas("PolizaCheque/Guardar", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFechaDocumento.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=CveTipoPoliza)
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImporteDocumento, CveMoneda, If(CveMoneda > 1, TC, 0.0), TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PaguesA, ImporteDocumento, CveMoneda, If(CveMoneda > 1, TC, 0.0), TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CveIE > 0 Then
|
||||
|
||||
'inserto los movimientos de la conta para abonar al saldo
|
||||
@@ -901,7 +970,7 @@ Partial Class Bancos_PolizaCheque
|
||||
Dim Importe As Double = 0
|
||||
Dim TipoMovto As Boolean = False
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim CveProveedor As Integer = -1
|
||||
'Dim CveProveedor As Integer = -1
|
||||
|
||||
'inserto las compras que voy a pagar
|
||||
For Each gvr As GridViewRow In GvMov.Rows
|
||||
@@ -917,8 +986,17 @@ Partial Class Bancos_PolizaCheque
|
||||
Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble
|
||||
TipoMovto = False
|
||||
End If
|
||||
CveProveedor = gvr.DataKey("CveProveedor").ToEntero
|
||||
If HdnCveProveedor.Value.ToEntero > 0 Then CveProveedor = HdnCveProveedor.Value.ToEntero
|
||||
|
||||
If Not CveProveedorSeleccionado > 0 Then
|
||||
CveProveedorSeleccionado = gvr.DataKey("CveProveedor").ToEntero
|
||||
End If
|
||||
|
||||
If Not CvePersonalSeleccionado > 0 Then
|
||||
CvePersonalSeleccionado = gvr.DataKey("CvePersonal").ToEntero
|
||||
End If
|
||||
|
||||
'CveProveedor = gvr.DataKey("CveProveedor").ToEntero
|
||||
'If HdnCveProveedor.Value.ToEntero > 0 Then CveProveedor = HdnCveProveedor.Value.ToEntero
|
||||
|
||||
If Importe <> 0 Then
|
||||
'If ChkContabilizar.Checked AndAlso UsuarioActual.Empresa.UsaContabilidad Then
|
||||
@@ -942,14 +1020,14 @@ Partial Class Bancos_PolizaCheque
|
||||
Importe = Importe * TC
|
||||
End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe, TipoCambio:=TC, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedorSeleccionado, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=CvePersonalSeleccionado, ImporteMX:=Importe, TipoCambio:=TC, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then
|
||||
MsgError = "no se pudo insertar el detalle de la póliza2"
|
||||
End If
|
||||
|
||||
If gvr.DataKey("CveConcepto").ToEntero = 30 Then
|
||||
If CveMoneda > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
|
||||
'Agregamos complementaria
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, 0, gvr.FCTextBox("TxtConcepto").Text, 204, TxtObservaciones.Text, Now, dr("IDCtaContableComplementaria").ToString.ToEntero, -1, CveIE:=CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe * TC - Importe, ImporteME:=Importe, TipoCambio:=TC) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, 0, gvr.FCTextBox("TxtConcepto").Text, 204, TxtObservaciones.Text, Now, dr("IDCtaContableComplementaria").ToString.ToEntero, -1, CveIE:=CveIE, CveProveedor:=CveProveedorSeleccionado, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=CvePersonalSeleccionado, ImporteMX:=Importe * TC - Importe, ImporteME:=Importe, TipoCambio:=TC) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
|
||||
End If
|
||||
End If
|
||||
@@ -1032,7 +1110,7 @@ Partial Class Bancos_PolizaCheque
|
||||
DdlCuenta.SelectedValue = "-1"
|
||||
TxtFechaDocumento.Text = ""
|
||||
TxtImporte.Text = ""
|
||||
TxtPagueseA.Text = ""
|
||||
'TxtPagueseA.Text = ""
|
||||
TxtObservaciones.Text = ""
|
||||
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)
|
||||
@@ -1226,7 +1304,14 @@ Partial Class Bancos_PolizaCheque
|
||||
End If
|
||||
End If
|
||||
Return Retorno
|
||||
End Function
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub CargaDDLPersonal()
|
||||
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
||||
DdlPersonal.DataBind()
|
||||
DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1"))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user