This commit is contained in:
Oscar Irigoyen
2023-01-26 12:01:56 -07:00
17 changed files with 849 additions and 765 deletions

View File

@@ -1466,7 +1466,7 @@ Public Class ClsBancos
Public Function AddBancos_IE(CveCuenta As Integer, CveTipoTransaccion As Integer, FechaDocumento As Date, Folio As String, PagueseA As String, Importe As Double, CveMoneda As Integer, TipoCambio As Double, Observaciones As String, Public Function AddBancos_IE(CveCuenta As Integer, CveTipoTransaccion As Integer, FechaDocumento As Date, Folio As String, PagueseA As String, Importe As Double, CveMoneda As Integer, TipoCambio As Double, Observaciones As String,
NotificarA As String, EsAbonoEnCuenta As Boolean, AplicaImpuestos As Boolean, IDPoliza As Integer, CvePrePoliza As Integer, Comprobante As String, CveUsuario As Integer, CveEmpresa As Integer, NotificarA As String, EsAbonoEnCuenta As Boolean, AplicaImpuestos As Boolean, IDPoliza As Integer, CvePrePoliza As Integer, Comprobante As String, CveUsuario As Integer, CveEmpresa As Integer,
Optional CveCuentaDeposito As Integer = -1, Optional PagoElectronico As String = "-1", Optional CveEstatusIE As Integer = 1, Optional CveCuentaTarjeta As Integer = -1, Optional CveCuentaDeposito As Integer = -1, Optional PagoElectronico As String = "-1", Optional CveEstatusIE As Integer = 1, Optional CveCuentaTarjeta As Integer = -1,
Optional Referencia As String = "-1", Optional CveIESustitucion As Integer = -1, Optional CveCorte As Integer = -1, Optional CveProveedorIntermediario As Integer = -1, Optional FueConciliado As Boolean = False, Optional Referencia As String = "-1", Optional CveCorte As Integer = -1, Optional CveProveedorIntermediario As Integer = -1, Optional FueConciliado As Boolean = False,
Optional MesesSinIntereses As Integer = -1, Optional Modulo As String = "", Optional ConceptoCIE As String = "", Optional CveOCAnticipo As Integer = -1) As Integer Optional MesesSinIntereses As Integer = -1, Optional Modulo As String = "", Optional ConceptoCIE As String = "", Optional CveOCAnticipo As Integer = -1) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
@@ -1497,7 +1497,6 @@ Public Class ClsBancos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCuentaTarjeta", SqlDbType.Int).Value = CveCuentaTarjeta .Add("@CveCuentaTarjeta", SqlDbType.Int).Value = CveCuentaTarjeta
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia .Add("@Referencia", SqlDbType.VarChar).Value = Referencia
.Add("@CveIESustitucion", SqlDbType.Int).Value = CveIESustitucion
.Add("@CveCorte", SqlDbType.Int).Value = CveCorte .Add("@CveCorte", SqlDbType.Int).Value = CveCorte
.Add("@CveProveedorIntermediario", SqlDbType.Int).Value = CveProveedorIntermediario .Add("@CveProveedorIntermediario", SqlDbType.Int).Value = CveProveedorIntermediario
.Add("@FueConciliado", SqlDbType.Bit).Value = FueConciliado .Add("@FueConciliado", SqlDbType.Bit).Value = FueConciliado

View File

@@ -363,45 +363,51 @@ Public Class ClsPaginas
End Property End Property
#Region "GLOBALES DE SAT COMERCIO EXTERIOR" #Region "GLOBALES DE SAT COMERCIO EXTERIOR"
Public Shared Property GlobalDTClavePedimento() As DataTable
Property GlobalDTClavePedimento() As DataTable
Get Get
GlobalDTClavePedimento = DirectCast(Application("GlobalDTClavePedimento"), DataTable) Dim AppNombre As String = "GlobalDTClavePedimento"
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATClavePedimento() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados
ObjGrales.Dispose()
End If
GlobalDTClavePedimento = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTClavePedimento") = value Dim AppNombre As String = "GlobalDTClavePedimento"
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTFraccionArancelaria() As DataTable Public Shared Property GlobalDTFraccionArancelaria() As EnumerableRowCollection(Of DataRow)
Get Get
Dim AppNombre As String = "GlobalDTFraccionArancelaria" Dim AppNombre As String = "GlobalDTFraccionArancelaria"
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjGrales As New ClsGenerales Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATFraccionArancelaria() Then Application(AppNombre) = ObjGrales.DtResultados.AsEnumerable() If ObjGrales.GetSATFraccionArancelaria() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados.AsEnumerable()
ObjGrales.Dispose() ObjGrales.Dispose()
End If End If
GlobalDTFraccionArancelaria = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable GlobalDTFraccionArancelaria = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
End Get End Get
Set(value As DataTable) Set(value As EnumerableRowCollection(Of DataRow))
Dim AppNombre As String = "GlobalDTFraccionArancelaria" Dim AppNombre As String = "GlobalDTFraccionArancelaria"
Application(AppNombre) = value HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTIncoterm() As DataTable Public Shared Property GlobalDTIncoterm() As DataTable
Get Get
Dim AppNombre As String = "GlobalDTIncoterm" Dim AppNombre As String = "GlobalDTIncoterm"
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjGrales As New ClsGenerales Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATIncoterm() Then Application(AppNombre) = ObjGrales.DtResultados If ObjGrales.GetSATIncoterm() Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados
ObjGrales.Dispose() ObjGrales.Dispose()
End If End If
GlobalDTIncoterm = DirectCast(Application(AppNombre), DataTable) GlobalDTIncoterm = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = "GlobalDTIncoterm" Dim AppNombre As String = "GlobalDTIncoterm"
Application(AppNombre) = value HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
@@ -816,57 +822,55 @@ Public Class ClsPaginas
End Property End Property
#Region "C A R T A P O R T E " #Region "C A R T A P O R T E "
Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable Public Shared Property GlobalDTMaterialPeligroso(Optional CveMaterialPeligroso As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = "GlobalDTMaterialPeligroso" Dim AppNombre As String = "GlobalDTMaterialPeligroso"
'sino existe, recarga los datos If HttpContext.Current.Application(AppNombre) Is Nothing Then
If Application(AppNombre) Is Nothing Then
Dim Obj As New ClsGenerales Dim Obj As New ClsGenerales
If Obj.GetMaterialPeligroso() Then Application(AppNombre) = Obj.DtResultados If Obj.GetMaterialPeligroso() Then HttpContext.Current.Application(AppNombre) = Obj.DtResultados
Obj.Dispose() Obj.Dispose()
End If End If
If CveMaterialPeligroso > 0 Then If CveMaterialPeligroso > 0 Then
Dim Str As New StringBuilder Dim Str As New StringBuilder
Str.AppendFormat("CveMaterialPeligroso = {0}", CveMaterialPeligroso) Str.AppendFormat("CveMaterialPeligroso = {0}", CveMaterialPeligroso)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTMaterialPeligroso = Dv.ToTable GlobalDTMaterialPeligroso = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTMaterialPeligroso = DirectCast(Application(AppNombre), DataTable) GlobalDTMaterialPeligroso = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = "GlobalDTMaterialPeligroso" Dim AppNombre As String = "GlobalDTMaterialPeligroso"
Application(AppNombre) = value HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable Public Shared Property GlobalDTEmbalajes(Optional CveEmbalaje As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = "GlobalDTEmbalajes" Dim AppNombre As String = "GlobalDTEmbalajes"
'sino existe, recarga los datos If HttpContext.Current.Application(AppNombre) Is Nothing Then
If Application(AppNombre) Is Nothing Then
Dim Obj As New ClsGenerales Dim Obj As New ClsGenerales
If Obj.GetEmbalajes() Then Application(AppNombre) = Obj.DtResultados If Obj.GetEmbalajes() Then HttpContext.Current.Application(AppNombre) = Obj.DtResultados
Obj.Dispose() Obj.Dispose()
End If End If
If CveEmbalaje > 0 Then If CveEmbalaje > 0 Then
Dim Str As New StringBuilder Dim Str As New StringBuilder
Str.AppendFormat("CveEmbalaje = {0}", CveEmbalaje) Str.AppendFormat("CveEmbalaje = {0}", CveEmbalaje)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTEmbalajes = Dv.ToTable GlobalDTEmbalajes = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTEmbalajes = DirectCast(Application(AppNombre), DataTable) GlobalDTEmbalajes = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = "GlobalDTEmbalajes" Dim AppNombre As String = "GlobalDTEmbalajes"
Application(AppNombre) = value HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
#End Region #End Region
@@ -4797,6 +4801,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Bancos/PopUpBuscaPersonal.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscaPersonal.aspx".ToUpper(), 281)
PaginaDict.Add("/Bancos/PopUpBuscarColectiva.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarColectiva.aspx".ToUpper(), 281)
PaginaDict.Add("/Bancos/PopUpBuscarProveedor.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarProveedor.aspx".ToUpper(), 281)
'PaginaDict.Add("/Bancos/PopUpBuscarCuentasProveedor.aspx".ToUpper(), 281)
PaginaDict.Add("/Bancos/PopUpBuscarFolioC.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarFolioC.aspx".ToUpper(), 281)
PaginaDict.Add("/Bancos/PopUpBuscarClientes.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarClientes.aspx".ToUpper(), 281)
'PaginaDict.Add("/Bancos/CatTiposCuenta.aspx".ToUpper(), -1) 'PaginaDict.Add("/Bancos/CatTiposCuenta.aspx".ToUpper(), -1)
@@ -4848,6 +4853,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Bancos/ProveedoresCreditos.aspx".ToUpper(), 528) PaginaDict.Add("/Bancos/ProveedoresCreditos.aspx".ToUpper(), 528)
PaginaDict.Add("/Bancos/RepSaldosPeriodo.aspx".ToUpper(), 884) PaginaDict.Add("/Bancos/RepSaldosPeriodo.aspx".ToUpper(), 884)
PaginaDict.Add("/Bancos/PrestamoPersonal.aspx".ToUpper(), 890) PaginaDict.Add("/Bancos/PrestamoPersonal.aspx".ToUpper(), 890)
PaginaDict.Add("/Bancos/PopUpBuscarCuentasProveedor.aspx".ToUpper(), 679)
#End Region #End Region
#Region "CGame" #Region "CGame"
@@ -4984,9 +4990,6 @@ Public Class ClsPaginas
PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759) PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759)
#End Region #End Region
'CONTABILIDAD 'CONTABILIDAD
@@ -10381,7 +10384,8 @@ Public Class ClsPaginas
End If End If
If VentaActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares If VentaActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares
tImportePago = ((Pago.ImportePago * TCValuacionVenta / Pago.TCPago).RoundSQL * Pago.TCPago).RoundSQL tImportePago = ((Pago.ImportePago * TCValuacionVenta / Pago.TCPago) * Pago.TCPago).RoundSQL
tImporteVenta = (Pago.ImportePago * TCValuacionVenta).RoundSQL
ElseIf VentaActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares ElseIf VentaActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares
tImporteVenta = (Pago.ImportePago * TCValuacionVenta).RoundSQL tImporteVenta = (Pago.ImportePago * TCValuacionVenta).RoundSQL
tImportePago = (Pago.ImportePago * TCValuacionPago).RoundSQL tImportePago = (Pago.ImportePago * TCValuacionPago).RoundSQL
@@ -10426,12 +10430,12 @@ Public Class ClsPaginas
ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
End If End If
@@ -10441,12 +10445,12 @@ Public Class ClsPaginas
ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
End If End If
@@ -10464,12 +10468,12 @@ Public Class ClsPaginas
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
End If End If
'concepto pago 'concepto pago
@@ -10557,6 +10561,7 @@ Public Class ClsPaginas
Dim ConceptoContable, IdCtaContable As Integer Dim ConceptoContable, IdCtaContable As Integer
Dim TipoMovimiento As Boolean Dim TipoMovimiento As Boolean
Dim Diferencia As Decimal = 0 Dim Diferencia As Decimal = 0
tImportePago +=Pago.ImporteFluctuacionAdicional 'para los casos de aplicación de
If tImporteVenta <> tImportePago Then If tImporteVenta <> tImportePago Then
If tImporteVenta < tImportePago Then If tImporteVenta < tImportePago Then
@@ -10608,6 +10613,7 @@ Public Class ClsPaginas
Public Property CveCreditoDetalle As Integer = -1 Public Property CveCreditoDetalle As Integer = -1
Public Property AplicaTraslado As Boolean = True Public Property AplicaTraslado As Boolean = True
Public Property Referencia As String Public Property Referencia As String
Public Property ImporteFluctuacionAdicional As Decimal = 0
End Class End Class

View File

@@ -2464,7 +2464,7 @@ Namespace Modelos
If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementariaClientes) Then If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementariaClientes) Then
importeMX = importeMovimiento importeMX = importeMovimiento
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=Math.Round(importeMovimiento * TCCliente - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=If(TCCliente = 1, 0, importeMovimiento), TipoCambio:=TCCliente, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=(importeMovimiento * TCCliente - importeMovimiento).RoundSQL, ImporteME:=If(TCCliente = 1, 0, importeMovimiento), TipoCambio:=TCCliente, CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
@@ -2636,7 +2636,7 @@ Namespace Modelos
If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementariaClientes) Then If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsaComplementariaClientes) Then
importeMX = importeMovimiento importeMX = importeMovimiento
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=Math.Round(importeMovimiento * tipoCambio - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, 203, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=(importeMovimiento * tipoCambio - importeMovimiento).RoundSQL, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If
@@ -3452,16 +3452,6 @@ Namespace Modelos
End If End If
importeMovimiento = 0 importeMovimiento = 0
'Case 103 'Descuento
' 'si se amortiza anticipo por concepto de descuento, no debe de registrar esta partida.
' If ObjFactura.CveTipoAmortizacionAnticipo <> 1 Then
' importeMovimiento = (ObjFactura.Descuento * ValorMultiplicador)
' importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
' FechaMovimiento = ObjFactura.FechaPago
' If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
' IdCtaContable = 0
' End If
Case 8 'Ret IVA por Trasladar Case 8 'Ret IVA por Trasladar
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoRetencion <> 4 Then 'SI NO ES RETENCION DE IVA DE SERVICIOS If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoRetencion <> 4 Then 'SI NO ES RETENCION DE IVA DE SERVICIOS
importeMovimiento = (ObjFactura.RetIVA * ValorMultiplicador) importeMovimiento = (ObjFactura.RetIVA * ValorMultiplicador)
@@ -3490,31 +3480,6 @@ Namespace Modelos
End If End If
Case 313 'Ret Iva Servicios
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") AndAlso ObjFactura.CveTipoRetencion = 4 Then 'SI TIENE RETENCION DE IVA DE SERVICIOS
importeMovimiento = ObjFactura.RetIVA * ValorMultiplicador
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago
CveSubProyectoContabilizar = CveSubProyectoVenta
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
If ValorMultiplicador = -1 AndAlso ObjFactura.Alfa3 = "DEV" AndAlso ObjFactura.TipoDocto = "Dev" Then
TipoMovimiento = Not TipoMovimiento
ConceptoContable = 314
importeMovimiento = importeMovimiento * -1
importeMX = importeMX * -1
End If
'OBTENER CUENTAS
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjConta.DtResultados.Rows.Count > 0 Then
'Conta ContPAQ
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If
End If
Case 9 'Ret ISR por Trasladar Case 9 'Ret ISR por Trasladar
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then
importeMovimiento = (ObjFactura.RetISR * ValorMultiplicador) importeMovimiento = (ObjFactura.RetISR * ValorMultiplicador)
@@ -3545,7 +3510,7 @@ Namespace Modelos
Case 13 'Iva por Trasladar Case 13 'Iva por Trasladar
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then
importeMovimiento = (ObjFactura.IVA * ValorMultiplicador) importeMovimiento = (ObjFactura.IVA * ValorMultiplicador)
importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) importeMX = (importeMovimiento * tipoCambio * Multiplicador).RoundSQL
FechaMovimiento = ObjFactura.FechaPago FechaMovimiento = ObjFactura.FechaPago
PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal
@@ -3564,43 +3529,11 @@ Namespace Modelos
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
End If End If
'If ObjFactura.TipoDocto = "Egs" Then
' importeMovimiento = ObjFactura.IVA * ValorMultiplicador
' importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2)
' FechaMovimiento = ObjFactura.FechaPago
' PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal
' If importeMovimiento <> 0 Then
' 'IVA X TRASLADAR
' IdCtaIVAXTrasladar = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
' Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 13, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 13, Concepto, Fecha, IdCtaIVAXTrasladar, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then
' ErrorPrepoliza = True
' Exit For
' End If
' 'IVA PAGADO
' IdCtaIVATrasladado = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
' Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 61, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
' If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, importeMovimiento, Referencia, 61, Concepto, Fecha, IdCtaIVATrasladado, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=-1, ImporteMX:=importeMX * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuesto) Then
' ErrorPrepoliza = True
' Exit For
' End If
' End If
' importeMovimiento = 0
' importeMX = 0
'End If
Case 38 'IEPS por Trasladar Case 38 'IEPS por Trasladar
If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then If Not ObjFactura.TipoDocto.Contiene("Rem", "RNC") Then
importeMovimiento = (ObjFactura.IEPS * ValorMultiplicador) importeMovimiento = (ObjFactura.IEPS * ValorMultiplicador)
importeMX = Math.Round(importeMovimiento * tipoCambio * Multiplicador, 2) importeMX = (importeMovimiento * tipoCambio * Multiplicador).RoundSQL
FechaMovimiento = ObjFactura.Fecha FechaMovimiento = ObjFactura.Fecha
CveSubProyectoContabilizar = CveSubProyectoVenta CveSubProyectoContabilizar = CveSubProyectoVenta
@@ -4290,7 +4223,7 @@ Namespace Modelos
If Not OcurrioError Then If Not OcurrioError Then
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero
ValorInventario = Math.Round(DtCostos.SUM("Total", "").ToDecimal, 2, MidpointRounding.AwayFromZero) ValorInventario = (DtCostos.SUM("Total", "").ToDecimal).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, True, ValorInventario, Me.SerieFolio, 68, Me.SerieFolio, Me.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveSubProyecto:=Me.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, True, ValorInventario, Me.SerieFolio, 68, Me.SerieFolio, Me.Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveSubProyecto:=Me.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
End If End If

View File

@@ -2462,11 +2462,12 @@ Namespace Extensiones
End If End If
End Sub End Sub
'Usa la librería ClosedXML
<Runtime.CompilerServices.Extension()> <Runtime.CompilerServices.Extension()>
Public Sub ExportToExcelx(GridView As GridView, NombreArchivoXLSX As String) Public Sub ExportToExcelX(GridView As GridView, NombreArchivoXLSX As String)
If GridView IsNot Nothing AndAlso GridView.Rows.Count > 0 Then If GridView IsNot Nothing AndAlso GridView.Rows.Count > 0 Then
NombreArchivoXLSX = Regex.Replace(NombreArchivoXLSX.Replace("["c, "").Replace("]"c, ""), "[:\/?*]", String.Empty) NombreArchivoXLSX = ValidFileName(NombreArchivoXLSX, 31)
Dim dt As New DataTable(NombreArchivoXLSX) Dim dt As New DataTable(NombreArchivoXLSX)
Dim i As Integer = 0 Dim i As Integer = 0
Dim ArrColumnasVisibles As New List(Of Integer) 'solo recorro las columnas visibles Dim ArrColumnasVisibles As New List(Of Integer) 'solo recorro las columnas visibles
@@ -2509,8 +2510,17 @@ Namespace Extensiones
'Next 'Next
Next Next
Using wb As New XLWorkbook() Using wb As New XLWorkbook()
wb.Worksheets.Add(dt) Dim WS As IXLWorksheet = wb.Worksheets.Add(NombreArchivoXLSX)
Dim RangoColTitulos As IXLCells = WS.FirstRow().CellsUsed()
WS.FirstCell().InsertTable(dt, False)
'Estilo
RangoColTitulos.Style.Fill.SetBackgroundColor(XLColor.FromArgb(75, 119, 190))
RangoColTitulos.Style.Font.SetBold(True)
RangoColTitulos.Style.Font.FontColor = XLColor.White
WS.Columns().AdjustToContents()
HttpContext.Current.Response.Clear() HttpContext.Current.Response.Clear()
HttpContext.Current.Response.Buffer = True HttpContext.Current.Response.Buffer = True
@@ -2527,7 +2537,7 @@ Namespace Extensiones
End If End If
End Sub End Sub
'usa la librería de gembox 'Usa la librería GemBox
<Runtime.CompilerServices.Extension()> <Runtime.CompilerServices.Extension()>
Public Sub ExportToExcelG(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100) Public Sub ExportToExcelG(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100)
Dim sw As New StringWriter() Dim sw As New StringWriter()

View File

@@ -1271,14 +1271,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETSATMaterialPeligroso(ByVal context As HttpContext) As String Private Function GETSATMaterialPeligroso(ByVal context As HttpContext) As String
Dim retorno As String = "" Dim retorno As String = ""
Dim DTUM = DirectCast(ClsPaginas.GlobalDTMaterialPeligroso, DataTable).AsEnumerable
If context.Application("GlobalDTMaterialPeligroso") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetMaterialPeligroso Then context.Application("GlobalDTMaterialPeligroso") = ObjGrales.DtResultados Else context.Application("GlobalDTMaterialPeligroso") = Nothing
ObjGrales.Dispose()
End If
Dim DTUM = DirectCast(context.Application("GlobalDTMaterialPeligroso"), DataTable).AsEnumerable
Dim DtPSRetorno As DataTable Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString Dim Name = IfNull(context.Request("Name"), "-1").ToString
@@ -1308,14 +1301,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETSATEmbalajes(ByVal context As HttpContext) As String Private Function GETSATEmbalajes(ByVal context As HttpContext) As String
Dim retorno As String = "" Dim retorno As String = ""
Dim DTUM = DirectCast(ClsPaginas.GlobalDTEmbalajes, DataTable).AsEnumerable
If context.Application("GlobalDTEmbalajes") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetEmbalajes Then context.Application("GlobalDTEmbalajes") = ObjGrales.DtResultados Else context.Application("GlobalDTEmbalajes") = Nothing
ObjGrales.Dispose()
End If
Dim DTUM = DirectCast(context.Application("GlobalDTEmbalajes"), DataTable).AsEnumerable
Dim DtPSRetorno As DataTable Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString Dim Name = IfNull(context.Request("Name"), "-1").ToString
@@ -1349,7 +1335,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String Private Function GetFraccionArancelaria(ByVal context As HttpContext) As String
Dim retorno As String = "" Dim retorno As String = ""
Dim DT = DirectCast(context.Application("GlobalDTFraccionArancelaria"), EnumerableRowCollection(Of DataRow)) Dim DT = ClsPaginas.GlobalDTFraccionArancelaria
Dim DtRetorno As DataTable Dim DtRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString Dim Name = IfNull(context.Request("Name"), "-1").ToString

View File

@@ -0,0 +1,164 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarCuentasProveedor.aspx.vb" Inherits="Bancos_PopUpBuscarCuentasProveedor" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblTitulo" runat="server" Text="Cuentas Bancarias Proveedor"></asp:Label>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<%--<asp:HiddenField ID="hdnEsThickbox" runat="server" ClientIDMode="Static" />--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table style="width: 750px;">
<tr>
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
</tr>
<tr align="left">
</tr>
<tr align="left">
<td class="text-right"><b>Proveedor:</b></td>
<td>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<ADS:Dropdownlost ID="DdlProveedores" AutoPostBack="false" runat="server" IncluyeTodos="false" DataTextField="RazonSocial" DataValueField="CveProveedor" CssClassDdl="select2me" CssStyle="width:400px;"></ADS:Dropdownlost>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td colspan="4" style="text-align: center;">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" />
</td>
<td></td>
<td></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="TblBusqueda" style="width: 100%" runat="server" border="0" visible="false">
<div class="row">
<div id="DivBC" style="overflow-y: auto; width: 765px; height: 405px;" runat="server">
<asp:GridView ID="GvBancosCuentas" GridLines="None" BorderColor="#D3D3D3" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-sort="true" runat="server"
DataKeyNames="CveCuentaDeposito,BancoNombre,Sucursal,Cuenta,CLABE,SWIFT,Plaza,CIE,Referencia,RefCrediProveedor,CveMoneda,Estatus,Correo,BBVAAlias,EstatusPagoElectronico,EstatusPagoElectronicoGrupos,CveSATBanco,ConceptoCIE" AutoGenerateColumns="False"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Cuentas Bancarias">
<Columns>
<asp:TemplateField HeaderText="Banco" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtNombreBanco" runat="server" data-toggle="tooltip" title='<%# Eval("BancoNombre")%>' Text='<%# Eval("BancoNombre")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="# Suc." ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtNumeroSucursal" runat="server" data-toggle="tooltip" title='<%# Eval("Sucursal")%>' Text='<%# Eval("Sucursal")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Num. Cuenta" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtNumeroCuenta" runat="server" data-toggle="tooltip" title='<%# Eval("Cuenta")%>' Text='<%# Eval("Cuenta")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CLABE" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtCLABE" runat="server" data-toggle="tooltip" title='<%# Eval("CLABE")%>' Text='<%# Eval("CLABE")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="SWIFT" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtSWIFT" runat="server" data-toggle="tooltip" title='<%# Eval("SWIFT")%>' Text='<%# Eval("SWIFT")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Plaza" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtPlaza" runat="server" data-toggle="tooltip" title='<%# Eval("Plaza")%>' Text='<%# Eval("Plaza")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CIE" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtConvenioCIE" runat="server" data-toggle="tooltip" title='<%# Eval("CIE")%>' Text='<%# Eval("CIE")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Referencia" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtReferencia" runat="server" data-toggle="tooltip" title='<%# Eval("Referencia")%>' Text='<%# Eval("Referencia")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cred. Prov." ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Label ID="LtRefCrediProveedor" runat="server" data-toggle="tooltip" title='<%# Eval("RefCrediProveedor")%>' Text='<%# Eval("RefCrediProveedor")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Moneda" ItemStyle-CssClass="Excede">
<ItemTemplate>
<asp:Literal ID="LtMoneda" runat="server" Text='<%# Eval("Moneda")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus" ItemStyle-CssClass="Excede" >
<ItemTemplate>
<asp:Label ID="LlbEstatusTexto" Text='<%# Eval("EstatusTexto")%>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="P.E." ItemStyle-CssClass="Excede" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblPagoelectronico" Text='<%# Eval("Pagoelectronico")%>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="P.E.G" ItemStyle-CssClass="Excede" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblPagoElectronicoGrupo" Text='<%# Eval("PagoElectronicoGrupos")%>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- <div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>--%>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
//function Focus() {
// $('#TxtCodigoProv').focus()
//}
</script>
</asp:Content>

View File

@@ -0,0 +1,124 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Bancos_PopUpBuscarCuentasProveedor
Inherits ClsPaginas
#Region "Propiedades"
Private ReadOnly Property CveProveedor As Integer
Get
Return ViewState("CveProveedor").ToString.ToEntero
End Get
End Property
Private Property DTCuentasBancos As DataTable
Get
Return CType(ViewState("DTCuentasBancos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTCuentasBancos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
CType(Me.Master, BaseMasterPage).PopupWidth = 780
RegistraScript("if($get('tdContenido')){$get('tdContenido').style.height='465px'}")
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
ViewState("CveProveedor") = Request("CveProveedor")
CargaDatos(CveProveedor)
DdlProveedores.SelectedValue = CveProveedor.ToString
Else
ViewState("CveProveedor") = -1
End If
InicializaValores()
Me.Form.DefaultButton = BtnBuscar.UniqueID
End If
End Sub
Private Sub InicializaValores()
Dim Txt As String = IfNull(Request("Txt"), "").ToString
If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt)
DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
DdlProveedores.SelectedText = "Seleccione"
DdlProveedores.SelectedValue = "-1"
DdlProveedores.DataBind()
End Sub
Private Sub CargaDatos(CveProveedor As Integer)
If ValidarFiltrosSeleccionados() OrElse CveProveedor > 0 Then
CargaCuentasBancarias()
UPDatos.Update()
Else
Alert("Seleccione un proveedor", TipoMensaje.MsgAdvertencia)
End If
End Sub
Private Sub CargaCuentasBancarias()
'If CveProveedor <= 0 Then Exit Sub
Dim ObjCuentasBancos As New ClsGenerales
DTCuentasBancos = New DataTable
If ObjCuentasBancos.GetCuentasDepositos(CveProveedor) Then
DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados)
Else
Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgAdvertencia)
ObjCuentasBancos.Dispose()
Exit Sub
End If
If CveProveedor < 0 Then
'Alert("No hay proveedor", TipoMensaje.MsgInformacion)
'TempDTCuentasBancos = DTCuentasBancos
End If
ObjCuentasBancos.Dispose()
CargaPSGridCuentasBancos()
RecargaGlobalCuentasBancarias()
End Sub
Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1)
If CveProveedor > 0 Then
Dim ObjCuentasBancos As New ClsGenerales
If ObjCuentasBancos.GetCuentasDepositos() Then
GlobalDTProveedoresCuentas(-1, True) = ObjCuentasBancos.DtResultados
End If
ObjCuentasBancos.Dispose()
End If
End Sub
Private Sub CargaPSGridCuentasBancos()
GvBancosCuentas.DataSource = DTCuentasBancos.FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue}")
GvBancosCuentas.DataBind()
TblBusqueda.Visible = True
UPDatos.Update()
End Sub
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
CargaDatos(DdlProveedores.SelectedValue.ToEntero)
End Sub
Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound
'If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.DBCampo("CveAlmacen") = "" Then
' e.Row.CssClass = "Totales"
' End If
'End If
End Sub
Private Function ValidarFiltrosSeleccionados() As Boolean
If DdlProveedores.SelectedValue.ToEntero > 0 Then Return True
Return False
End Function
End Class

View File

@@ -8196,7 +8196,7 @@ Partial Class Compras_Compras
End If End If
'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
If UsuarioActual.CveEmpresa.Contiene(1, 119, 141) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then
Dim CvePreComprobacion As Integer Dim CvePreComprobacion As Integer
If ObjCompras.DtResultados.Rows.Count = 0 Then If ObjCompras.DtResultados.Rows.Count = 0 Then

View File

@@ -20,6 +20,9 @@
<li> <li>
<asp:LinkButton ID="LnkAutorizar" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea autorizar el presupuesto?" data-btn-ok-label="si"><i class="fa fa-check"></i> Autorizar</asp:LinkButton> <asp:LinkButton ID="LnkAutorizar" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea autorizar el presupuesto?" data-btn-ok-label="si"><i class="fa fa-check"></i> Autorizar</asp:LinkButton>
</li> </li>
<li>
<asp:LinkButton ID="LnkCargaPresupuesto" OnClick="LnkCargaPresupuesto_Click" runat="server"><i class="fa fa-upload"></i>Cargar Presupuesto</asp:LinkButton>
</li>
<li> <li>
<asp:HyperLink ID="HlModificar" Target="_blank" Visible="false" runat="server"><i class="fa fa-edit"></i> Modificar Presupuesto</asp:HyperLink> <asp:HyperLink ID="HlModificar" Target="_blank" Visible="false" runat="server"><i class="fa fa-edit"></i> Modificar Presupuesto</asp:HyperLink>
</li> </li>
@@ -282,6 +285,61 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="ModalCargaPresupuesto" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UPCargaPresup" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content rowpadding">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" runat="server" style="text-align: left">Cargar Presupuesto </h4>
</div>
<div class="modal-body">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-upload font-green"></i>
<span class="caption-subject bold uppercase">Cargar archivo </span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="LnkFormatoPresup" OnClick="LnkFormatoPresup_Click" CssClass="btn yellow-gold" runat="server"><i class="fa fa-download"></i> Descargar Plantilla</asp:LinkButton>
</div>
</div>
</div>
<div class="portlet-body rowpadding ">
<!--<div class=" row">
<div class="col-md-3">Concepto</div>
<div class="col-md-6">
<asp:DropDownList ID="ddlConceptocomisionNeto" runat="server" DataTextField="CodigoConcepto" DataValueField="CveConcepto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
-->
<asp:TextBox ID="TxtCargarPresup" CssClass="ADSdropzone hidden" runat="server"></asp:TextBox>
</div>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LnkCargarPresup" OnClick="LnkCargarPresup_Click" CssClass="btn btn-primary" runat="server">Procesar</asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkFormatoPresup" />
</Triggers>
</asp:UpdatePanel>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -494,4 +494,76 @@ Partial Class Contratos_Presupuestos
UpGvClasificaciones.Update() UpGvClasificaciones.Update()
UpIndicadores.Update() UpIndicadores.Update()
End Sub End Sub
Protected Sub LnkCargaPresupuesto_Click(sender As Object, e As EventArgs) Handles LnkCargaPresupuesto.Click
RegistraScript("$('#ModalCargaPresupuesto').modal();")
End Sub
Protected Sub LnkFormatoPresup_Click(sender As Object, e As EventArgs) Handles LnkFormatoPresup.Click
GvPresupuestos.ExportToExcelX("Plantilla Presupuesto " + DateTime.Now.ToShortDateString)
End Sub
Protected Sub LnkCargarPresup_Click(sender As Object, e As EventArgs) Handles LnkCargarPresup.Click
If TxtCargarPresup.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtCargarPresup.getfiles().Archivos(0)
Dim Directorio As String = Server.MapPath("~") & file.path
Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
Alert("No existe el archivo. Favor de subir un archivo CSV o Excel a la plataforma.", TipoMensaje.MsgError)
End If
End Sub
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim DTExcel As New DataTable
Dim ErrorArchivo = False
Dim ErrorExcel = False
DTExcel = ReadExcelFile(Ruta + FileName, True)
If Not ErrorArchivo Then
If Not DTExcel.Columns(0).ColumnName = "Clasificación" Then
Alert("El nombre de la primera columna debe ser 'Clasificación'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not DTExcel.Columns(1).ColumnName = "Importe" Then
Alert("El nombre de la segunda columna debe ser 'Importe'.Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not DTExcel.Columns(2).ColumnName = "Observaciones" Then
Alert("El nombre de la tercera columna debe ser 'Observaciones'.Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not DTExcel.Columns(3).ColumnName = "Tipo Gasto" Then
Alert("El nombre de la cuarta columna debe ser 'Tipo Gasto'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
End If
Try
Dim txtImporte As TextBox = Nothing
Dim txtObservacion As TextBox = Nothing
Dim i As Integer = 0
For Each row As GridViewRow In GvPresupuestos.Rows
If (i < DTExcel.Rows.Count) Then
txtImporte = row.FCTextBox("TxtImporteClasi")
txtObservacion = row.FCTextBox("TxtObservacion")
txtImporte.Text = DTExcel.Rows(i).Field(Of String)(1).ToString
txtObservacion.Text = DTExcel.Rows(i).Field(Of String)(2).ToString
i += 1
End If
Next
Catch ex As Exception
GuardaLog($"Ocurrio un error al cargar archivo Excel en Contratos/Presupuestos.aspx - {ex.ToString()}")
Alert("Se produjo un error al ingresar los datos. Favor de contactar a soporte.", TipoMensaje.MsgError)
Exit Sub
End Try
RegistraScript("$('#ModalCargaPresupuesto').modal('hide');calculaTotal()")
UpGvClasificaciones.Update()
End Sub
End Class End Class

View File

@@ -418,13 +418,17 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UPSaldoCxP" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false"> <asp:UpdatePanel ID="UPSaldoCxP" runat="server" class="portlet light xspadding bordered " align="center" style="" UpdateMode="Conditional" Visible="false">
<ContentTemplate> <ContentTemplate>
<div class="portlet-title" style="border-bottom:none!important; margin-top: 5px"> <div class="portlet-title" style="border-bottom:none!important; margin-top: 5px">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
<span id="PLSaldoCxP" runat="server" class="caption-subject bold uppercase">Saldo conjunto de Cuentas por Pagar </span> <span id="PLSaldoCxP" runat="server" class="caption-subject bold uppercase">Saldo acumulado de Cuentas por Pagar</span>
</div> </div>
<div class="caption font-green portlet-total"> <div class="caption font-green portlet-total">
<span id="PLSaldoCxPTot" class="caption-subject bold uppercase" runat="server" /> <span id="PLSaldoCxPTot" class="caption-subject bold uppercase" runat="server" />
@@ -434,6 +438,8 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
<!-- <div class="col-md-6"></div> -->
</div> </div>
</ContentTemplate> </ContentTemplate>

View File

@@ -150,12 +150,6 @@
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li id="tdBuscarMilitante" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/ZDG/PopUpBuscarMilitante.aspx',1250);">
<i class="fa fa-male"></i>
Buscar Militante
</a>
</li>
<li id="tdCliente" runat="server" visible="false"> <li id="tdCliente" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx');"> <a onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx');">
<i class="fa fa-users"></i> <i class="fa fa-users"></i>
@@ -174,14 +168,6 @@
Buscar Venta Buscar Venta
</a> </a>
</li> </li>
<li id="tdBuscarPs" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarPs.aspx');">
<i class="fa fa-dropbox"></i>
Buscar Producto Servicios
</a>
</li>
<li id="tdPersonal" runat="server" visible="false"> <li id="tdPersonal" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/RH/PopUpBuscarPersonal.aspx');"> <a onclick="javascript:AbrirVentana('/RH/PopUpBuscarPersonal.aspx');">
<i class="fa fa-money"></i> <i class="fa fa-money"></i>
@@ -197,9 +183,7 @@
<li id="tdCheques" runat="server" visible="false"> <li id="tdCheques" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/Bancos/PopUpBuscarIE.aspx');"> <a onclick="javascript:AbrirVentana('/Bancos/PopUpBuscarIE.aspx');">
<i class="fa fa-university"></i> <i class="fa fa-university"></i>
Buscar Movtos. Buscar Movto. Bancario
<br />
&nbsp;&nbsp;&nbsp;&nbsp;Bancarios
</a> </a>
</li> </li>
<li id="tdOC" runat="server" visible="false"> <li id="tdOC" runat="server" visible="false">
@@ -218,9 +202,7 @@
<li id="tdOS" runat="server" visible="false"> <li id="tdOS" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/OS/PopUpBuscarOS.aspx');"> <a onclick="javascript:AbrirVentana('/OS/PopUpBuscarOS.aspx');">
<i class="fa fa-list-alt"></i> <i class="fa fa-list-alt"></i>
Buscar Órdenes Buscar Órdenes Servicio
<br />
&nbsp;&nbsp;&nbsp;&nbsp;de Servicio
</a> </a>
</li> </li>
<li id="tdBExi" runat="server" visible="false"> <li id="tdBExi" runat="server" visible="false">
@@ -259,15 +241,31 @@
Buscar Acercamientos Buscar Acercamientos
</a> </a>
</li> </li>
<li id="tdBuscarPs" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/Ventas/PopUpBuscarPs.aspx');">
<i class="fa fa-dropbox"></i>
Buscar Producto Servicios
</a>
</li>
<li id="TdBuscaActivoFijo" runat="server" visible="False"> <li id="TdBuscaActivoFijo" runat="server" visible="False">
<a onclick="javascript:AbrirVentana('/AF/PopUpBuscarAF.aspx',800,600,'N');"> <a onclick="javascript:AbrirVentana('/AF/PopUpBuscarAF.aspx',800,600,'N');">
<i class="fa fa-building"></i> <i class="fa fa-building"></i>
Buscar Activo Fijo Buscar Activo Fijo
</a> </a>
</li> </li>
<li id="tdProvBancos" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/Bancos/PopUpBuscarCuentasProveedor.aspx');">
<i class="fa fa-university"></i>
Buscar Cuentas Proveedor
</a>
</li>
<li id="tdBuscarMilitante" runat="server" visible="false">
<a onclick="javascript:AbrirVentana('/ZDG/PopUpBuscarMilitante.aspx',1250);">
<i class="fa fa-male"></i>
Buscar Militante
</a>
</li>
</ul> </ul>
</li> </li>
<li class="dropdown dropdown-user"> <li class="dropdown dropdown-user">

View File

@@ -217,6 +217,8 @@ Partial Class Site
'Proveedores 'Proveedores
If UsuarioActual.TienePermisoPagina(37) Then tdProv.Visible = True If UsuarioActual.TienePermisoPagina(37) Then tdProv.Visible = True
If UsuarioActual.TienePermisoPagina(679) Then tdProvBancos.Visible = True
'Clientes 'Clientes
If UsuarioActual.TienePermisoPagina(26) Then tdCliente.Visible = True If UsuarioActual.TienePermisoPagina(26) Then tdCliente.Visible = True

View File

@@ -96,7 +96,7 @@
<div id="DivDatosBancarios" runat="server" class="chequesie1"> <div id="DivDatosBancarios" runat="server" class="chequesie1">
<div class="row"> <div class="row">
<label class="col-md-2">Movimiento:</label> <label class="col-md-2">Movimiento:</label>
<div class="col-md-4"> <div class="col-md-5">
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardar"> <asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" ValidationGroup="GrpGuardar">
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Movimiento''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVTipoTransaccion" runat="server" ControlToValidate="DdlTipoTransaccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Movimiento''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
@@ -115,9 +115,6 @@
</div> </div>
<div class="col-md-5" runat="server" id="DivTCDolaresDolares" visible="false"> <div class="col-md-5" runat="server" id="DivTCDolaresDolares" visible="false">
T.C: T.C:
<asp:TextBox ID="TxtTCDolaresDolares" runat="server" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" /> <asp:TextBox ID="TxtTCDolaresDolares" runat="server" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
@@ -216,21 +213,21 @@
<div class="col-md-3"> <div class="col-md-3">
<asp:TextBox ID="TxtAnticipo" runat="server" Width ="100px" ClientIDMode="Static" /> <asp:TextBox ID="TxtAnticipo" runat="server" Width ="100px" ClientIDMode="Static" />
</div> </div>
<div class="col-md-2" runat="server" id="Div3" visible="false"> </div>
<div class="col-md-2" runat="server" id="Div3" visible="false">Liquidación:</div>
<div class="col-md-3" runat="server" id="Div4" visible="false"> <div class="col-md-3" runat="server" id="Div4" visible="false">
<asp:CheckBox ID="CheckBox2" OnCheckedChanged="ChkLiquidacion_CheckedChanged" runat="server" AutoPostBack="true" />
</div>
</div> </div>
</div>
<div class="row" id="divPrestamo" runat="server" visible="false" > <div class="row" id="divPrestamo" runat="server" visible="false" >
<div class="col-md-2" >Préstamo:</div> <div class="col-md-2" >Préstamo:</div>
<div class="col-md-3"> <div class="col-md-3">
<asp:TextBox ID="TxtPrestamo" runat="server" Width ="100px" ClientIDMode="Static" /> <asp:TextBox ID="TxtPrestamoImporte" runat="server" Width="100px" ClientIDMode="Static"></asp:TextBox>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlPrestamo" runat="server" Width="40px" DataTextField="RazonSocial" DataValueField="CveIE"></asp:DropDownList> <asp:DropDownList ID="DdlPrestamo" runat="server" Width="100%" DataTextField="TextoDocumento" DataValueField="CveIE"></asp:DropDownList>
</div>
<div class="col-md-3" >Intereses:
<asp:TextBox ID="TxtPrestamoIntereses" runat="server" Width="80px" ClientIDMode="Static"></asp:TextBox>
</div> </div>
</div> </div>
@@ -820,6 +817,24 @@
Importe = Importe + ToDouble($get('TxtAnticipo').value); Importe = Importe + ToDouble($get('TxtAnticipo').value);
} }
} }
if ($get('TxtPrestamoImporte') != null) {
if ($get('TxtPrestamoImporte').value == '') {
$get('TxtPrestamoImporte').value = 0.00;
}
else {
Importe = Importe - ToDouble($get('TxtPrestamoImporte').value);
}
}
if ($get('TxtPrestamoIntereses') != null) {
if ($get('TxtPrestamoIntereses').value == '') {
$get('TxtPrestamoIntereses').value = 0.00;
}
else {
Importe = Importe - ToDouble($get('TxtPrestamoIntereses').value);
}
}
if ($get('TxtOtrosImportes') != null) { if ($get('TxtOtrosImportes') != null) {
if (pagoMultiple != 0) { if (pagoMultiple != 0) {

View File

@@ -69,6 +69,14 @@ Partial Class Ventas_ClientesAbonar
ViewState("DtIngresos") = value ViewState("DtIngresos") = value
End Set End Set
End Property End Property
Private Property DtPrestamos As DataTable
Get
Return CType(ViewState("DtPrestamos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtPrestamos") = value
End Set
End Property
Private Property IdCuentaBancaria As Integer Private Property IdCuentaBancaria As Integer
Get Get
@@ -164,15 +172,6 @@ Partial Class Ventas_ClientesAbonar
End Set End Set
End Property End Property
'Private Property CveIESustitucion As Integer
' Get
' Return ViewState("CveIESustitucion").ToString.ToEntero
' End Get
' Set(value As Integer)
' ViewState("CveIESustitucion") = value
' End Set
'End Property
Private Property CFDIRelacionadoSustitucion As String Private Property CFDIRelacionadoSustitucion As String
Get Get
If ViewState("CFDIRelacionadoSustitucion") Is Nothing Then If ViewState("CFDIRelacionadoSustitucion") Is Nothing Then
@@ -248,16 +247,11 @@ Partial Class Ventas_ClientesAbonar
ViewState("IdCtaContMonedaExtranjeraAnticipo") = 0 ViewState("IdCtaContMonedaExtranjeraAnticipo") = 0
ViewState("IdCtaContMonedaComplementariaAnticipo") = 0 ViewState("IdCtaContMonedaComplementariaAnticipo") = 0
ViewState("CveIESustitucion") = IfNull(Request("CveIESustitucion"), "-1").ToString.ToEntero
DdlProveedorIntermediario.setEsWebService(True) DdlProveedorIntermediario.setEsWebService(True)
DdlProveedorIntermediario.Attributes.Add("data-metodo", "getproveedores") DdlProveedorIntermediario.Attributes.Add("data-metodo", "getproveedores")
FechaCorteIE = DateTime.Now FechaCorteIE = DateTime.Now
'If CveIESustitucion > 0 Then
' CargaIESustituir()
'End If
Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day) Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day)
Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate
@@ -355,7 +349,6 @@ Partial Class Ventas_ClientesAbonar
CargaCuentas() CargaCuentas()
CargaTipoTransaccion() CargaTipoTransaccion()
'TxtFechaDocumento.Text = IIf(CveIESustitucion > 0, FechaCorteIE.ToShortDateString, Now.ToShortDateString).ToString
TxtFechaDocumento.Text = Now.ToShortDateString.ToString TxtFechaDocumento.Text = Now.ToShortDateString.ToString
TxtAboneA.Enabled = False TxtAboneA.Enabled = False
@@ -390,6 +383,7 @@ Partial Class Ventas_ClientesAbonar
'Dim CveClasificacionCol6 As Integer = 21572 'Dim CveClasificacionCol6 As Integer = 21572
'Dim CveClasificacionCol7 As Integer = 21571 'Dim CveClasificacionCol7 As Integer = 21571
divAnticipo.Visible = True divAnticipo.Visible = True
divPrestamo.Visible = True
GvCxC.Columns(17).HeaderText = "Comisión<br/>Venta" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol1).FiltroPrimeroValor("Clasificacion").Substring(0, 10) GvCxC.Columns(17).HeaderText = "Comisión<br/>Venta" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol1).FiltroPrimeroValor("Clasificacion").Substring(0, 10)
GvCxC.Columns(18).HeaderText = "Gastos<br/>Manejo" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol2).FiltroPrimeroValor("Clasificacion").Substring(0, 12) GvCxC.Columns(18).HeaderText = "Gastos<br/>Manejo" 'GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionCol2).FiltroPrimeroValor("Clasificacion").Substring(0, 12)
@@ -406,6 +400,7 @@ Partial Class Ventas_ClientesAbonar
DvLiquidacion2.Visible = True DvLiquidacion2.Visible = True
DtIngresos = CargaIngresos(2) DtIngresos = CargaIngresos(2)
DtPrestamos = CargaPrestamos(1)
End If End If
CargaDatos(tCveMoneda) CargaDatos(tCveMoneda)
@@ -422,18 +417,15 @@ Partial Class Ventas_ClientesAbonar
Dim FechaI As String = IfNull(Request("FechaI"), "-1") Dim FechaI As String = IfNull(Request("FechaI"), "-1")
Dim FechaF As String = IfNull(Request("FechaF"), "-1") Dim FechaF As String = IfNull(Request("FechaF"), "-1")
'Dim FechaCorte As Date = IIf(CveIESustitucion > 0, (FechaCorteIE.ToDate).ToShortDateString, DateTime.Now.AddYears(1).ToShortDateString).ToString.ToDate
Dim FechaCorte As Date = DateTime.Now.AddYears(1).ToShortDateString.ToString.ToDate Dim FechaCorte As Date = DateTime.Now.AddYears(1).ToShortDateString.ToString.ToDate
Dim SumDescuentoProntoPago As Double = 0.0 Dim SumDescuentoProntoPago As Double = 0.0
'If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte, CveIESustitucion:=CveIESustitucion) Then
If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte) Then If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte) Then
Dim TmpCxCAux As DataTable Dim TmpCxCAux As DataTable
TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio")
SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago") SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago")
GvCxC.DataSource = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") GvCxC.DataSource = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio")
CveMoneda = pCveMoneda CveMoneda = pCveMoneda
End If End If
@@ -799,12 +791,6 @@ Partial Class Ventas_ClientesAbonar
'02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR '02-05-2018 MANDAMOS CANCELAR EL COMPLEMENTO A SUSTITUIR
Dim ErrorCancelarIE As Boolean = False Dim ErrorCancelarIE As Boolean = False
'If CveIESustitucion > 0 Then
' ErrorCancelarIE = CancelarIE()
' If ErrorCancelarIE Then
' Exit Sub
' End If
'End If
Dim ObjIE As New ClsBancos() Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
@@ -856,11 +842,8 @@ Partial Class Ventas_ClientesAbonar
Dim CveProvIntermediario As Integer Dim CveProvIntermediario As Integer
If ChkProveedorIntermediario.Checked Then If ChkProveedorIntermediario.Checked Then
CveProvIntermediario = If(DdlProveedorIntermediario.SelectedValue.ToEntero <= 0, -1, DdlProveedorIntermediario.SelectedValue.ToEntero) CveProvIntermediario = If(DdlProveedorIntermediario.SelectedValue.ToEntero <= 0, -1, DdlProveedorIntermediario.SelectedValue.ToEntero)
End If End If
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveProveedorIntermediario:=CveProvIntermediario)
'CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=CveIESustitucion, CveProveedorIntermediario:=CveProvIntermediario)
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text.Trim, TxtImporte.Text.ToDecimal, GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", "CveCuenta = " & DdlCuenta.SelectedValue).ToEntero, TipoCambio, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveIESustitucion:=-1, CveProveedorIntermediario:=CveProvIntermediario)
Else Else
If RblTipoPago.SelectedValue.Contiene("3") Then If RblTipoPago.SelectedValue.Contiene("3") Then
CveIE = DdlIngreso.SelectedValue.ToEntero CveIE = DdlIngreso.SelectedValue.ToEntero
@@ -878,7 +861,6 @@ Partial Class Ventas_ClientesAbonar
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
'inserto los movimientos de la conta para abonar al saldo 'inserto los movimientos de la conta para abonar al saldo
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
@@ -895,7 +877,6 @@ Partial Class Ventas_ClientesAbonar
Dim CveSubProyectoContabilizar As Integer = -1 Dim CveSubProyectoContabilizar As Integer = -1
Dim CveSubProyectoMaximo As Integer = -1 Dim CveSubProyectoMaximo As Integer = -1
Dim CuentasContablesInvalidas As New StringBuilder Dim CuentasContablesInvalidas As New StringBuilder
Dim CuentasContablesInvalidasSIG As New StringBuilder
Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False)
Dim TipoCambioFluctuacion As Decimal = 1 Dim TipoCambioFluctuacion As Decimal = 1
Dim FechaUltimaFluctuacion As Date = MinFecha Dim FechaUltimaFluctuacion As Date = MinFecha
@@ -903,15 +884,41 @@ Partial Class Ventas_ClientesAbonar
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
Dim ImportePrestamo As Decimal = 0
Dim TCPrestamo As Decimal = 0
If TxtPrestamoImporte.Text.ToDecimal <> 0 Then 'amortización del préstamo
ImportePrestamo = TxtPrestamoImporte.Text.ToDecimal
Dim tCveProv As Integer = DtPrestamos.FiltroPrimeroValor("CveProveedor", "CveIE=" & DdlPrestamo.SelectedValue)
Dim tFechaIE As Date = DtPrestamos.FiltroPrimeroValor("FechaDocumento", "CveIE=" & DdlPrestamo.SelectedValue).ToDate
TCPrestamo = DtPrestamos.FiltroPrimeroValor("TipoCambio", "CveIE=" & DdlPrestamo.SelectedValue).ToDecimal
If CveMoneda = 1 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 57, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=tipoCambioPago, CveProveedor:=tCveProv) Then
MsgError = "No se pudo insertar la póliza"
End If
Else
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then If tFechaIE <= UltimaFluctuacion.FechaFluctuacion Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion TCPrestamo = UltimaFluctuacion.TCFluctuacion
End If
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ImportePrestamo, 349, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then
MsgError = "No se pudo insertar la póliza"
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrestamo, ((ImportePrestamo * TCPrestamo) - ImportePrestamo).RoundSQL, 350, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=TCPrestamo, ImporteME:=ImportePrestamo, CveProveedor:=tCveProv) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
If TxtPrestamoIntereses.Text.ToDecimal <> 0 AndAlso MsgError = "" Then
Dim ImporteIntereses As Decimal = (TxtPrestamoIntereses.Text.ToDecimal * tipoCambioPago).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteIntereses, ImporteIntereses, 6, TxtFolio.Text, TxtObservaciones.Text, 0, CveIE:=DdlPrestamo.SelectedValue.ToEntero, CveSubProyecto:=CveSubProyecto, TipoCambio:=tipoCambioPago, CveClasificacion:=21927) Then
MsgError = "No se pudo insertar la póliza"
End If End If
End If End If
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
dtConceptos = ObjMov.DtResultados
End If End If
'inserto las ventas que voy a pagar 'inserto las ventas que voy a pagar
@@ -920,11 +927,52 @@ Partial Class Ventas_ClientesAbonar
If gvr.FCCheckBox("Chk").Checked Then If gvr.FCCheckBox("Chk").Checked Then
Dim ObjFactura As Modelos.Factura = Nothing Dim ObjFactura As Modelos.Factura = Nothing
Dim EsAnticipoEspecial As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
ObjFactura = New Modelos.Factura(UsuarioActual, gvr.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) ObjFactura = New Modelos.Factura(UsuarioActual, gvr.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
End If End If
Dim VentaActual As New Venta
VentaActual.CveVenta = gvr.DataKey("CveVenta").ToEntero
VentaActual.Fecha = gvr.DataKey("Fecha").ToDate
VentaActual.CveCliente = gvr.DataKey("CveCliente").ToEntero
VentaActual.CveMoneda = gvr.DataKey("CveMoneda").ToEntero
VentaActual.SerieFolio = gvr.DataKey("SerieFolio")
VentaActual.ClienteNombre = NombreComercial
VentaActual.TC = gvr.DataKey("TipoCambio").ToDecimal
VentaActual.Total = gvr.DataKey("Original").ToDecimal
VentaActual.IVA = gvr.DataKey("IVA").ToDecimal
VentaActual.IEPS = gvr.DataKey("IEPS").ToDecimal
VentaActual.RetIVA = gvr.DataKey("RetIVA").ToDecimal
VentaActual.RetISR = gvr.DataKey("RetISR").ToDecimal
VentaActual.PorcentajeIVA = gvr.DataKey("PorcentajeIVA").ToDecimal
VentaActual.UsuarioActual = UsuarioActual
VentaActual.CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero
'Importe de pago
Dim Pago As New VentaPago
Pago.Fecha = TxtFechaDocumento.Text.ToDate
Pago.CveIE = CveIE
Pago.CveMonedaPago = CveMoneda
Pago.ImportePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
Pago.ImportePagoVenta = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
Pago.Referencia = TxtFolio.Text
If RblTipoPago.SelectedValue = "3" Then Pago.TipoPago = "I"
'Tipos de cambio
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)
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
tipoCambioPago = Pago.TCPago
If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
tipoCambioPago = 1 tipoCambioPago = 1
@@ -946,61 +994,14 @@ Partial Class Ventas_ClientesAbonar
PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal
End If End If
'PARA EMITIR COMPLEMENTO PAGO If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then
CveVentasPago.Add(gvr.DataKey("CveVenta").ToEntero) EsAnticipoEspecial = True
SeriesPago.Add(gvr.DataKey("SerieFolio")) Pago.AplicaTraslado = False
Dim IdCtaContable As Integer = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente)
If VentaActual.CveMoneda = 2 Then IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera)
Dim tipoCambioVentaDiferenciaCambiaria As Double = 1 If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, VentaActual.SerieFolio, 3, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
Dim EsAnticipoEspecial As Boolean = False If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, VentaActual.SerieFolio, 95, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then
If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then EsAnticipoEspecial = True
Dim FluctuacionAnticipo As Decimal = 0
If dtConceptos IsNot Nothing Then
FluctuacionAnticipo = 0 ' se limpia la fluctuación por cada factura.
For Each Row As DataRow In dtConceptos.Rows
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
Dim ImporteMovimiento As Decimal = 0
Dim ImporteMN As Decimal
Dim FechaMovimiento As Date = TxtFechaDocumento.Text
Dim IdCtaContable As Integer = 0
Dim ConceptoMovimiento As String = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreComercial, gvr.DataKey("SerieFolio").ToString, TxtFolio.Text.Trim)
Dim Referencia As String = gvr.DataKey("SerieFolio").ToString
Dim CveSubProyecto As Integer = gvr.DataKey("CveSubProyecto").ToEntero
CveSubProyectoContabilizar = -1
Dim PorcentajeImpuesto As Decimal = 0
If CveSubProyecto > 0 Then CveSubProyectoMaximo = CveSubProyecto
Select Case ConceptoContable
Case 2 'Pago Cliente
If gvr.DataKey("CveMoneda").ToEntero > 1 Then ConceptoContable = 292
ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal).RoundSQL
ImporteMN = ImporteMovimiento '(ImporteMovimiento * tipoCambioVentaValuacion).RoundSQL
TipoCambioGeneral = tipoCambioVentaValuacion
CveSubProyectoContabilizar = CveSubProyecto
If gvr.DataKey("CveMoneda").ToEntero = 1 Then
IdCtaContable = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente)
ConceptoContable = If(EsAnticipoEspecial, 3, ConceptoContable)
Else
ConceptoMovimiento += $" TC:{tipoCambioVentaValuacion} ${ImporteMovimiento.FormatoNumero(2)}"
IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaComplementariaAnticipo, IdCtaContComplementaria)
If ImporteMovimiento <> 0 Then
ImporteMN = ImporteMovimiento
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, If(gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(119, 158), 226, 207), ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=(ImporteMovimiento * tipoCambioVentaValuacion - ImporteMovimiento).RoundSQL, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioVentaValuacion) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera)
ConceptoContable = If(EsAnticipoEspecial, 3, ConceptoContable)
End If
If EsAnticipoEspecial Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, Referencia, 2, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, Referencia, 95, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=False) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
Else Else
@@ -1009,7 +1010,7 @@ Partial Class Ventas_ClientesAbonar
End If End If
If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola
Dim FluctuacionAnticipo As Decimal = 0
Dim ImporteLiq1 As Decimal = gvr.FCTextBox("TxtLiqCol1").Text.ToDecimal Dim ImporteLiq1 As Decimal = gvr.FCTextBox("TxtLiqCol1").Text.ToDecimal
Dim ImporteLiq2 As Decimal = gvr.FCTextBox("TxtLiqCol2").Text.ToDecimal Dim ImporteLiq2 As Decimal = gvr.FCTextBox("TxtLiqCol2").Text.ToDecimal
Dim ImporteLiq3 As Decimal = gvr.FCTextBox("TxtLiqCol3").Text.ToDecimal Dim ImporteLiq3 As Decimal = gvr.FCTextBox("TxtLiqCol3").Text.ToDecimal
@@ -1077,20 +1078,18 @@ Partial Class Ventas_ClientesAbonar
End If End If
If ImporteLiq8 <> 0 Then If ImporteLiq8 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq8 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, 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, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq8 * tipoCambioPago, 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" MsgError = "No se pudo insertar la póliza" : Exit For
Exit For
End If End If
End If End If
If ImporteLiq9 <> 0 Then If ImporteLiq9 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq9, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq9 * tipoCambioPago, TipoCambio:=TipoCambioGeneral, 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, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq9 * tipoCambioPago, 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" MsgError = "No se pudo insertar la póliza" : Exit For
Exit For
End If End If
End If End If
If gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero > 0 Then If MsgError = "" AndAlso gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero > 0 Then
Dim TCP As Decimal = 0 Dim TCP As Decimal = 0
Dim FolioPago As String = " " Dim FolioPago As String = " "
If DtIngresos IsNot Nothing Then If DtIngresos IsNot Nothing Then
@@ -1106,11 +1105,11 @@ Partial Class Ventas_ClientesAbonar
End If End If
End If End If
'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo
FluctuacionAnticipo = ((TCP - tipoCambioVentaValuacion) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL FluctuacionAnticipo = ((TCP - tipoCambioPago) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago)
End If End If
If gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero > 0 Then If MsgError = "" AndAlso gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero > 0 Then
Dim TCP As Decimal = 0 Dim TCP As Decimal = 0
Dim FolioPago As String = " " Dim FolioPago As String = " "
If DtIngresos IsNot Nothing Then If DtIngresos IsNot Nothing Then
@@ -1127,351 +1126,42 @@ Partial Class Ventas_ClientesAbonar
End If End If
'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo 'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo
FluctuacionAnticipo += ((TCP - tipoCambioVentaValuacion) * gvr.FCTextBox("TxtAmort2").Text.ToDecimal).RoundSQL FluctuacionAnticipo += ((TCP - tipoCambioPago) * gvr.FCTextBox("TxtAmort2").Text.ToDecimal).RoundSQL
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago) MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti2").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort2").Text.ToDecimal, TCP, tipoCambioVentaValuacion, gvr.DataKey("CveVenta").ToEntero, gvr.DataKey("SerieFolio").ToString, FolioPago)
End If End If
End If If ImportePrestamo <> 0 Then
If TCPrestamo > 0 Then
FluctuacionAnticipo += ((TCPrestamo - tipoCambioPago) * ImportePrestamo).RoundSQL
Case 8 'Ret IVA x Trasladar
If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
Exit Select
End If
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
'Conta ContPAQ
If IdCtaContRetIVA <> 0 Then
IdCtaContable = IdCtaContRetIVA
Else
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If End If
End If End If
Pago.ImporteFluctuacionAdicional = FluctuacionAnticipo
End If End If
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
Case 313 'Ret Iva Servicios MsgError = "No se pudo insertar la póliza"
If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
'OBTENER CUENTAS
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
'Conta ContPAQ
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If End If
End If ' Case 134 'Pago Intermediario
Case 9 'Ret ISR x Trasladar
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
'Conta ContPAQ
If IdCtaContRetISR <> 0 Then
IdCtaContable = IdCtaContRetISR
Else
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 13 'Iva por Trasladar
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
PorcentajeImpuesto = gvr.DataKey("PorcentajeIVA").ToDecimal
Dim IdCtaIVAXTrasladar As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAXTrasladar > 0, IdCtaIVAXTrasladar, UsuarioActual.Empresa.IdCuentaIVAxTrasladar)
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
Case 62 'Ret IVA Trasladado
If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
Exit Select
End If
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
'Conta ContPAQ
If IdCtaContRetIVA <> 0 Then
IdCtaContable = IdCtaContRetIVA
Else
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 314 'Ret Iva Servicios Traslado
If EsAnticipoEspecial Then Exit Select
If gvr.DataKey("CveTipoRetencion").ToEntero = 4 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'OBTENER CUENTAS
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
'Conta ContPAQ
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If
End If
Case 63 'Ret ISR Trasladado
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
'Conta ContPAQ
If IdCtaContRetISR <> 0 Then
IdCtaContable = IdCtaContRetISR
Else
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 61 'Iva Trasladado
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
PorcentajeImpuesto = gvr.DataKey("PorcentajeIVA").ToDecimal
Dim IdCtaIVATrasladado As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVATrasladado > 0, IdCtaIVATrasladado, UsuarioActual.Empresa.IdCuentaIVATrasladado)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Case 38 'IEPS por trasladar
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)).RoundSQL
TipoCambioGeneral = tipoCambioVenta
CveSubProyectoContabilizar = CveSubProyecto
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSxTrasladar
Case 39 'IEPS Trasladado
If EsAnticipoEspecial Then Exit Select
ImporteMovimiento = (gvr.DataKey("IEPS").ToDecimal * PorcentajePago).RoundSQL
ImporteMN = (ImporteMovimiento * tipoCambioVenta).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
CveSubProyectoContabilizar = CveSubProyecto
IdCtaContable = UsuarioActual.Empresa.IdCuentaIEPSTrasladado
Case 64 'Ganancia
If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
Dim CveMonedaVenta As Integer = gvr.DataKey("CveMoneda").ToEntero
Dim tImporteVenta, tImportePago As Decimal
Dim Diferencia As Decimal = 0
ImporteMovimiento = 0
Dim ImportePago As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
ImportePago = ImportePago - gvr.FCTextBox("TxtAmort").Text.ToDecimal - gvr.FCTextBox("TxtAmort2").Text.ToDecimal
End If
tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
If CveMonedaVenta = 1 And CveMoneda <> 1 Then
'factura pesos, pago en dolares
tImporteVenta = ImportePago
tImportePago = ((ImportePago * tipoCambioVenta / tipoCambioPago).RoundSQL * tipoCambioPago).RoundSQL
ElseIf CveMonedaVenta <> 1 And CveMoneda <> 1 Then
'factura dolares, pago en dolares
tImporteVenta = (ImportePago * tipoCambioVentaValuacion).RoundSQL
tImportePago = (ImportePago * tipoCambioPago).RoundSQL
ElseIf CveMonedaVenta <> 1 And CveMoneda = 1 Then
'factura dolares, pago en pesos
tImporteVenta = (ImportePago * tipoCambioVentaValuacion).RoundSQL
tImportePago = (ImportePago * tipoCambioPago).RoundSQL
End If
'If FluctuacionAnticipo <> 0 Then
' tImportePago += FluctuacionAnticipo
'End If
If tImporteVenta <> tImportePago Then
If tImporteVenta < tImportePago Then
ConceptoContable = 64
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
TipoMovimiento = True
'CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
Else
ConceptoContable = 65
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
TipoMovimiento = False
' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
End If
Diferencia = tImporteVenta - tImportePago
End If
' si tiene funcionalidad para que tome el TC de pago, que solo afecta a los impuestos
If FuncionalidadFluctuacionImpuestos Then
Dim TCImpuestos As Decimal = tipoCambioPago
Diferencia -= (((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IVA
Diferencia -= (((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetIVA
Diferencia -= (((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el RetISR
Diferencia -= (((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaValuacion) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos)) 'Añadimos la diferencia de ganancia en el IEPS
Diferencia = Diferencia.RoundSQL
End If
ImporteMovimiento = Math.Abs(Diferencia)
ImporteMN = ImporteMovimiento
CveSubProyectoContabilizar = CveSubProyecto
Else
ImporteMovimiento = 0
End If
Case 78 'Otros Ingresos
If ChkAjusteOI.Checked Then
ImporteMovimiento = gvr.FCTextBox("TxtComision").Text.ToDecimal
ImporteMN = ImporteMovimiento * tipoCambioPago.RoundSQL
If gvr.FCTextBox("TxtComision").Text.ToDecimal < 0 Then
TipoMovimiento = False
ImporteMovimiento = ImporteMovimiento * -1
ImporteMN = ImporteMN * -1
Else
TipoMovimiento = True
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMN = ImporteMN.RoundSQL
TipoCambioGeneral = tipoCambioPago
CveSubProyectoContabilizar = CveSubProyecto
IdCtaContable = UsuarioActual.Empresa.IdCuentaOtrosIngresos
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}"
End If
Case 134 'Pago Intermediario
If RblTipoPago.SelectedValue = "2" Then If RblTipoPago.SelectedValue = "2" Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal Dim ImporteMovimiento As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal
ImporteMN = Math.Round(ImporteMovimiento * tipoCambioPago, 2) Dim ImporteMN As Decimal = (ImporteMovimiento * tipoCambioPago).RoundSQL
CveSubProyectoContabilizar = CveSubProyecto Dim IdCtaContable As Integer = 0
If tipoCambioVenta > 1 Then ConceptoMovimiento += $" TC:{tipoCambioVenta} ${ImporteMovimiento.FormatoNumero(2)}" If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, VentaActual.SerieFolio, 134, VentaActual.SerieFolio, IdCtaContable, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ConceptoMovimiento, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, -1, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero, ImporteMX:=ImporteMN) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
End If End If
ImporteMovimiento = 0
Case 30
ImporteMovimiento = 0
Case Else
ImporteMovimiento = 0
End Select
If MsgError <> "" Then 'PARA EMITIR COMPLEMENTO PAGO
Exit For CveVentasPago.Add(gvr.DataKey("CveVenta").ToEntero)
End If SeriesPago.Add(gvr.DataKey("SerieFolio"))
If ImporteMovimiento <> 0 AndAlso MsgError = "" Then
'Conta ContPAQ
If (IdCtaContable < 1 Or IdCuentaBancaria < 1) AndAlso UsuarioActual.CveEmpresa <> 119 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, Referencia, ConceptoContable, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteMN, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
Exit For
End If
End If
Next
If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then If gvr.FCCheckBox("ChkGenerarNC").Checked AndAlso ObjFactura IsNot Nothing Then
ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal() ObjFactura.DescuentoProntoPago = gvr.DataKey("DescuentoProntoPago").ToDecimal()
ListaFacturasGenerarNC.Add(ObjFactura) ListaFacturasGenerarNC.Add(ObjFactura)
End If End If
End If
End If End If
Next Next
@@ -1480,7 +1170,7 @@ Partial Class Ventas_ClientesAbonar
CveSubProyectoContabilizar = CveSubProyectoMaximo CveSubProyectoContabilizar = CveSubProyectoMaximo
If tipoCambioPago > 1 AndAlso CveMoneda = 2 Then If CveMoneda = 2 Then
'If IdCuentaBancariaComplementaria > 0 Then 'If IdCuentaBancariaComplementaria > 0 Then
If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
tipoCambioPago = TxtTCDolares.Text.ToDecimal tipoCambioPago = TxtTCDolares.Text.ToDecimal
@@ -1522,11 +1212,8 @@ Partial Class Ventas_ClientesAbonar
End If End If
End If End If
End If
If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then
MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta, -1, TxtObservaciones.Text, DdlIngreso.SelectedItem.Text)
End If End If
@@ -1557,7 +1244,6 @@ Partial Class Ventas_ClientesAbonar
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas)) Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas))
End If End If
End If End If
Else Else
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
End If End If
@@ -1572,7 +1258,6 @@ Partial Class Ventas_ClientesAbonar
For Each Fac As Modelos.Factura In ListaFacturasGenerarNC For Each Fac As Modelos.Factura In ListaFacturasGenerarNC
Dim ListaNC As New List(Of Modelos.Factura) Dim ListaNC As New List(Of Modelos.Factura)
ListaNC.Add(Fac) ListaNC.Add(Fac)
Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC) Dim Resp = GenerarNC(ObjIE.IniciaTransacSQL(), ObjConta, ListaNC)
If Resp IsNot Nothing AndAlso Resp.Respuesta IsNot Nothing AndAlso Resp.Respuesta.CveVenta > 0 Then If Resp IsNot Nothing AndAlso Resp.Respuesta IsNot Nothing AndAlso Resp.Respuesta.CveVenta > 0 Then
@@ -1667,20 +1352,6 @@ Partial Class Ventas_ClientesAbonar
MsgError = "Error al Agregar la Póliza de Armonización Contable" MsgError = "Error al Agregar la Póliza de Armonización Contable"
End If End If
'BITACORA
'If MsgError = "" Then
' If CveIESustitucion > 0 And ComplementoSustitucionGenerado Then
' If Not ObjEvento.AddEventoBitacora($"Complemento de pago Cancelado por sustitución con Folio <a href='/Bancos/IE.aspx?CveIE={CveIE}' target='_blank' class='Texto'>{TxtFolio.Text}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIESustitucion) Then
' MsgError = "Ocurrió un error al agregar la bitacora"
' End If
' If Not ObjEvento.AddEventoBitacora($"Complemento de pago Generado por Sustitución de <a href='/Bancos/IE.aspx?CveIE={CveIESustitucion}' target='_blank' class='Texto'>{FolioIECancelado}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
' MsgError = "Ocurrió un error al agregar la bitacora"
' End If
' End If
'End If
Catch ex As Exception Catch ex As Exception
MsgError = "Ocurrió un error al guardar el movimiento" MsgError = "Ocurrió un error al guardar el movimiento"
OnError("Ocurrió un error al guardar el movimiento", ex) OnError("Ocurrió un error al guardar el movimiento", ex)
@@ -1718,7 +1389,7 @@ Partial Class Ventas_ClientesAbonar
Else Else
If ObjConta IsNot Nothing Then ObjConta.RollBack() If ObjConta IsNot Nothing Then ObjConta.RollBack()
ObjIE.RollBack() ObjIE.RollBack()
Alert(MsgError, TipoMensaje.MsgAdvertencia) ' Alert(MsgError, TipoMensaje.MsgAdvertencia)
End If End If
ObjIE.Dispose() ObjIE.Dispose()
@@ -2398,7 +2069,6 @@ Partial Class Ventas_ClientesAbonar
DdlCuenta.SelectedValue = "-1" DdlCuenta.SelectedValue = "-1"
DdlTipoTransaccion.SelectedValue = "-1" DdlTipoTransaccion.SelectedValue = "-1"
'CveIESustitucion = "-1"
CFDIRelacionadoSustitucion = "-1" CFDIRelacionadoSustitucion = "-1"
FechaCorteIE = DateTime.Now.ToDate FechaCorteIE = DateTime.Now.ToDate
IDPoliza = -1 IDPoliza = -1
@@ -2476,7 +2146,21 @@ Partial Class Ventas_ClientesAbonar
Deudores.Dispose() Deudores.Dispose()
DdlIngreso.DataBind() DdlIngreso.DataBind()
DdlIngreso.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlIngreso.Items.Insert(0, New ListItem("-", "-1"))
Return dtt
End Function
Private Function CargaPrestamos(tCveMoneda As Integer) As DataTable
Dim dtt As DataTable = Nothing
Dim Deudores As New ClsMovimientos
If Deudores.GetDocumentosxPagarDetalle(CveCliente, tCveMoneda, 2, UsuarioActual.CveEmpresa) Then
DdlPrestamo.DataSource = Deudores.DtResultados '.FiltraParametros("CveCliente > 0 AND Saldo > 0 AND CveIE > 0")
dtt = Deudores.DtResultados
End If
Deudores.Dispose()
DdlPrestamo.DataBind()
DdlPrestamo.Items.Insert(0, New ListItem("-", "-1"))
Return dtt Return dtt
End Function End Function
@@ -2626,8 +2310,6 @@ Partial Class Ventas_ClientesAbonar
'For i = 0 To CveVentas.Count - 1 'For i = 0 To CveVentas.Count - 1
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
'If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, If(CveIESustitucion > 0, 2, 1), UsuarioActual.CveEmpresa, -1) Then
If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then
If Not ObjBancos.DtResultados.Rows.Count > 0 Then If Not ObjBancos.DtResultados.Rows.Count > 0 Then
ObjBancos.Dispose() ObjBancos.Dispose()
@@ -2638,8 +2320,6 @@ Partial Class Ventas_ClientesAbonar
ObjBancos.IniciaTransacSQL() ObjBancos.IniciaTransacSQL()
'If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=If(CveIESustitucion > 0, True, False)) Then
If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=False) Then If ObjBancos.GeneraTimbrePago(CveIE, -1, UsuarioActual, CveCliente, CFDIRelacionado:=CFDIRelacionadoSustitucion, EsRegeneracion:=False) Then
ObjBancos.Commit() ObjBancos.Commit()
ComplementoSustitucionGenerado = True ComplementoSustitucionGenerado = True
@@ -3025,7 +2705,7 @@ Partial Class Ventas_ClientesAbonar
Private Sub DdlIngreso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlIngreso.SelectedIndexChanged Private Sub DdlIngreso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlIngreso.SelectedIndexChanged
'saco la moneda de la selección 'saco la moneda de la selección
hdnIngresoImporte.Value = 0 HdnIngresoImporte.Value = 0
If DdlIngreso.SelectedValue.ToEntero > 0 Then If DdlIngreso.SelectedValue.ToEntero > 0 Then
Dim Banco As New ClsBancos Dim Banco As New ClsBancos
@@ -3033,7 +2713,7 @@ Partial Class Ventas_ClientesAbonar
CveMonedaPago = Banco.CveMoneda CveMonedaPago = Banco.CveMoneda
Dim Deudores As New ClsMovimientos Dim Deudores As New ClsMovimientos
If Deudores.GetIngresosSaldosDetalle(CveCliente, -1, UsuarioActual.CveEmpresa) Then If Deudores.GetIngresosSaldosDetalle(CveCliente, -1, UsuarioActual.CveEmpresa) Then
hdnIngresoImporte.Value = Deudores.DtResultados.FiltroPrimeroValor("Saldo", String.Format("CveIE = {0}", DdlIngreso.Selectedvalue)) HdnIngresoImporte.Value = Deudores.DtResultados.FiltroPrimeroValor("Saldo", String.Format("CveIE = {0}", DdlIngreso.SelectedValue))
End If End If
Deudores.Dispose() Deudores.Dispose()
End If End If

View File

@@ -25,13 +25,13 @@
<asp:LinkButton ID="LnkVerGrafica" OnClick="LnkVerGrafica_Click" runat="server"><i class="fa fa-signal"></i> Ver Grafica</asp:LinkButton> <asp:LinkButton ID="LnkVerGrafica" OnClick="LnkVerGrafica_Click" runat="server"><i class="fa fa-signal"></i> Ver Grafica</asp:LinkButton>
</li> </li>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>--%>
<li> <li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton> <asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i>Generar PDF</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton> <asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i>Exportar Excel</asp:LinkButton>
</li>--%> </li>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -12,12 +12,42 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas
public partial class Ventas_RepVentasAutorizaciones : ClsPaginas public partial class Ventas_RepVentasAutorizaciones : ClsPaginas
{ {
#region PROPIEDADES
private DataTable DtDatos
{
get { return DtDatos = (DataTable)ViewState["DtDatos"]; } get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
set { ViewState["DtDatos"] = value; } set { ViewState["DtDatos"] = value; }
}
private bool Consultado {
get { return Consultado = (bool)ViewState["Consultado"]; }
set { ViewState["Consultado"] = value; }
}
#endregion
protected void LnkExcel_Click(object sender, EventArgs e)
{
if (Consultado)
{
GvDatos.ExportToExcelG("RepVentasAutorizaciones" + DateTime.Now, "Reporte de Autorizaciones de Ventas", UsuarioActual);
}
else
{
Alert("Por favor realice una consulta primero.");
}
}
protected void LnkPdf_Click(object sender, EventArgs e)
{
if (Consultado) {
GvDatos.GenerarReportePDF("Reporte de Autorizaciones de Ventas");
} else {
Alert("Por favor realice una consulta primero."); Alert("Por favor realice una consulta primero.");
} }
} }
public override void VerifyRenderingInServerForm(System.Web.UI.Control control) public override void VerifyRenderingInServerForm(System.Web.UI.Control control)
{
} }
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
@@ -45,6 +75,7 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas
DdlClientes.setEsWebService(true); DdlClientes.setEsWebService(true);
txtFechaI.Text = DateTime.Now.ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString(); txtFechaF.Text = DateTime.Now.ToShortDateString();
} }