-- option strict on

This commit is contained in:
2023-08-23 00:03:55 -07:00
parent 7ee978059d
commit 3bc4f72658
23 changed files with 212 additions and 257 deletions

View File

@@ -1,4 +1,4 @@

Option Strict Off
Imports System.Data
'Imports DocumentFormat.OpenXml
Imports Extensiones
@@ -448,9 +448,9 @@ Partial Class ContabilidadC_RegPrePolizaS
LblEncabezado.Text = "Edición de Póliza"
ViewState("CvePrePoliza") = tCvePrePoliza
DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza")
TxtFechaDocumento.Text = dr("Fecha")
TxtConcepto.Text = dr("Concepto")
DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza").ToString
TxtFechaDocumento.Text = dr("Fecha").ToString.ToDate.ToShortDateString
TxtConcepto.Text = dr("Concepto").ToString
DivDatosPoliza.Visible = True
TipoPoliza = DdlTipoPoliza.SelectedItem.Text
Folio = dr("FolioPoliza").ToString
@@ -458,7 +458,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFolio.Text = dr("FolioPoliza").ToString
TxtUsuarioElaboro.Text = dr("Usuario").ToString
TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy")
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero
HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=PREPO&CvePrePoliza={CvePrePoliza}")}"
HplImprimirPDF.Visible = True
If UsuarioActual.CveRol = 1 Then
@@ -568,7 +568,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
If CveConceptoContable.Contiene(30, 204, 66, 92, 202, 10, 21, 48, 56, 338, 339, 340, 345, 346, 347) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
If e.Row.DBCampo("Modificado") Then
If e.Row.DBCampo("Modificado") = "True" Then
e.Row.FCCheckBox("chkModificado").Checked = True
End If
End If
@@ -719,7 +719,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim ObjVentas As New ClsVentas
DdlVentas.ClearSelection()
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0")
DdlVentas.DataBind()
DdlVentas.Items.Insert(0, New ListItem(" - ", "-1"))
@@ -827,8 +827,8 @@ Partial Class ContabilidadC_RegPrePolizaS
e.Row.FCTextBox("TxtCargo").Visible = True
End If
e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono"))
e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo"))
e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = "0", "", e.Row.DBCampo("Abono"))
e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = "0", "", e.Row.DBCampo("Cargo"))
e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion")
If CvePeriodo > 0 Then
@@ -988,14 +988,14 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim tCveMoneda As Integer = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda").ToEntero
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, tFolio,
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, tFolio,
gvr.DataKey("ContadoBeneficiario"), gvr.DataKey("ContadoImporte").ToDecimal, tCveMoneda, 0, gvr.DataKey("ContadoObservaciones"), "",
False, False, 0, CvePrePolizaInsertada, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveIE < 0 Then
MsgError = "No se pudo registrar movimiento bancario"
Exit For
Else
If tFolio > 0 Then
If tFolio <> "0" Or tFolio <> "" Then
FolioIE = tFolio
Else
FolioIE = ObjIE.Folio
@@ -1156,7 +1156,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If row.DataKey("CveConceptoContable").ToEntero = 30 AndAlso ImporteIE > 0 AndAlso row.DataKey("CveIE").ToDecimal <= 0 Then
Dim ObjIE As New ClsBancos(ObjContabilidad.IniciaTransacSQL)
CveIEAgregado = ObjIE.AddBancos_IE(row.DataKey("ContadoCuenta").ToEntero, row.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, row.DataKey("ContadoNumeroFolio"),
CveIEAgregado = ObjIE.AddBancos_IE(row.DataKey("ContadoCuenta").ToEntero, row.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, row.DataKey("ContadoNumeroFolio"),
row.DataKey("ContadoBeneficiario"), ImporteIE, CveMoneda, 0, row.DataKey("ContadoObservaciones"), "",
False, False, 0, row.DataKey("CvePrePoliza").ToEntero, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveIEAgregado < 0 Then
@@ -1185,7 +1185,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If row.DataKey("CveConceptoContable").ToEntero = 30 AndAlso ImporteIE > 0 AndAlso row.DataKey("CveIE").ToDecimal <= 0 Then
Dim ObjIE As New ClsBancos(ObjContabilidad.IniciaTransacSQL)
CveIEAgregado = ObjIE.AddBancos_IE(row.DataKey("ContadoCuenta").ToEntero, row.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, row.DataKey("ContadoNumeroFolio"),
CveIEAgregado = ObjIE.AddBancos_IE(row.DataKey("ContadoCuenta").ToEntero, row.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, row.DataKey("ContadoNumeroFolio"),
row.DataKey("ContadoBeneficiario"), ImporteIE, CveMoneda, 0, row.DataKey("ContadoObservaciones"), "",
False, False, 0, row.DataKey("CvePrePoliza").ToEntero, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveIEAgregado < 0 Then
@@ -1232,7 +1232,7 @@ Partial Class ContabilidadC_RegPrePolizaS
CargaPrePoliza(CvePrePoliza)
If Not OcurrioError Then
If IdPoliza > 0 AndAlso contador Then
If IdPoliza > 0 AndAlso contador > 0 Then
Contabilizar()
End If
@@ -1301,8 +1301,8 @@ Partial Class ContabilidadC_RegPrePolizaS
DvModalconceptoCliente.Visible = True
'DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "")
DdlClientesE.ddl.Items.Insert(0, New ListItem(GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", ""), CveCliente))
DdlClientesE.SelectedValue = CveCliente
DdlClientesE.ddl.Items.Insert(0, New ListItem(GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", ""), CveCliente.ToString))
DdlClientesE.SelectedValue = CveCliente.ToString
CargaVentasE(CveCliente)
End If
@@ -1311,7 +1311,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
If CveClasificacion > 0 Then
DdlClasificacionesE.SelectedValue = CveClasificacion
DdlClasificacionesE.SelectedValue = CveClasificacion.ToString
End If
TxtConceptoE.Text = Concepto
TxtReferenciaE.Text = Referencia
@@ -1323,13 +1323,8 @@ Partial Class ContabilidadC_RegPrePolizaS
DdlCuentaContableE.SelectedValueExist(CveCuenta)
If Cargo <> 0 Then
TxtCargoE.Text = Cargo
End If
If Abono <> 0 Then
TxtAbonoE.Text = Abono
End If
If Cargo <> 0 Then TxtCargoE.Text = Cargo.FormatoNumero
If Abono <> 0 Then TxtAbonoE.Text = Abono.FormatoNumero
If CveConceptoContable = 30 Then
If Abono = 0 Then
@@ -1588,7 +1583,7 @@ Partial Class ContabilidadC_RegPrePolizaS
DdlVentasE.ClearSelection()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
If CveMoneda = 2 Then
DdlVentasE.DataSource = ObjVentas.DtResultados.FiltraParametros("CveMoneda = 2")
Else
@@ -1626,7 +1621,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Private Function CargaValidacionesConcepto() As Boolean
Dim Retorno As Boolean = True
If DdlConceptosContablesE.SelectedValue <= 0 Then
If DdlConceptosContablesE.SelectedValue.ToEntero <= 0 Then
Alert("No se ha especificado el concepto", TipoMensaje.ToastAdventencia)
Return False
End If
@@ -1636,7 +1631,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim AplicaBancos = Boolean.Parse(DrConceptoContable("AplicaBancos").ToString)
If AplicaComplementaria Then
Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
Dim Importe As Decimal = If(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
'valida Mon Extranjera por el TC - Mon Extranjera
Dim dif As Decimal = ((TxtME.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal).RoundSQL - TxtME.Text.ToDecimal).RoundSQL - Importe
@@ -1706,7 +1701,7 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("EsComplementaria") = DrConceptoContable("EsComplementaria")
dr("EsMonedaExtranjera") = DrConceptoContable("EsMonedaExtranjera")
If dr("EsMonedaExtranjera") = "True" Then dr("ImporteME") = TxtME.Text.ToDecimal
If dr("EsMonedaExtranjera").ToString = "True" Then dr("ImporteME") = TxtME.Text.ToDecimal
End If
If DdlPorcentajeIVAE.Visible Then
@@ -1716,7 +1711,7 @@ Partial Class ContabilidadC_RegPrePolizaS
DtMovimientos.Rows.Add(dr)
DtMovimientos.AcceptChanges()
If CvePrePoliza > 0 Or CvePrePolizaOrigen Then
If CvePrePoliza > 0 Or CvePrePolizaOrigen > 0 Then
GvPrePoliza.DataSource = DtMovimientos
GvPrePoliza.DataBind()
UpPrePoliza.Visible = True
@@ -1769,7 +1764,7 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("EsComplementaria") = DrConceptoContable("EsComplementaria")
dr("EsMonedaExtranjera") = DrConceptoContable("EsMonedaExtranjera")
If dr("EsMonedaExtranjera") = "True" Then dr("ImporteME") = TxtME.Text.ToDecimal
If dr("EsMonedaExtranjera").ToString = "True" Then dr("ImporteME") = TxtME.Text.ToDecimal
End If
@@ -2117,7 +2112,7 @@ Partial Class ContabilidadC_RegPrePolizaS
DdlCuentaContable.SelectedValueExist(DrM("CveCuenta").ToString)
TxtReferencia.Text = DrM("Referencia").ToString
TxtConcepto.Text = DrM("Concepto")
TxtConcepto.Text = DrM("Concepto").ToString
' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto")
DrM("EsComodin") = 0
DdlConceptosContables.SelectedValueExist(DrM("CveConceptoContable").ToString)
@@ -2236,7 +2231,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(UsuarioActual.CveEmpresa, CvePlantilla).FiltraParametros("", "Orden")
Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows
Dim DtExcel As DataTable = (From row In Dt.AsEnumerable
Select New With
{
.ConceptoAdministrativo = row.Item("ConceptoContable"),
@@ -2405,11 +2400,11 @@ Partial Class ContabilidadC_RegPrePolizaS
'carga el consecutivo
If FolioExcel = 0 Then
FolioExcel = SiguienteFolioBancos(CveBancoCuenta, TipoMov)
FolioExcel = SiguienteFolioBancos(CveBancoCuenta, TipoMov).ToLong
End If
Folio = FolioExcel
ImporteDocumento = IIf(Row("Abono").ToString.ToDecimal <> 0, Row("Abono").ToString.ToDecimal, Row("Cargo").ToString.ToDecimal)
Folio = FolioExcel.ToString
ImporteDocumento = If(Row("Abono").ToString.ToDecimal <> 0, Row("Abono").ToString.ToDecimal, Row("Cargo").ToString.ToDecimal)
Observaciones = Row("Referencia").ToString
Beneficiario = Row("Concepto").ToString
@@ -2579,7 +2574,7 @@ Partial Class ContabilidadC_RegPrePolizaS
ArregloCuentasFolios.AcceptChanges()
Return Folio
Return Folio.ToString
End Function
#End Region
@@ -2689,9 +2684,9 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("")
If dr IsNot Nothing Then
DivAgregarConceptos.Visible = False
DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza")
TxtFechaDocumento.Text = dr("Fecha")
TxtConcepto.Text = dr("Concepto")
DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza").ToString
TxtFechaDocumento.Text = dr("Fecha").ToString.ToDate.ToShortDateString
TxtConcepto.Text = dr("Concepto").ToString
DivDatosPoliza.Visible = True
TipoPoliza = DdlTipoPoliza.SelectedItem.Text
Folio = dr("FolioPoliza").ToString
@@ -2700,7 +2695,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtUsuarioElaboro.Text = dr("Usuario").ToString
TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy")
' TxtEstatus.Text = If(Boolean.Parse(dr("Estatus").ToString), "Activa", "Inactiva")
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
'DivAgregarConceptos.Visible = True
@@ -2874,7 +2869,7 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim tFolio As String = gvr.DataKey("ContadoNumeroFolio").ToString
If tFolio.ToEntero = 0 Then tFolio = SiguienteFolioBancos(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero)
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text, tFolio,
CveIE = ObjIE.AddBancos_IE(gvr.DataKey("ContadoCuenta").ToEntero, gvr.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, tFolio,
gvr.DataKey("ContadoBeneficiario").ToString, Importe, CveMoneda, 0, gvr.DataKey("ContadoObservaciones").ToString, "",
False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
FolioIE = gvr.DataKey("ContadoNumeroFolio").ToString
@@ -2928,11 +2923,11 @@ Partial Class ContabilidadC_RegPrePolizaS
MsgError = "Error"
End Try
If MsgError = "" Then
If Not ObjMov.UpdatePrePolizasOrdenamiento(CvePrePoliza, UsuarioActual.CveEmpresa) Then
MsgError = "Orror al ordenar polzia"
End If
End If
'If MsgError = "" Then
' If ObjMov.UpdatePrePolizasOrdenamiento(CvePrePoliza, UsuarioActual.CveEmpresa) <= 0 Then
' MsgError = "Error al ordenar póliza"
' End If
'End If
If MsgError = "" Then
Alert(If(MensajeAlert.ToString = "", $"Se registro con exito. {If(FolioPoliza > 0, " Folio " & FolioPoliza & ".", "")}", $"Se registro con exito. {If(FolioPoliza > 0, " Folio " & FolioPoliza & ".", "")} <br>" & MensajeAlert.ToString), TipoMensaje.MsgInformacion, $"window.location.href=""./RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}""")
@@ -3039,7 +3034,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If Venta.GetVenta(DdlVentasE.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
Dim dr As DataRow = Venta.DtResultados.FiltroPrimero("")
If dr IsNot Nothing Then
TxtTipoCambio.Text = dr("TipoCambioValuacion")
TxtTipoCambio.Text = dr("TipoCambioValuacion").ToString
End If
End If