option strict on

This commit is contained in:
2023-08-23 10:21:50 -07:00
parent 1ab4b815cd
commit bf1317817c
11 changed files with 107 additions and 118 deletions

View File

@@ -1,4 +1,7 @@
Imports System.Data
'Option Explicit On
'Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Ventas_ClientesAbonar
@@ -340,8 +343,8 @@ Partial Class Ventas_ClientesAbonar
Private Sub CargaDatos(pCveMoneda As Integer)
Dim Mov As New ClsMovimientos
Dim FechaI As String = IfNull(Request("FechaI"), "-1")
Dim FechaF As String = IfNull(Request("FechaF"), "-1")
Dim FechaI As String = IfNull(Request("FechaI"), "-1").ToString
Dim FechaF As String = IfNull(Request("FechaF"), "-1").ToString
Dim FechaCorte As Date = DateTime.Now.AddYears(1).ToShortDateString.ToString.ToDate
@@ -374,7 +377,7 @@ Partial Class Ventas_ClientesAbonar
'recargo la moneda con la que se va a pagar
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue)
Dim moneda As Integer = 0
If DdlCuenta.SelectedValue > 0 Then
If DdlCuenta.SelectedValue.ToEntero > 0 Then
moneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero
End If
@@ -426,7 +429,7 @@ Partial Class Ventas_ClientesAbonar
If ObjFolios.GetFolios("RMF", UsuarioActual.CveEmpresa) Then
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" Estado = 'Activo'"))
If DT.Rows.Count > 0 Then
TxtFolio.Text = DT.Rows(0)("FActual").ToString.ToEntero
TxtFolio.Text = DT.Rows(0)("FActual").ToString
End If
ObjFolios.Dispose()
End If
@@ -500,7 +503,7 @@ Partial Class Ventas_ClientesAbonar
Select Case RblTipoPago.SelectedValue
Case "1"
If DdlCuenta.SelectedValue > 0 Then
If DdlCuenta.SelectedValue.ToEntero > 0 Then
moneda = CveMonedaPago
ElseIf RblTipoPago.SelectedValue = "1" Then
e.Row.FCCheckBox("Chk").Enabled = False
@@ -530,13 +533,13 @@ Partial Class Ventas_ClientesAbonar
e.Row.FCTextBox("TxtAbonar").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},1,{2},{3});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), CveMonedaFiltro, moneda))
If UsuarioActual.Empresa.Funcionalidad(157).ToDecimal <> 0 Then
e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format("FnLimites({0},this,{1},{2},2);", e.Row.FCCheckBox("Chk").ClientID, -UsuarioActual.Empresa.Funcionalidad(157), UsuarioActual.Empresa.Funcionalidad(157).ToString.ToDecimal))
e.Row.FCRangeValidator("RVComision").MinimumValue = -UsuarioActual.Empresa.Funcionalidad(157).ToString.ToDecimal
e.Row.FCRangeValidator("RVComision").MaximumValue = UsuarioActual.Empresa.Funcionalidad(157).ToString.ToDecimal
e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format("FnLimites({0},this,{1},{2},2);", e.Row.FCCheckBox("Chk").ClientID, (-UsuarioActual.Empresa.Funcionalidad(157).ToDecimal).ToString, UsuarioActual.Empresa.Funcionalidad(157).ToString.ToDecimal))
e.Row.FCRangeValidator("RVComision").MinimumValue = (-UsuarioActual.Empresa.Funcionalidad(157).ToDecimal).ToString
e.Row.FCRangeValidator("RVComision").MaximumValue = UsuarioActual.Empresa.Funcionalidad(157).ToString
e.Row.FCRangeValidator("RVComision").Enabled = True
Else
e.Row.FCTextBox("TxtComision").Attributes.Add("onblur", String.Format("FnCambia({0},this,{1},2,{2},{3});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"), CveMonedaFiltro, moneda))
e.Row.FCRangeValidator("RVComision").MinimumValue = 0.00
e.Row.FCRangeValidator("RVComision").MinimumValue = "0.00"
e.Row.FCRangeValidator("RVComision").MaximumValue = e.Row.DBCampo("Saldo")
End If
@@ -741,7 +744,7 @@ Partial Class Ventas_ClientesAbonar
Dim ConceptoPoliza As String = String.Format("{0} {1}", TxtAboneA.Text, TxtObservaciones.Text)
If DdlCuenta.SelectedValue > 0 Then
If DdlCuenta.SelectedValue.ToEntero > 0 Then
CveMoneda = GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero}").ToEntero
Else
CveMoneda = IfNull(Request("CveMoneda"), "1").ToString.ToEntero
@@ -908,7 +911,7 @@ Partial Class Ventas_ClientesAbonar
If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
Pago.TCPago = TxtTC.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
Pago.TCPago = IIf(TxtTCDolaresDolares.Visible, TxtTCDolaresDolares.Text.ToDecimal, TxtTCDolares.Text.ToDecimal)
Pago.TCPago = If(TxtTCDolaresDolares.Visible, TxtTCDolaresDolares.Text.ToDecimal, TxtTCDolares.Text.ToDecimal)
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
Pago.TCPago = TxtTCDolares.Text.ToDecimal
End If
@@ -951,55 +954,55 @@ Partial Class Ventas_ClientesAbonar
End If
If ImporteLiq2 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, ImporteLiq2 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, ImporteLiq2 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq3 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, ImporteLiq3 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, ImporteLiq3 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq4 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, ImporteLiq4 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, ImporteLiq4 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq5 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, ImporteLiq5 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, ImporteLiq5 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq6 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, ImporteLiq6 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, ImporteLiq6 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq7 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, ImporteLiq7 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, ImporteLiq7 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq8 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, ImporteLiq8 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol8, ImporteME:=If(CveMoneda > 1, ImporteLiq8, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, ImporteLiq8 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol8, ImporteME:=If(CveMoneda > 1, ImporteLiq8, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq9 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq9, ImporteLiq9 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol9, ImporteME:=If(CveMoneda > 1, ImporteLiq9, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq9, ImporteLiq9 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol9, ImporteME:=If(CveMoneda > 1, ImporteLiq9, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq10 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq10, ImporteLiq10 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol10, ImporteME:=If(CveMoneda > 1, ImporteLiq10, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq10, ImporteLiq10 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol10, ImporteME:=If(CveMoneda > 1, ImporteLiq10, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
@@ -1008,8 +1011,8 @@ Partial Class Ventas_ClientesAbonar
Dim TCP As Decimal = 0
Dim FolioPago As String = " "
If DtIngresos IsNot Nothing Then
TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue))
FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue))
TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)).ToDecimal
FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue))
Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti").SelectedValue)).ToDate
'considera fluctuación
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
@@ -1028,7 +1031,7 @@ Partial Class Ventas_ClientesAbonar
Dim TCP As Decimal = 0
Dim FolioPago As String = " "
If DtIngresos IsNot Nothing Then
TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue))
TCP = DtIngresos.FiltroPrimeroValor("TipoCambio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)).ToDecimal
FolioPago = DtIngresos.FiltroPrimeroValor("Folio", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue))
Dim tTCPFecha As Date = DtIngresos.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE={0}", gvr.FCDropDownList("DdlAnti2").SelectedValue)).ToDate
'considera fluctuación
@@ -1399,9 +1402,9 @@ Partial Class Ventas_ClientesAbonar
ObjFacturaDevolucion.ClaveMetodoPagoSAT = "PUE"
Dim drtt As DataRow = GlobalDTTipoTransacciones.FiltroPrimero("CveTipoTransaccion =" & DdlTipoTransaccion.SelectedValue)
Dim dra As DataRow = GlobalDTVtaFormaPago.FiltroPrimero("CveFormaPago = " & drtt("CveFormaPago"))
Dim dra As DataRow = GlobalDTVtaFormaPago.FiltroPrimero("CveFormaPago = " & drtt("CveFormaPago").ToString)
ObjFacturaDevolucion.CveFormaPago33 = dra("CveFormaPago").ToString
ObjFacturaDevolucion.CveFormaPago33 = dra("CveFormaPago").ToString.ToEntero
ObjFacturaDevolucion.FormaPago33 = dra("FormaPagoSAT").ToString
ObjFacturaDevolucion.FormaPagoSAT33 = dra("ClaveFormaPagoSAT").ToString
@@ -1421,7 +1424,7 @@ Partial Class Ventas_ClientesAbonar
ObjFacturaDevolucion.DtDetalle = CreaDTDetalleNC()
CargaImpuestos(ObjFacturaDevolucion, ListaVentasGenerarNC, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA, ObjCliente.RetISR)
CargaImpuestos(ObjFacturaDevolucion, ListaVentasGenerarNC, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA.ToDecimal, ObjCliente.RetISR.ToDecimal)
End If
End If
@@ -1516,7 +1519,7 @@ Partial Class Ventas_ClientesAbonar
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion, ListaVentasGenerarNC)
Try
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion, ObjContPaqTransac:=ObjConta)
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion)
Retorno.Respuesta = Resp
Catch ex As Exception
OnError("Ocurrió un error al guardar la NC de pronto pago", ex)
@@ -2135,7 +2138,7 @@ Partial Class Ventas_ClientesAbonar
#Region " CUENTAS DEPOSITOS"
Private Sub CargaCuentasDepositos()
DdlCuentaDeposito.Items.Clear()
If DdlTipoTransaccion.SelectedValue > 0 Then ' transferencias y layout
If DdlTipoTransaccion.SelectedValue.ToEntero > 0 Then ' transferencias y layout
trCuentaDeposito.Visible = False
Dim dtc As DataTable = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente)
@@ -2304,7 +2307,7 @@ Partial Class Ventas_ClientesAbonar
Dim TCVenta As Decimal = gr.DataKey("TipoCambio").ToDecimal
Dim FechaVenta As Date = gr.DataKey("Fecha").ToDate
Dim tCveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).FormatoNumero(4)
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaIncobrable.Text.ToDate).FormatoNumero(4).ToDecimal
Dim CveConceptoDeduccion As Integer = DdlTipoDeduccion.SelectedValue.ToEntero
'si la fecha del documento es anterior a su ultima fluctuación. toma el Tc de la fluctuacion
@@ -2379,10 +2382,10 @@ Partial Class Ventas_ClientesAbonar
End If
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, PorcentajeImpuesto:=gr.DataKey("PorcentajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), 13, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, PorcentajeImpuesto:=gr.DataKey("PorcentajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), gr.DataKey("SerieFolio").ToString, 8, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), 8, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), 38, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
@@ -2515,12 +2518,9 @@ Partial Class Ventas_ClientesAbonar
Case Else
End Select
LblValidaCeuntaTipoTransaccion.Text = Mensaje
If Not Mensaje.Length = 0 Then
'Alert(Mensaje, TipoMensaje.MsgAdvertencia)
LblValidaCeuntaTipoTransaccion.Visible = True
@@ -2565,7 +2565,7 @@ Partial Class Ventas_ClientesAbonar
Private Sub DdlIngreso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlIngreso.SelectedIndexChanged
'saco la moneda de la selección
HdnIngresoImporte.Value = 0
HdnIngresoImporte.Value = "0"
If DdlIngreso.SelectedValue.ToEntero > 0 Then
Dim Banco As New ClsBancos
@@ -2575,7 +2575,7 @@ Partial Class Ventas_ClientesAbonar
If Deudores.GetIngresosSaldosDetalle(CveCliente, -1, UsuarioActual.CveEmpresa) Then
HdnIngresoImporte.Value = Deudores.DtResultados.FiltroPrimeroValor("Saldo", String.Format("CveIE = {0}", DdlIngreso.SelectedValue))
TxtTCDolares.Text = Deudores.DtResultados.FiltroPrimeroValor("TipoCambio", String.Format("CveIE = {0}", DdlIngreso.SelectedValue))
FechaIngreso = Deudores.DtResultados.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE = {0}", DdlIngreso.SelectedValue))
FechaIngreso = Deudores.DtResultados.FiltroPrimeroValor("FechaDocumento", String.Format("CveIE = {0}", DdlIngreso.SelectedValue)).ToDate
End If
Deudores.Dispose()
End If