457 lines
22 KiB
VB.net
457 lines
22 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
Partial Class Bancos_DepositosCaja
|
|
Inherits ClsPaginas
|
|
|
|
Private Property FacturasCheckadas As Integer
|
|
Get
|
|
Return ViewState("FacturasCheckadas").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("FacturasCheckadas") = value
|
|
End Set
|
|
End Property
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
FacturasCheckadas = 0
|
|
TxtFecha.Text = Now.ToShortDateString
|
|
txtFechaI.Text = Now.AddDays(-1).ToShortDateString
|
|
txtFechaF.Text = Now.ToShortDateString
|
|
TxtComision.Attributes.Add("onKeyUp", "txtSuma(this);")
|
|
TxtDescuento.Attributes.Add("onKeyUp", "txtSumaDescuento(this);")
|
|
TxtIVA.Attributes.Add("onKeyUp", "txtSumaIVA(this);")
|
|
TxtComisionIntermediario.Attributes.Add("onKeyUp", "txtSumaTntermediario(this);")
|
|
|
|
|
|
CargaCuentas()
|
|
ChkFaltante.Attributes.Add("onclick", "CheckFaltante(this);")
|
|
ChkDescuento.Attributes.Add("onclick", "CheckDescuento(this);")
|
|
ChkIntermediario.Attributes.Add("onclick", "CheckIntermediario(this);")
|
|
BtnConsultar.Attributes.Add("onclick", "Consultar(this);")
|
|
BtnDepositar.Attributes.Add("onclick", "Depositar(this);")
|
|
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaCuentas()
|
|
DdlCuentaDeposito.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta <> 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
|
DdlCuentaDeposito.DataBind()
|
|
|
|
DdlCajaChica.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"})
|
|
DdlCajaChica.DataBind()
|
|
'código temporal, para claudia y toñita, monge, anadelia, alba,patricia
|
|
If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897, 2560) Then
|
|
DdlCajaChica.Items.Add(New ListItem("Todas", "-1"))
|
|
DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Solidaridad", "7850"))
|
|
DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Obregón", "7853"))
|
|
DdlCuentaDeposito.Items.Add(New ListItem("Cuadre Matriz", "7861"))
|
|
divFolio.Visible = True
|
|
End If
|
|
|
|
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
|
DdlSubProyectos.DataBind()
|
|
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
DdlSubProyectoDeposito.DataSource = DdlSubProyectos.DataSource
|
|
DdlSubProyectoDeposito.DataBind()
|
|
DdlSubProyectoDeposito.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
|
|
DdlSubProyectoDescuento.DataSource = DdlSubProyectos.DataSource
|
|
DdlSubProyectoDescuento.DataBind()
|
|
DdlSubProyectoDescuento.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
|
|
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
|
|
DdlClasificacion.DataBind()
|
|
DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
|
|
DdlClasificacionDescuento.DataSource = DdlClasificacion.DataSource
|
|
DdlClasificacionDescuento.DataBind()
|
|
DdlClasificacionDescuento.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
|
|
|
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
|
|
DdlPersonal.DataBind()
|
|
|
|
Dim ClavesProvs As String = UsuarioActual.Empresa.Funcionalidad(206)
|
|
If ClavesProvs = "" Then ClavesProvs = "0" ' para que no marque error
|
|
|
|
'intermediario
|
|
DdlProveedorIntermediario.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveProveedor in ({0})", ClavesProvs))
|
|
DdlProveedorIntermediario.DataBind()
|
|
|
|
DdlClasificacionIntermediario.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, UsoClasificacion:=2)
|
|
DdlClasificacionIntermediario.DataBind()
|
|
|
|
DdlSubProyectoIntermediario.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
|
|
DdlSubProyectoIntermediario.DataBind()
|
|
|
|
'CargaUsuarios
|
|
DdlUsuario.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
|
DdlUsuario.DataBind()
|
|
|
|
|
|
End Sub
|
|
|
|
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjBancos As New ClsBancos
|
|
Dim FechaI, FechaF As String
|
|
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
|
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
|
Dim MSI As Integer = -1
|
|
If DdlTipoPago.SelectedValue = "12" Then
|
|
MSI = DDlMesesSinIntereses.SelectedValue.ToEntero
|
|
End If
|
|
|
|
ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero, DdlTipoPago.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, MSI:=MSI, CveUsuario:=DdlUsuario.SelectedValue.ToEntero)
|
|
|
|
GvFacturas.DataSource = ObjBancos.DtResultados
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
|
If ObjBancos.DtResultados IsNot Nothing AndAlso ObjBancos.DtResultados.Rows.Count > 0 Then
|
|
lblValorTotal.Text = ObjBancos.DtResultados.SUM("Importe").ToString("###,###,###.00")
|
|
RegistraScript($" ValorTotalSeleccionado = {ObjBancos.DtResultados.SUM("Importe")};")
|
|
End If
|
|
End If
|
|
ObjBancos.Dispose()
|
|
|
|
GvFacturas.DataBind()
|
|
ChkFaltante.Checked = False
|
|
ChkDescuento.Checked = False
|
|
ChkIntermediario.Checked = False
|
|
TxtComision.Text = ""
|
|
TxtDescuento.Text = ""
|
|
TxtIVA.Text = ""
|
|
TxtComisionIntermediario.Text = ""
|
|
'lblValorTotal.Text = "0.0"
|
|
lblValorTotalSeleccionado.Text = "0.0"
|
|
divLabelTotal.Visible = True
|
|
DdlSubProyectoDeposito.SelectedValueExist(DdlSubProyectos.SelectedValue.ToEntero)
|
|
DdlSubProyectoDescuento.SelectedValueExist(DdlSubProyectos.SelectedValue.ToEntero)
|
|
DdlSubProyectoIntermediario.SelectedValueExist(DdlSubProyectos.SelectedValue.ToEntero)
|
|
UpGvFacturas.Update()
|
|
UpParametros.Update()
|
|
UpComisiones.Update()
|
|
|
|
End Sub
|
|
|
|
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
|
|
|
|
Dim TotalImporte As Decimal = 0
|
|
Dim TotalImportePrePoliza As Decimal
|
|
Dim Comision As Decimal = TxtComision.Text.ToDecimal
|
|
Dim Descuento As Decimal = TxtDescuento.Text.ToDecimal
|
|
Dim IVA As Decimal = TxtIVA.Text.ToDecimal
|
|
Dim ImporteInter As Decimal = TxtComisionIntermediario.Text.ToDecimal
|
|
|
|
|
|
For Each Gvr As GridViewRow In GvFacturas.Rows
|
|
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
|
|
Next
|
|
|
|
If TotalImporte = 0 Then
|
|
Alert("Seleccion una factura para realizar el depósito", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
End If
|
|
|
|
TotalImportePrePoliza = TotalImporte
|
|
If Comision <> 0 Then
|
|
TotalImporte = TotalImporte + Comision
|
|
'Comision = -(Comision) ' se inverte el valor, va cargada
|
|
'Descuento = -(Descuento) ' se inverte el valor, va cargada
|
|
If DdlSubProyectoDeposito.SelectedValue.ToEntero = -1 Or DdlClasificacion.SelectedValue.ToEntero = -1 Then
|
|
Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
End If
|
|
End If
|
|
|
|
If Descuento <> 0 Then
|
|
TotalImporte = TotalImporte - Descuento
|
|
'Descuento = -(Descuento) ' se inverte el valor, va cargada
|
|
If DdlSubProyectoDescuento.SelectedValue.ToEntero = -1 Or DdlClasificacionDescuento.SelectedValue.ToEntero = -1 Then
|
|
Alert("Debes Seleccionar un Subproyecto y una Clasificación de descuento", TipoMensaje.MsgAdvertencia)
|
|
Exit Sub
|
|
End If
|
|
End If
|
|
|
|
If TxtComisionIntermediario.Text.ToDecimal <> 0 Then
|
|
TotalImporte = TotalImporte - TxtComisionIntermediario.Text.ToDecimal - IVA
|
|
End If
|
|
|
|
Dim OcurrioError As Boolean = False
|
|
Dim ObjConta As New ClsContabilidad()
|
|
Dim ObjBancos As New ClsBancos(ObjConta.IniciaTransacSQL())
|
|
|
|
Dim CveIEOrigen As Integer 'CajaChica
|
|
Dim CveIEDestino As Integer 'Banco
|
|
Dim NuevaCvePrePoliza As Integer
|
|
Dim FolioIE As Long = -1
|
|
Dim CveMoneda As Integer = 1
|
|
Dim TipoCambio As Decimal = 1
|
|
Dim Fecha As Date = TxtFecha.Text.ToDate
|
|
Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
|
|
Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuentaDeposito.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
|
|
Dim CveSubProyecto As Integer = DdlSubProyectos.SelectedValue.ToEntero
|
|
Dim CveClasificacion As Integer = -1
|
|
|
|
Dim CveSubProyectoComision As Integer
|
|
Dim CveClasificacionComision As Integer
|
|
|
|
Dim CveSubProyectoDescuento As Integer
|
|
Dim CveClasificacionDescuento As Integer
|
|
|
|
Dim documentos As String = "Los Depósitos se realizaron exitosamente<br/><br/>"
|
|
Dim imprimirFolios As String = ""
|
|
Dim CveSubProyectoIntermediario As Integer
|
|
Dim CveClasificacionIntermediario As Integer
|
|
Dim CveProveedorIntermediario As Integer = -1
|
|
|
|
If drOrigen IsNot Nothing Then
|
|
CveMoneda = drOrigen("CveMoneda").ToString.ToEntero
|
|
End If
|
|
|
|
If drDestino IsNot Nothing Then
|
|
CveMoneda = drDestino("CveMoneda").ToString.ToEntero
|
|
End If
|
|
|
|
NuevaCvePrePoliza = ObjConta.AddPrePolizas("DepCaja", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=1)
|
|
|
|
|
|
If ChkIntermediario.Checked Then
|
|
|
|
CveSubProyectoIntermediario = DdlSubProyectoIntermediario.SelectedValue.ToEntero
|
|
CveClasificacionIntermediario = DdlClasificacionIntermediario.SelectedValue.ToEntero
|
|
CveProveedorIntermediario = DdlProveedorIntermediario.SelectedValue.ToEntero
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then ' empresa llantera
|
|
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, TotalImporte, 95, DdlClasificacionIntermediario.SelectedItem.Text, DdlClasificacionIntermediario.SelectedItem.Text, CveClasificacion:=CveClasificacionIntermediario, CveSubProyecto:=CveSubProyectoIntermediario, CveProveedor:=CveProveedorIntermediario, CveCuenta:=57619) Then
|
|
OcurrioError = True
|
|
End If
|
|
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TotalImporte, TotalImporte, 95, DdlClasificacionIntermediario.SelectedItem.Text, DdlClasificacionIntermediario.SelectedItem.Text, CveClasificacion:=CveClasificacionIntermediario, CveSubProyecto:=CveSubProyectoIntermediario, CveProveedor:=CveProveedorIntermediario, CveCuenta:=57619) Then
|
|
OcurrioError = True
|
|
End If
|
|
End If
|
|
|
|
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, ImporteInter, ImporteInter, 51, DdlClasificacionIntermediario.SelectedItem.Text, DdlClasificacionIntermediario.SelectedItem.Text, CveClasificacion:=CveClasificacionIntermediario, CveSubProyecto:=CveSubProyectoIntermediario) Then
|
|
OcurrioError = True
|
|
End If
|
|
|
|
If IVA <> 0 Then
|
|
If Not OcurrioError AndAlso Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, IVA, IVA, 14, DdlClasificacionIntermediario.SelectedItem.Text, DdlClasificacionIntermediario.SelectedItem.Text, CveClasificacion:=CveClasificacionIntermediario, CveSubProyecto:=CveSubProyectoIntermediario, PorcentajeImpuesto:=0.16D) Then
|
|
OcurrioError = True
|
|
End If
|
|
End If
|
|
|
|
End If
|
|
Dim CveTransaccionBanco As Integer = 13
|
|
|
|
If TotalImporte < 0 Then 'que es una devolución, entonces como es negativo, se cambia el concetpo de bancos, por condición de trigger
|
|
CveTransaccionBanco = 6
|
|
End If
|
|
|
|
'código temporal, para claudia y toñita, monge, anadelia, alba,patricia
|
|
If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897, 2560) Then
|
|
FolioIE = TxtFolio.Text.ToEntero
|
|
End If
|
|
|
|
If FolioIE <= 0 Then
|
|
'Entrada a bancos
|
|
FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco)
|
|
End If
|
|
|
|
If CveSubProyecto <= 0 Then 'sino se seleccionó del combo, busca en el listado el primero
|
|
|
|
For Each Gvr As GridViewRow In GvFacturas.Rows
|
|
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
|
CveSubProyecto = Gvr.DataKey("CveSubProyecto").ToEntero
|
|
Exit For
|
|
End If
|
|
Next
|
|
End If
|
|
|
|
If FolioIE <= 0 Then
|
|
OcurrioError = True
|
|
End If
|
|
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
|
|
|
|
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a>     <br/> ", CveIEOrigen, FolioIE)
|
|
|
|
If Not OcurrioError AndAlso ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, TotalImporte * TipoCambio, 30, "Depósito Bancario", "Depósito Bancario", CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigen) Then
|
|
|
|
If ChkFaltante.Checked Then
|
|
CveSubProyectoComision = DdlSubProyectoDeposito.SelectedValue.ToEntero
|
|
CveClasificacionComision = DdlClasificacion.SelectedValue.ToEntero
|
|
If Comision <> 0 Then
|
|
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Comision, Comision * TipoCambio, 78, DdlClasificacion.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, CveClasificacion:=CveClasificacionComision, CveSubProyecto:=CveSubProyectoComision) Then
|
|
OcurrioError = True
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
If Not OcurrioError AndAlso ChkDescuento.Checked Then
|
|
CveSubProyectoDescuento = DdlSubProyectoDescuento.SelectedValue.ToEntero
|
|
CveClasificacionDescuento = DdlClasificacionDescuento.SelectedValue.ToEntero
|
|
|
|
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Descuento, Descuento * TipoCambio, 51, DdlClasificacionDescuento.SelectedItem.Text, DdlClasificacionDescuento.SelectedItem.Text & " " & DdlPersonal.SelectedItem.Text, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyectoDescuento, CvePersonal:=DdlPersonal.SelectedValue.ToEntero) Then
|
|
OcurrioError = True
|
|
End If
|
|
End If
|
|
Else
|
|
OcurrioError = True
|
|
End If
|
|
If Not OcurrioError Then
|
|
For Each Gvr As GridViewRow In GvFacturas.Rows
|
|
|
|
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
|
'Datos de las Nuevas PrePolizas
|
|
'Entrada a Bancos
|
|
|
|
Dim Importe As Decimal = Gvr.DataKey("Importe").ToDecimal
|
|
Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
|
|
|
|
'Datos de las Prepolizas A Cancelar
|
|
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
|
|
Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
|
|
Dim CveCuentaBancaria As Integer = Gvr.DataKey("CveCuenta").ToEntero
|
|
Dim tCveSubProyecto As Integer = Gvr.DataKey("CveSubProyecto").ToEntero
|
|
|
|
FolioIE = ObjBancos.GetNextFolio(CveCuentaBancaria, 2)
|
|
If Not FolioIE > 0 Then
|
|
OcurrioError = True
|
|
Exit For
|
|
End If
|
|
CveIEDestino = ObjBancos.AddBancos_IE(CveCuentaBancaria, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
|
|
|
|
If Not OcurrioError AndAlso Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, Importe * TipoCambio, 30, SerieFolio, String.Format("Depósito Bancario: {0}", SerieFolio), CveClasificacion:=CveClasificacion, CveSubProyecto:=tCveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino) Then
|
|
OcurrioError = True
|
|
Exit For
|
|
End If
|
|
|
|
'Asignamos la cuenta Deposito
|
|
If Not OcurrioError AndAlso Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEOrigen, CveIE) Then
|
|
OcurrioError = True
|
|
Exit For
|
|
End If
|
|
End If
|
|
Next
|
|
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
|
|
|
|
documentos += String.Format("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
|
|
|
|
End If
|
|
|
|
If Not OcurrioError AndAlso ObjConta.ValidacionesPrePoliza(NuevaCvePrePoliza, UsuarioActual, Opcion:=1) Then
|
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
|
GuardaLogAD($"Bancos/DepositoCaja | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{NuevaCvePrePoliza}", "LogPrePolizas")
|
|
OcurrioError = True
|
|
End If
|
|
End If
|
|
|
|
If OcurrioError Then
|
|
ObjConta.RollBack()
|
|
Alert("Ocurrio un error al realizar los depositos", TipoMensaje.MsgError)
|
|
Else
|
|
|
|
ObjConta.Commit()
|
|
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Prepóliza</a> <br/><br/> ", NuevaCvePrePoliza)
|
|
|
|
Alert(documentos.ToString)
|
|
CargaDatos()
|
|
|
|
End If
|
|
TxtComision.Text = ""
|
|
TxtDescuento.Text = ""
|
|
TxtIVA.Text = ""
|
|
TxtComisionIntermediario.Text = ""
|
|
lblValorTotal.Text = "0.0"
|
|
lblValorTotalSeleccionado.Text = "0.0"
|
|
CargaDatos()
|
|
ObjConta.Dispose()
|
|
End Sub
|
|
|
|
Private Sub ObtenerTotalImporta()
|
|
|
|
Dim Total As Double = 0
|
|
For Each Gvr As GridViewRow In GvFacturas.Rows
|
|
If Gvr.FCCheckBox("ChkFactura").Checked Then
|
|
Total += Gvr.DataKey("Importe").ToDouble
|
|
End If
|
|
Next
|
|
lblValorTotal.Text = Total.ToString("N")
|
|
UpGvFacturas.Update()
|
|
UpParametros.Update()
|
|
|
|
End Sub
|
|
|
|
Public Sub ChkFactura_Click(sender As Object, e As EventArgs)
|
|
'ObtenerTotalImporta()
|
|
End Sub
|
|
|
|
Protected Sub GvFacturas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvFacturas.RowDataBound
|
|
'If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
' If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoPago.SelectedValue.Contiene("11", "12", "-2") Then
|
|
' e.Row.FCCheckBox("ChkFactura").Checked = True
|
|
' e.Row.FCCheckBox("ChkFactura").Enabled = False
|
|
|
|
' End If
|
|
|
|
' e.Row.FCCheckBox("ChkFactura").Attributes.Add("onclick", String.Format("FnSuma(this,{0});", e.Row.DBCampo("Importe")))
|
|
' e.Row.FCCheckBox("ChkFactura").InputAttributes.Add("Value", e.Row.DBCampo("Importe"))
|
|
|
|
'End If
|
|
|
|
'If e.Row.RowType = DataControlRowType.Header Then
|
|
|
|
' If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
|
' RegistraScript("$('#C_GvFacturas_ChkSelector').attr('checked', true); $('#C_GvFacturas_ChkSelector').prop('disabled', 'disabled');")
|
|
' 'RegistraScript("$('#C_GvFacturas_ChkSelector').prop('disabled', 'disabled');")
|
|
' End If
|
|
|
|
'End If
|
|
|
|
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
|
e.Row.FCCheckBox("ChkFactura").Checked = True
|
|
If DdlTipoPago.SelectedValue.Contiene("11", "12", "-2") Then
|
|
e.Row.FCCheckBox("ChkFactura").Enabled = False
|
|
End If
|
|
|
|
End If
|
|
|
|
e.Row.FCCheckBox("ChkFactura").Attributes.Add("onclick", String.Format("FnSuma(this,{0});", e.Row.DBCampo("Importe")))
|
|
e.Row.FCCheckBox("ChkFactura").InputAttributes.Add("Value", e.Row.DBCampo("Importe"))
|
|
|
|
End If
|
|
|
|
If e.Row.RowType = DataControlRowType.Header Then
|
|
|
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DdlTipoPago.SelectedValue.Contiene("11", "12", "-2") Then
|
|
RegistraScript("$('#C_GvFacturas_ChkSelector').attr('checked', true); $('#C_GvFacturas_ChkSelector').prop('disabled', 'disabled');")
|
|
'RegistraScript("$('#C_GvFacturas_ChkSelector').prop('disabled', 'disabled');")
|
|
End If
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Protected Sub DdlTipoPago_SelectedIndexChanged(sender As Object, e As EventArgs)
|
|
If DdlTipoPago.SelectedValue = "12" Then
|
|
DDlMesesSinIntereses.Visible = True
|
|
Else
|
|
DDlMesesSinIntereses.Visible = False
|
|
End If
|
|
DDlMesesSinIntereses.SelectedValue = "-1"
|
|
End Sub
|
|
End Class |