This commit is contained in:
Jorge Luis caudillo esparza
2025-07-16 09:50:42 -07:00
48 changed files with 5036 additions and 2744 deletions

View File

@@ -128,6 +128,7 @@ Public Class ClsBancos
Public Property Fecha As DateTime Public Property Fecha As DateTime
Public Property LimiteCredito As Double Public Property LimiteCredito As Double
Public Property ConvenioPagoElectronico As String Public Property ConvenioPagoElectronico As String
Public Property ConvenioPagoElectronicoNomina As String
Public Property UsaLayout As Boolean Public Property UsaLayout As Boolean
Public Property UsaLayoutGrupos As Boolean Public Property UsaLayoutGrupos As Boolean
@@ -138,6 +139,7 @@ Public Class ClsBancos
Public Property NumeroSucursal As String Public Property NumeroSucursal As String
#End Region #End Region
Public Property SecuenciaLayout As Integer = 0
#Region " P R O P I E D A D E S - C O M P L E M E N T O P A G O" #Region " P R O P I E D A D E S - C O M P L E M E N T O P A G O"
Public Property ComplementoSerieFolio As String Public Property ComplementoSerieFolio As String
@@ -420,6 +422,7 @@ Public Class ClsBancos
Me.Usuario = Data.Rows(0)("Usuario").ToString Me.Usuario = Data.Rows(0)("Usuario").ToString
Me.LimiteCredito = Data.Rows(0)("LimiteCredito").ToString.ToDouble Me.LimiteCredito = Data.Rows(0)("LimiteCredito").ToString.ToDouble
Me.ConvenioPagoElectronico = Data.Rows(0)("ConvenioPagoElectronico").ToString Me.ConvenioPagoElectronico = Data.Rows(0)("ConvenioPagoElectronico").ToString
Me.ConvenioPagoElectronicoNomina = Data.Rows(0)("ConvenioPagoElectronicoNomina").ToString
Me.UsaLayout = If(Data.Rows(0)("UsaLayout").ToString = "True", True, False) Me.UsaLayout = If(Data.Rows(0)("UsaLayout").ToString = "True", True, False)
Me.UsaLayoutGrupos = If(Data.Rows(0)("UsaLayoutGrupos").ToString = "True", True, False) Me.UsaLayoutGrupos = If(Data.Rows(0)("UsaLayoutGrupos").ToString = "True", True, False)
Me.UsaTarjeta = If(Data.Rows(0)("UsaTarjeta").ToString = "True", True, False) Me.UsaTarjeta = If(Data.Rows(0)("UsaTarjeta").ToString = "True", True, False)
@@ -461,7 +464,7 @@ Public Class ClsBancos
Public Function AddBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer, Public Function AddBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer,
LimiteCredito As Double, FormatoCheque As String, CveUsuario As Integer, CveEmpresa As Integer, ConvenioPagoElectronico As String, LimiteCredito As Double, FormatoCheque As String, CveUsuario As Integer, CveEmpresa As Integer, ConvenioPagoElectronico As String,
UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False, UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False,
Optional CveCuentaPadre As Integer = Nothing, Optional CveSubProyecto As Integer = -1, Optional NumeroSucursal As String = "-1") As Boolean Optional CveCuentaPadre As Integer = Nothing, Optional CveSubProyecto As Integer = -1, Optional NumeroSucursal As String = "-1", Optional ConvenioPagoElectronicoNomina As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Banc_BancosCuentasAdd") DataAdapter("PA_Banc_BancosCuentasAdd")
@@ -482,6 +485,7 @@ Public Class ClsBancos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCuenta", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveCuenta", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@ConvenioPagoElectronico", SqlDbType.VarChar).Value = ConvenioPagoElectronico .Add("@ConvenioPagoElectronico", SqlDbType.VarChar).Value = ConvenioPagoElectronico
.Add("@ConvenioPagoElectronicoNomina", SqlDbType.VarChar).Value = ConvenioPagoElectronicoNomina
.Add("@UsaLayout", SqlDbType.Bit).Value = UsaLayout .Add("@UsaLayout", SqlDbType.Bit).Value = UsaLayout
.Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta .Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta
.Add("@SaldoInicial", SqlDbType.Money).Value = SaldoInicial .Add("@SaldoInicial", SqlDbType.Money).Value = SaldoInicial
@@ -513,7 +517,7 @@ Public Class ClsBancos
Public Function UpdateBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer, Public Function UpdateBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer,
LimiteCredito As Double, FormatoCheque As String, Estatus As Boolean, CveCuenta As Integer, ConvenioPagoElectronico As String, LimiteCredito As Double, FormatoCheque As String, Estatus As Boolean, CveCuenta As Integer, ConvenioPagoElectronico As String,
UsaLayout As Boolean, UsaTarjeta As Boolean, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False, UsaLayout As Boolean, UsaTarjeta As Boolean, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False,
Optional CveCuentaPadre As Integer = Nothing, Optional CveSubProyecto As Integer = -1, Optional NumeroSucursal As String = "-1") As Boolean Optional CveCuentaPadre As Integer = Nothing, Optional CveSubProyecto As Integer = -1, Optional NumeroSucursal As String = "-1", Optional ConvenioPagoElectronicoNomina As String = "-1") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Banc_BancosCuentasUpdate") DataAdapter("PA_Banc_BancosCuentasUpdate")
@@ -533,6 +537,7 @@ Public Class ClsBancos
.Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Estatus", SqlDbType.Bit).Value = Estatus
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@ConvenioPagoElectronico", SqlDbType.VarChar).Value = ConvenioPagoElectronico .Add("@ConvenioPagoElectronico", SqlDbType.VarChar).Value = ConvenioPagoElectronico
.Add("@ConvenioPagoElectronicoNomina", SqlDbType.VarChar).Value = ConvenioPagoElectronicoNomina
.Add("@UsaLayout", SqlDbType.Bit).Value = UsaLayout .Add("@UsaLayout", SqlDbType.Bit).Value = UsaLayout
.Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta .Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta
.Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos .Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos
@@ -3110,9 +3115,9 @@ Public Class ClsBancos
Return Retorno Return Retorno
End Function End Function
Public Function AddLayoutEnvios(Archivo As String, Fecha As Date, CveCuenta As Integer, Optional PorGrupos As Boolean = False) As Integer Public Function AddLayoutEnvios(Archivo As String, Fecha As Date, CveCuenta As Integer, Optional PorGrupos As Boolean = False, Optional GenSecuencia As Boolean = False, Optional AltaCuenta As Boolean = False) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
SecuenciaLayout = 0
DataAdapter("PA_Banc_LayoutEnviosAdd") DataAdapter("PA_Banc_LayoutEnviosAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -3121,11 +3126,17 @@ Public Class ClsBancos
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@PorGrupos", SqlDbType.Bit).Value = PorGrupos .Add("@PorGrupos", SqlDbType.Bit).Value = PorGrupos
.Add("@CveLayoutEnvio", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveLayoutEnvio", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@GenSecuencia", SqlDbType.Bit).Value = GenSecuencia
.Add("@AltaCuenta", SqlDbType.Bit).Value = AltaCuenta
.Add("@Secuencia", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
Retorno = SqlAdapter.SelectCommand.Parameters("@CveLayoutEnvio").Value.ToString.ToEntero Retorno = SqlAdapter.SelectCommand.Parameters("@CveLayoutEnvio").Value.ToString.ToEntero
SecuenciaLayout = SqlAdapter.SelectCommand.Parameters("@Secuencia").Value.ToString.ToEntero
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al agregar el LayoutEnvio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) OnError("Ocurrió un error al agregar el LayoutEnvio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try End Try

View File

@@ -35,6 +35,7 @@ Public Class ClsExportaciones
Public Property CveExportacion As Integer Public Property CveExportacion As Integer
Public Property CveExportacionDetalle As Integer Public Property CveExportacionDetalle As Integer
Public Property CveExportacionDescarga As Integer
#End Region #End Region
@@ -351,13 +352,14 @@ Public Class ClsExportaciones
Return Retorno Return Retorno
End Function End Function
Public Function AddPartida(CvePS As Integer, CveUnidadMedida As Integer, Precio As Decimal, CveEmpresa As Integer, CveUsuario As Integer, CveExportacion As Integer, Cantidad As Decimal, Public Function AddPartida(CvePS As Integer, CveUnidadMedida As Integer, CveTipoEmpaque As Integer, Precio As Decimal, CveEmpresa As Integer, CveUsuario As Integer, CveExportacion As Integer, Cantidad As Decimal,
PesoUnitario As Decimal, CvePais As Integer) As Boolean PesoUnitario As Decimal, CvePais As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDetalleAdd") DataAdapter("PA_Exp_ExportacionesDetalleAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveTipoEmpaque", SqlDbType.Int).Value = CveTipoEmpaque
.Add("@Precio", SqlDbType.Decimal).Value = Precio .Add("@Precio", SqlDbType.Decimal).Value = Precio
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
@@ -378,7 +380,7 @@ Public Class ClsExportaciones
Return Retorno Return Retorno
End Function End Function
Public Function UpdatePartida(CveExportacionDetalle As Integer, CvePS As Integer, CveUnidadMedida As Integer, Precio As Decimal, CveUsuario As Integer, Cantidad As Decimal, Public Function UpdatePartida(CveExportacionDetalle As Integer, CvePS As Integer, CveUnidadMedida As Integer, CveTipoEmpaque As Integer, Precio As Decimal, CveUsuario As Integer, Cantidad As Decimal,
PesoUnitario As Decimal, CvePais As Integer) As Boolean PesoUnitario As Decimal, CvePais As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDetalleUpdate") DataAdapter("PA_Exp_ExportacionesDetalleUpdate")
@@ -386,6 +388,7 @@ Public Class ClsExportaciones
.Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveTipoEmpaque", SqlDbType.Int).Value = CveTipoEmpaque
.Add("@Precio", SqlDbType.Decimal).Value = Precio .Add("@Precio", SqlDbType.Decimal).Value = Precio
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad
@@ -417,6 +420,81 @@ Public Class ClsExportaciones
End Function End Function
#End Region #End Region
#Region "DESCARGAS"
Public Function GetDescargas(CveEmpresa As Integer, Optional CveExportacion As Integer = -1, Optional CveExportacionDescarga As Integer = -1, Optional CveExportacionDetalle As Integer = -1, Optional CveImportacionDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDescargaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion
.Add("@CveExportacionDescarga", SqlDbType.Int).Value = CveExportacionDescarga
.Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle
.Add("@CveImportacionDetalle", SqlDbType.Int).Value = CveImportacionDetalle
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las Descargas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddDescarga(CveExportacionDetalle As Integer, CveImportacionDetalle As Integer, Cantidad As Decimal, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDescargaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle
.Add("@CveImportacionDetalle", SqlDbType.Int).Value = CveImportacionDetalle
.Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveExportacionDescarga", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
CveExportacionDescarga = SqlAdapter.SelectCommand.Parameters("@CveExportacionDescarga").Value.ToString.ToEntero
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al guardar la Descarga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateDescarga(CveExportacionDescarga As Integer, CveExportacionDetalle As Integer, CveImportacionDetalle As Integer, Cantidad As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDescargaUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveExportacionDescarga", SqlDbType.Int).Value = CveExportacionDescarga
.Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle
.Add("@CveImportacionDetalle", SqlDbType.Int).Value = CveImportacionDetalle
.Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la Descarga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveDescarga(CveExportacionDescarga As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDescargaRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveExportacionDescarga", SqlDbType.Int).Value = CveExportacionDescarga
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar la Descarga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region "AGENTES" #Region "AGENTES"
Public Function GetAgentes(Optional CveAgente As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean Public Function GetAgentes(Optional CveAgente As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -4018,7 +4018,7 @@ Public Class ClsGenerales
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function CancelarTimbreTimbrado(CveTimbre As Integer, FechaCancelacion As DateTime, CvePACCancelacion As Integer, SelloCancelacion As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Public Function CancelarTimbreTimbrado(CveTimbre As Integer, FechaCancelacion As DateTime, CvePACCancelacion As Integer, SelloCancelacion As String, CveUsuario As Integer, CveEmpresa As Integer, Optional RegenerarTimbre As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreTimbradoCancelar") DataAdapter("PA_Gral_TimbreTimbradoCancelar")
@@ -4030,6 +4030,27 @@ Public Class ClsGenerales
.Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion .Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@RegenerarTimbre", SqlDbType.Bit).Value = RegenerarTimbre
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el timbrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function ReactivarTimbreEntregaAlmacen(CveTimbre As Integer, CveEntregaAlmacen As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreReactivarUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try Try
@@ -4040,6 +4061,7 @@ Public Class ClsGenerales
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function RemoveGralTimbre(CveTimbre As Integer, CveEmpresa As Integer) As Boolean Public Function RemoveGralTimbre(CveTimbre As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreRemove") DataAdapter("PA_Gral_TimbreRemove")

View File

@@ -2858,7 +2858,7 @@ Public Class ClsNominas
End Try End Try
Return retorno Return retorno
End Function End Function
Public Function GetchecadorAsistencia(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean Public Function GetchecadorAsistencia(FechaInicio As DateTime, FechaFin As DateTime, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
Dim retorno As Boolean = False Dim retorno As Boolean = False
Try Try
@@ -2867,6 +2867,7 @@ Public Class ClsNominas
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio
.Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
SqlAdapter.Fill(DTSet) SqlAdapter.Fill(DTSet)

886
App_Code/ClsPagoScotia.vb Normal file
View File

@@ -0,0 +1,886 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports DocumentFormat.OpenXml.Math
Imports Extensiones
Public Class ClsPagoScotia
Implements IDisposable
Public Sub New()
' Constructor privado para evitar instanciación directa
End Sub
'====================================================================
' GeneraPagoScotiaBank – Layout Pagos Scotiabank
'====================================================================
' ▸ Genera un archivo de pagos masivos para Scotiabank (Archivo de intercambio EE).
' ▸ Registros y longitudes exactas:
' • HA, HB, DA, TB, TA → 370 caracteres
' • DM (correo) → 104 caracteres
' ▸ Se permite partición por bloques (TamanoBloque), pero todo dentro de un
' mismo método para claridad. Sólo se complementa con LimpiarTextoScotia().
'====================================================================
Public Property ErrorLayout As Boolean = False
Public Property LayoutStr As String = String.Empty
Public Property LayouErrorStr As String = String.Empty
Public Property TotalPagos As Integer = 0
Public Property NombreArchivo As String = ""
Public Function GeneraPagoScotiaBank(ByVal DTPendientes As DataTable, InsertaEnDB As Boolean, CveCuenta As Integer, UsuarioActual As Usuario, Secuencia As Integer, Optional EsNomina As Boolean = False) As Boolean
'ConvenioPagoElectronico = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("ConvenioPagoElectronico", $" CveCuenta = {DdlCuenta.SelectedValue}").ToString();
Dim TamanoBloque As Integer = 5000 ' pagos por bloque
ErrorLayout = False
LayoutStr = ""
LayouErrorStr = ""
TotalPagos = 0
NombreArchivo = ""
'Dim ErrorLayout As Boolean = False
'------------------- VALIDACIONES BÁSICAS ---------------------------
If DTPendientes Is Nothing OrElse DTPendientes.Rows.Count = 0 Then
LayouErrorStr = "No hay datos pendientes para generar el Layout de ScotiaBank."
ErrorLayout = True
End If
Dim CuentaCargo As String = DTPendientes.Rows(0)("CLABEOrigen").ToString
If CuentaCargo.Length <> 11 Then
LayouErrorStr = "El campo CuentaCargo debe ser numérico de 11 dígitos."
ErrorLayout = True
End If
Dim NumeroConvenio As String = DTPendientes.Rows(0)("ConvenioPagoElectronico").ToString
If EsNomina Then
NumeroConvenio = DTPendientes.Rows(0)("ConvenioPagoElectronicoNomina").ToString
End If
If NumeroConvenio.Trim.Length = 0 Then
LayouErrorStr = "El campo NumeroConvenio (ConvenioPagoElectronico) no está definido en los datos de la cuenta."
ErrorLayout = True
End If
If NumeroConvenio.Length <> 5 Then
LayouErrorStr = "El campo NumeroConvenio debe ser numérico de 5 dígitos."
ErrorLayout = True
End If
'------------------- ACUMULADORES -----------------------------------
Dim sb As New StringBuilder()
'Dim totalPagos As Integer = 0
Dim totalImporte As Decimal = 0D
Dim pagosBloque As Integer = 0
Dim importeBloque As Decimal = 0D
Dim numBloque As Integer = 0
Dim SPACE As Char = " "c
Dim CERO As Char = "0"c
'------------------- HEADER ARCHIVO (HA) ----------------------------
Dim ha As New StringBuilder()
ha.Append("EE") ' 1‑2 Tipo Archivo
ha.Append("HA") ' 3‑4 Tipo Registro
ha.Append(NumeroConvenio.PadLeft(5, CERO)) ' 5‑9 Nº Convenio
ha.Append(Secuencia.ToString.PadLeft(2, CERO)) ' 10‑11 Secuencia fija "01"
ha.Append("00000000") ' 12‑19 Fecha generación
ha.Append("00000000") ' 20‑27 Fecha inicial (opcional)
ha.Append("00000000") ' 28‑35 Fecha final (opcional)
ha.Append("000") ' 36‑38 Código status "000"
ha.Append(" ".PadLeft(332, SPACE)) ' 39‑370 FILLER (espacios)
sb.AppendLine(ha.ToString())
'------------------- RECORRIDO DETALLES -----------------------------
Dim SBErrores As StringBuilder = New StringBuilder()
'Dim esError As Boolean = False
Dim idx As Integer = 0
Dim hb As New StringBuilder()
hb.Append("EE") ' 1‑2
hb.Append("HB") ' 3‑4
hb.Append("00") ' 5‑6 Moneda cuenta cargo (00=MXN)
hb.Append("0000") ' 7‑10 Uso futuro = ceros
hb.Append(CuentaCargo) ' 11‑21 Cuenta cargo (11)
hb.Append("0000000001") ' 22‑31 Referencia de cargo? (ejemplo)
hb.Append("000") ' 32‑34 Codigo del registro
hb.Append(" ".PadLeft(336, SPACE)) ' 35‑370 FILLER espacios
sb.AppendLine(hb.ToString())
For Each dr As DataRow In DTPendientes.Rows
''--- ¿Inicia BLOQUE? (HB) ---------------------------------------
'If idx Mod TamanoBloque = 0 Then
' numBloque += 1
' pagosBloque = 0
' importeBloque = 0D
' Dim hb As New StringBuilder(New String(" "c, 370))
' hb.Append("EE") ' 1‑2
' hb.Append("HB") ' 3‑4
' hb.Append("00") ' 5‑6 Moneda cuenta cargo (00=MXN)
' hb.Append("0000") ' 7‑10 Uso futuro = ceros
' hb.Append(CuentaCargo) ' 11‑21 Cuenta cargo (11)
' hb.Append("0000000001") ' 22‑31 Referencia de cargo? (ejemplo)
' hb.Append("000") ' 32‑34 Codigo del registro
' hb.Append(" ".PadLeft(336, SPACE)) ' 35‑370 FILLER espacios
' sb.AppendLine(hb.ToString())
'End If
'----------- DETALLE ALTA (DA) ----------------------------------
Dim importe As Decimal = 0D
If Not Decimal.TryParse(Convert.ToString(dr("Importe")), importe) Then
'Alert($"Importe inválido en fila {idx + 1}", TipoMensaje.MsgAdvertencia)
SBErrores.Append($"Importe inválido en fila {idx + 1}")
ErrorLayout = True
End If
If importe <= 0D Then
Alert($"Importe debe ser mayor a 0 en fila {idx + 1}", TipoMensaje.MsgAdvertencia)
ErrorLayout = True
End If
Dim importeInt As String = CDec(Math.Round(importe * 100).ToEntero).ToString().PadLeft(15, CERO) ' 2 dec.
Dim fechaAplicacion As String = ClsPaginas.NowADS.ToString("yyyyMMdd")
Dim cveBenef As String = LimpiarTextoScotia(Convert.ToString(dr("CveProveedor"))).PadRight(20)
Dim rfc As String = LimpiarTextoScotia(Convert.ToString(dr("RFC"))).PadRight(13)
Dim nombreBen As String = LimpiarTextoScotia(Convert.ToString(dr("RazonSocial"))).PadRight(40)
Dim CveIE As Integer = dr("CveIE").ToString.ToEntero
Dim referenciaPago As String = CveIE.ToString.PadLeft(16, CERO) 'If(dr.Table.Columns.Contains("Referencia"), LimpiarTextoScotia(Convert.ToString(dr("Referencia"))).PadLeft(16, "0"c), New String("0"c, 16))
Dim CuentaDestino As String = ""
Dim cuentaDigitos As String = Convert.ToString(dr("CLABEDestino"))
Dim clabe As String = Convert.ToString(dr("CLABE"))
Dim CveBanco As String = dr("CveBanco").ToString.PadLeft(3, CERO)
If cuentaDigitos.Length = 11 AndAlso CveBanco = "044" Then
CuentaDestino = cuentaDigitos
ElseIf clabe.Length = 18 Then
CuentaDestino = clabe
Else
CuentaDestino = clabe
SBErrores.Append($"Cuenta {CuentaDestino} debe tener 11 o 18 dígitos.<br>")
ErrorLayout = True
End If
Dim TipoCuenta As String = If(CuentaDestino.Length = 18, "9", "1") ' 09=18 dígitos, 01=11 dígitos
CuentaDestino = CuentaDestino.PadLeft(20, CERO)
If CveBanco = "000" Then
SBErrores.Append($"CveBanco inválida en fila {idx + 1}. Debe ser numérico de 3 dígitos.")
ErrorLayout = True
End If
Dim ConceptoPago As String = dr("Observaciones").ToString.Trim
If ConceptoPago.Length > 50 Then
ConceptoPago = ConceptoPago.Substring(0, 50) ' Limitar a 50 caracteres
End If
ConceptoPago = ConceptoPago.PadRight(50, SPACE)
Dim da As New StringBuilder()
da.Append("EE") ' 1‑2
da.Append("DA") ' 3‑4
da.Append("04") ' 5‑6 Tipo movimiento (04=SPEI)
da.Append("00") ' 7‑8 Moneda pago (00=MXN)
da.Append(importeInt) ' 9‑23 Importe (15)
da.Append(fechaAplicacion) ' 24‑31
da.Append("03") ' 32‑33 Servicio‑concepto (03)
da.Append(cveBenef) ' 34‑53
da.Append(rfc) ' 54‑66
da.Append(nombreBen) ' 67‑106
da.Append(referenciaPago) ' 107‑122
da.Append("00000") ' 123‑127 Plaza pago (ceros)
da.Append("00000") ' 128‑132 Sucursal pago (ceros)
da.Append(CuentaDestino) ' 133‑152 clabe destino (ceros)
da.Append("00000") ' 153‑157 PAIS (ceros)
da.Append("".PadLeft(40, SPACE)) ' 158‑197 Ciudad espacio (espacios en blanco)
da.Append(TipoCuenta) ' 198-198 Tipo cuenta
da.Append(SPACE) ' 199-199 digito intercambio
da.Append("00000") ' 200-204 plaza cuenta banco
da.Append("044") ' 205-207 num banco emisor (044=ScotiaBank)
da.Append(CveBanco) ' 208-210 num banco receptor (044=ScotiaBank)
da.Append("001") ' 211-213 dias vigencia
da.Append(ConceptoPago) ' 214-263 Concepto pago
da.Append("".PadLeft(60, SPACE)) '264-283 CAMPO-USO-EMPRESA-1
' 284-303 CAMPO-USO - Empresa - 2
' 304-323 CAMPO-USO - Empresa - 3
da.Append("".PadLeft(41, CERO)) ' 324-326 CODIGO-STATUS - REGISTRO NUM 3
' 327-327 CVE-CAMBIO - INST NUM 1
' 328-330 CODIGO-STATUS - CAMBIO - INST NUM 3
' 331-338 FECHA DE PAGO (Pago en ventanilla) NUM 8
' 339-343 PLAZA DE PAGO (Pago en ventanilla) NUM 5
' 344-348 SUCURSAL DE PAGO (Pago en ventanilla) NUM 5
' 349-364 FOLIO-UNICO NUM 16
da.Append("".PadLeft(6, SPACE))
sb.AppendLine(da.ToString()) '345-370 FILLER ALF 6
'----------- DETALLE MAIL (DM) 104 -------------------------
Dim correo As String = dr("Correo").ToString.Trim
If correo.Trim.Length = 0 Then
SBErrores.Append($" {nombreBen} Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido.<br>")
ErrorLayout = True
End If
Dim dm As New StringBuilder()
dm.Append("EE") ' 1‑2 Tipo archivoz
dm.Append("DM") ' 3‑4 Tipo registro
dm.Append(correo.PadRight(100)) ' 5‑104 Email + filler
da.Append("".PadLeft(34, CERO)) ' 105-138 Uso Futuro
da.Append("".PadLeft(30, SPACE)) ' 139-168 Clave de Rastreo llenar con espacios en blanco
da.Append("".PadLeft(20, SPACE)) ' 169-188 Referencia de Abono Banxico
dm.Append(" ") ' 189-190 Tipo de Operación anexo G
da.Append("".PadLeft(232, SPACE)) ' 191-370 FILLER
sb.AppendLine(dm.ToString())
'----------- ACUMULADORES ---------------------------------------
TotalPagos += 1
totalImporte += importe
pagosBloque += 1
importeBloque += importe
'----------- ¿CIERRA BLOQUE? (TB) -------------------------------
Dim bloqueCompleto As Boolean = (pagosBloque = TamanoBloque)
Dim ultimoRegistro As Boolean = (idx = DTPendientes.Rows.Count - 1)
idx += 1
Next
'If bloqueCompleto OrElse ultimoRegistro Then
Dim tb As New StringBuilder()
tb.Append("EE") ' 1‑2
tb.Append("TB") ' 3‑4
tb.Append(pagosBloque.ToString().PadLeft(7, CERO)) ' 5‑11 Cnt altas
tb.Append((importeBloque * 100).ToEntero.ToString().PadLeft(17, CERO)) ' 12‑28 Importe altas
tb.Append("".PadLeft(7, CERO)) ' 29‑35 Cnt bajas
tb.Append("".PadLeft(17, CERO)) ' 36‑52 Importe bajas
tb.Append("".PadLeft(195, CERO))
' 53-59 CANTIDAD DE MOVIMIENTOS ALTAS
' 60-76 IMPORTE DE MOVIMIENTOS ALTAS
' 77-83 CANTIDAD DE MOVIMIENTOS BAJAS
' 84-100 IMPORTE DE MOVIMIENTOS BAJAS
' 101-107 CANTIDAD DE MOVIMIENTOS ALTAS
' 108-124 IMPORTE DE MOVIMIENTOS ALTAS
' 125-131 CANTIDAD DE MOVIMIENTOS BAJAS
' 132-148 IMPORTE DE MOVIMIENTOS BAJAS
' 149-155 CANTIDAD DE MOVIMIENTOS PAGADOS
' 156-172 IMPORTE DE MOVIMIENTOS PAGADOS
' 173-179 CANTIDAD DE MOVIMIENTOS DEVUELTOS
' 180-196 IMPORTE DE MOVIMIENTOS DEVUELTOS
' 197-203 CANTIDAD DE MOVIMIENTOS RECH
' 204-220 IMPORTE DE MOVIMIENTOS RECH
' 221-227 CANTIDAD DE MOVIMIENTOS BAJA
' 228-244 IMPORTE DE MOVIMIENTOS BAJA
' 245-247 CODIGO-STATUS-REGISTRO
tb.Append("".PadLeft(123, SPACE)) ' 248-370 FILLER (espacios)
sb.AppendLine(tb.ToString())
'End If
'------------------- TRAILER ARCHIVO (TA) ---------------------------
Dim ta As New StringBuilder()
ta.Append("EE") ' 1‑2
ta.Append("TA") ' 3‑4
ta.Append(TotalPagos.ToString().PadLeft(7, CERO)) ' 5‑11
ta.Append((totalImporte * 100).ToEntero.ToString().PadLeft(17, CERO)) ' 12‑28
ta.Append("".PadLeft(7, CERO)) ' 29‑35 Cnt bajas
ta.Append("".PadLeft(17, CERO)) ' 36‑52 Importe bajas
ta.Append("".PadLeft(198, CERO))
' 53-59 CANTIDAD DE MOVIMIENTOS ALTAS
' 60-76 IMPORTE DE MOVIMIENTOS ALTAS
' 77-83 CANTIDAD DE MOVIMIENTOS BAJAS
' 84-100 IMPORTE DE MOVIMIENTOS BAJAS
' 101-107 CANTIDAD DE MOVIMIENTOS ALTAS
' 108-124 IMPORTE DE MOVIMIENTOS ALTAS
' 125-131 IMPORTE DE MOVIMIENTOS BAJAS
' 132-148 MOVIMIENTOS PAGADOS
' 149-155 IMPORTE DE MOVIMIENTOS PAGADOS
' 156-172 MOVIMIENTOS DEVUELTOS
' 173-179 IMPORTE DE MOVIMIENTOS DEVUELTOS
' 180-196 MOVIMIENTOS RECHAZADOS
' 197-203 CANTIDAD DE MOVIMIENTOS RECH
' 204-220 IMPORTE DE MOVIMIENTOS RECH
' 221-227 CANTIDAD DE MOVIMIENTOS BAJA
' 228-244 IMPORTE DE MOVIMIENTOS BAJA
' 245-247 CODIGO-STATUS-REGISTRO
' 248-250 CODIGO-STATUS-ARCHIVO
ta.Append("".PadLeft(120, SPACE))
sb.Append(ta.ToString())
'------------------- ESCRIBIR ARCHIVO -------------------------------
'File.WriteAllText(RutaArchivo, sb.ToString(), Encoding.ASCII)
NombreArchivo = $"pagos_{ClsPaginas.NowADS.ToString("ddMMyyyy")}_001.txt"
'"pagos_03062025_001.txt"
'If InsertaEnDB Then
' Dim ObjBancos As New ClsBancos
' ObjBancos.IniciaTransacSQL()
' Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, ClsPaginas.NowADS(), CveCuenta, PorGrupos:=False)
' If CveLayoutEnvio > 0 Then
' For Each dr As DataRow In DTPendientes.Rows
' If dr("CveProveedor").ToString <> "" Or dr("CvePersonal").ToString <> "" Then
' If Not ObjBancos.AddLayoutEnviosDetalle(CveLayoutEnvio, dr("CveIE").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero, 1, "Observaciones") Then
' ErrorLayout = True
' Exit For
' End If
' End If
' Next
' Else
' ErrorLayout = True
' End If
' If ErrorLayout Then
' ObjBancos.RollBack()
' ObjBancos.Dispose()
' Else
' ObjBancos.Commit()
' ObjBancos.Dispose()
' End If
'End If
Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
Dim pathDirectorio As String = String.Format("{0}Layout\", UsuarioActual.Empresa.Ruta)
If File.Exists(path) Then
File.Delete(path)
End If
If Not Directory.Exists(pathDirectorio) Then
Directory.CreateDirectory(pathDirectorio)
End If
'Dim Texto As String =
Dim fs As FileStream = File.Create(path)
Dim info As Byte() = New UTF8Encoding(True).GetBytes(sb.ToString)
fs.Write(info, 0, info.Length)
fs.Close()
If ErrorLayout Then
LayouErrorStr = LayouErrorStr & $"{SBErrores.ToString}"
Return False
Else
LayoutStr = sb.ToString()
Return True
End If
End Function
'====================================================================
' Limpia texto: A‑Z, 0‑9, «@» y «.» (UpperCase) – el resto se descarta
'====================================================================
Private Function LimpiarTextoScotia(ByVal valor As String) As String
Dim sb As New StringBuilder()
For Each ch As Char In If(valor, String.Empty).ToUpperInvariant()
If Char.IsLetterOrDigit(ch) OrElse ch = "@"c OrElse ch = "."c Then sb.Append(ch)
Next
Return sb.ToString()
End Function
#Region "LAYOUT SCOTIABANK"
'====================================================================
' GenerarLayoutPagosScotia
'====================================================================
Public Function AltaCuentasScotia(
DtPendientesTemp As DataTable,
UsuarioActual As Usuario,
Optional NumeroConvenio As String = "", ' 5 dígitos
Optional SistemaCentral As String = "001", ' 3 dígitos
Optional TipoArchivo As String = "EE", ' 2 digitos (define tu propio código)
Optional Secuencia As Integer = 1, ' 3 dígitos, consecutivo del día
Optional MovimientoDefault As Char = "P"c ' P =pago, cambia si usas A/C/B
) As Boolean
'Dim objBanco As New ClsBancos
ErrorLayout = False
LayoutStr = ""
LayouErrorStr = ""
TotalPagos = 0
NombreArchivo = ""
'------------------- Constantes de layout -------------------
Dim LARGO_REGISTRO As Integer = 140
Dim Cero As Char = "0"c
Dim Space As Char = " "c
Dim NumeroArchivo As Integer = 1 ' ajústalo si manejas consecutivo diario
Dim FechaArchivo As Date = ClsPaginas.NowADS().Date
'If DtPendientesTemp Is Nothing Then DtPendientesTemp = DTPendientes.Copy
DtPendientesTemp.CaseSensitive = False
If DtPendientesTemp.Columns.Contains("Nombre") Then
DtPendientesTemp = DtPendientesTemp.FiltraParametros("", "",
{"CLABEDestino", "CLABE", "CveBanco", "CveCuentaDeposito", "EstatusCtaDeposito", "EstatusPagoElectronicoScotia", "BancoNombre", "FechaEliminacion", "ConvenioPagoElectronico", "Nombre"}
)
Else
DtPendientesTemp = DtPendientesTemp.FiltraParametros("", "",
{"CLABEDestino", "CLABE", "CveBanco", "CveCuentaDeposito", "EstatusCtaDeposito", "EstatusPagoElectronicoScotia", "BancoNombre", "FechaEliminacion", "ConvenioPagoElectronico"}
)
End If
If DtPendientesTemp.Rows.Count = 0 Then
LayouErrorStr = "No hay datos pendientes para generar el Layout de ScotiaBank."
ErrorLayout = True
End If
'------------------- Acumulados para el trailer -------------
Dim Altas As Integer = 0, Cambios As Integer = 0
Dim Bajas As Integer = 0, Consultas As Integer = 0
'------------------- Acumulados para el trailer -------------
'------------------- ConvenioPagoElectronico = "0000000" ' 5 dígitos
If Not NumeroConvenio.Trim.Length > 0 Then
NumeroConvenio = DtPendientesTemp.Rows(0)("ConvenioPagoElectronico").ToString
End If
If NumeroConvenio.Trim.Length = 0 Then
LayouErrorStr = "El campo NumeroConvenio (ConvenioPagoElectronico) no está definido en los datos de la cuenta."
ErrorLayout = True
End If
Dim sb As New StringBuilder
'=============================================================
' 1) HEADER (140 )
'=============================================================
'Dim hoy As Date = Now.Date
'Dim hora As String = Now.ToString("HHmmss")
Dim Header As New StringBuilder()
Header.Append(TipoArchivo.PadRight(2, Space)) 'TIPO ARCHIVO (2)
Header.Append("HA") 'TIPO REGISTRO (2)
Header.Append("JDF") 'SISTEMA-CENTRAL (3)
Header.Append(NumeroConvenio.PadLeft(7, Cero)) 'NUMERO DE CONTRATO (7) ' ocupa 5 dígitos pero en el layout se usa 7
Header.Append(ClsPaginas.NowADS.ToString("yyyyMMdd")) 'FECHA-SOLICITUD (8)
Header.Append(Secuencia.ToString().PadLeft(3, Cero)) 'SECUENCIA (3)
Header.Append("M") 'MANTENIMIENTO-O-CONSULTA (1)
Header.Append(" ".PadLeft(8, Space)) 'FECHA GENERACIÓN ARCHIVO (8) *** Respusta de ScotiaBank ***
Header.Append(" ".PadLeft(6, Space)) 'Hora GENERACIÓN ARCHIVO (6) *** Respusta de ScotiaBank ***
Header.Append(" ".PadLeft(3, Space)) 'CÓDIGO-RESPUESTA (3) *** Respusta de ScotiaBank ***
Header.Append(" ".PadLeft(97, Space)) 'FILLER (97)
sb.AppendLine(Header.ToString)
'=============================================================
' 2) DETALLES (140 )
'=============================================================
Dim Contador As Integer = 2
Dim SBErrores As New StringBuilder
For Each dr As DataRow In DtPendientesTemp.Rows
Dim registro As New StringBuilder()
Dim esError As Boolean = False
'---- Datos base tomados de DTPendientes ------------------
Dim CuentaDestino As String = ""
Dim cuentaDigitos As String = dr("CLABEDestino").ToString.Trim
Dim Clabe As String = dr("CLABE").ToString.Trim
Dim limite As String = (9000000000 * 100D).ToString("F0")
Dim banco As String = dr("CveBanco").ToString.PadLeft(3, Cero)
If cuentaDigitos.Length = 11 AndAlso banco = "044" Then
CuentaDestino = cuentaDigitos
ElseIf Clabe.Length = 18 Then
CuentaDestino = Clabe
Else
CuentaDestino = Clabe
If DtPendientesTemp.Columns.Contains("Nombre") Then
SBErrores.Append($"Empleado {dr("Nombre").ToString} Cuenta *{CuentaDestino}* debe tener 11 o 18 dígitos.<br>")
Else
SBErrores.Append($"Linea {Contador} Cuenta *{CuentaDestino}* debe tener 11 o 18 dígitos.<br>")
End If
esError = True
End If
If banco.Length <> 3 OrElse Not IsNumeric(banco) OrElse banco = "000" Then
SBErrores.Append($"Linea {Contador} Cuenta *{CuentaDestino}* código {banco} no es un banco válido. Debe ser numérico de 3 dígitos.<br>")
esError = True
End If
Dim CveCuentaDeposito As String = dr("CveCuentaDeposito").ToString
'Dim movimiento As Char = If(dr.Table.Columns.Contains("Movimiento"),
' dr("Movimiento").ToString.FirstOrDefault(), MovimientoDefault)
Dim CVETIPOCUENTA As String = If(CuentaDestino.Length = 18, "09", "01")
'---- TIPO DE REGISTRO ------------------
'ANEXO E de ScotiaBank
'DA = DETALLE ALTA DE DATOS DE CUENTA Y LIMITE RELACIONADO
'DC = DETALLE CAMBIOS DE DATOS DE CUENTA Y LIMITE RELACIONADO
'DB = DETALLE BAJA DE DATOS DE CUENTA Y LIMITE RELACIONADO
'DQ = DETALLE CONSULTA DE DATOS DE CUENTA Y LIMITE RELACIONADO
'DR = DETALLE RESPUESTA *** Respusta de ScotiaBank ***
Dim TipoRegistro As String = "DA" ' Por default es D (Alta), cambia a C si es cambio o baja
'---- TIPO DE REGISTRO ------------------
'---- Construcción del registro ---------------------------
registro.Append(TipoArchivo.PadRight(2, Space)) 'TIPO ARCHIVO (2)
registro.Append(TipoRegistro) 'TIPO REGISTRO (2)
registro.Append("A") 'CVE-MOVIMIENTO-CUENTA (1)
registro.Append(CVETIPOCUENTA) 'CVE-TIPO - CUENTA (2)
registro.Append("00") 'CVE-MONEDA - CUENTA (2) 00 Pesps 01 Dollares
registro.Append(banco) 'NUM-banco - CUENTA (3)
registro.Append(CuentaDestino.PadLeft(20, Cero)) 'NUM-CUENTA (20)
registro.Append(ClsPaginas.NowADS.AddDays(364).ToString("yyyyMMdd")) 'FECHA DE ELIMINACIÓN (8)
registro.Append(CveCuentaDeposito.PadRight(50, Space)) 'DESCRIPCIÓN (50)
registro.Append(limite.PadLeft(17, Cero)) 'LIMITE-POR-TRANSACCIÓN (17)
registro.Append("04") 'TIPO DE PAGO (2)
registro.Append(" ") 'CÓDIGO-RESPUESTA (3) CÓDIGO DE RESPUESTA DE REG. "D*", ANEXO 'C' *** Respusta de ScotiaBank ***
registro.Append(" ".PadLeft(28, Space)) 'FILLER (28)
sb.AppendLine(registro.ToString)
If registro.Length = LARGO_REGISTRO AndAlso Not esError Then
Select Case TipoRegistro
Case "DA"
Altas = Altas + 1
Case "DC"
Cambios = Cambios + 1
Case "DB"
Bajas = Bajas + 1
Case "DQ"
Consultas = Consultas + 1
Case Else
esError = True
ErrorLayout = True
End Select
Else
If registro.Length <> LARGO_REGISTRO Then
SBErrores.Append($"Error linea {Contador} tamaño esperado: {LARGO_REGISTRO} tamaño: {registro.Length}, <br>")
End If
ErrorLayout = True
End If
Contador += 1
Next
'=============================================================
' 3) TRAILER (PIE) (140)
'=============================================================
Dim trailer As New StringBuilder()
trailer.Append(TipoArchivo.PadRight(2, Space)) 'TIPO DE ARCHIVO (2)
trailer.Append("TA") 'TIPO DE REGISTRO (2)
trailer.Append(Altas.ToString.PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS ALTAS (8)
trailer.Append(Cambios.ToString.PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS CAMBIOS (8)
trailer.Append(Bajas.ToString.PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS BAJAS (8)
trailer.Append(Consultas.ToString.PadLeft(8, Cero)) 'CANTIDAD DE CONSULTAS (8)
'MOVIMIENTOS ACEPTADOS
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS ALTAS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS CAMBIOS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS BAJAS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE CONSULTAS (8) *** Respusta de ScotiaBank ***
'MOVIMIENTOS RECHAZADOS
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS ALTAS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS CAMBIOS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE MOVIMIENTOS BAJAS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(8, Cero)) 'CANTIDAD DE CONSULTAS (8) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(3, Cero)) 'CÓDIGO-RESPUESTA (3) *** Respusta de ScotiaBank ***
trailer.Append("0".PadLeft(3, Cero)) 'CÓDIGO-RESPUESTA - Archivo (3) *** Respusta de ScotiaBank ***
trailer.Append(" ".PadLeft(34, Space)) 'FILLER (34)
sb.Append(trailer.ToString)
'------------------- Crear archivo y mostrar descargas ------------------
If sb.Length = 0 Then
SBErrores.Append("No se generó ningún registro válido para Bajío.<br>")
ErrorLayout = True
End If
NombreArchivo = $"altacuentasScotia_{FechaArchivo:ddMMyyyy}_{NumeroArchivo:D3}.txt"
If SBErrores.Length > 0 Then
LayouErrorStr = "Errores encontrados al generar el layout de ScotiaBank:<br>" & SBErrores.ToString
ErrorLayout = True
Else
If Not CreaArchivo(sb.ToString, NombreArchivo, UsuarioActual:=UsuarioActual) Then
ErrorLayout = True
End If
End If
LayoutStr = sb.ToString()
Return If(ErrorLayout, False, True)
End Function
Private Function CreaArchivo(TextoCompleto As String, NombreArchivoEnviado As String, UsuarioActual As Usuario) As Boolean
DirectoryExistsCreate(String.Format("{0}Layout", UsuarioActual.Empresa.Ruta))
Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
Try
If File.Exists(path) Then
File.Delete(path)
End If
Dim fs As FileStream = File.Create(path)
Dim info As Byte() = New UTF8Encoding(True).GetBytes(TextoCompleto)
fs.Write(info, 0, info.Length)
fs.Close()
Catch ex As Exception
ErrorLayout = True
End Try
Return True
End Function
'---------------------------------------------------------------
' Limpia y normaliza texto para Scotia (solo A-Z,0-9,espacio)
'---------------------------------------------------------------
Private Function LimpiarTextoScotia(txt As String, largo As Integer) As String
Dim clean = New String(txt _
.Normalize(System.Text.NormalizationForm.FormD) _
.Where(Function(ch) Char.IsLetterOrDigit(ch) OrElse ch = " "c) _
.ToArray()) _
.ToUpperInvariant()
Return clean.PadRight(largo).Substring(0, largo)
End Function
Public Shared Function AltaCuentaScotiaCodigoRespuestaAnexoC(ByVal codigo As String) As String
Select Case codigo
Case "002" : Return "NO EXISTE NOMBRE DE APLICACION EN EL NOMBRE DE ARCHIVO"
Case "003" : Return "EL NUM DE CONTRATO EN EL NOMBRE DE ARCHIVO NO ES NUMERICO"
Case "004" : Return "EL NUMERO DE CONTRATO EN EL NOMBRE DE ARCHIVO ES CERO"
Case "005" : Return "EL NUM DE SECUENCIA EN NOMBRE DE ARCHIVO NO ES NUMERICO"
Case "006" : Return "EL NUMERO DE SECUENCIA EN EL NOMBRE DE ARCHIVO ES CERO"
Case "007" : Return "LA CLAVE DE ARCHIVO ES INVALIDA"
Case "008" : Return "LA CLAVE DE REGISTRO ES INVALIDA"
Case "009" : Return "NO EXISTE NOMBRE DE APLICACION EN EL REGISTRO HA"
Case "010" : Return "EL NOMBRE DE APLICACION NO CORRESPONDE AL ARCHIVO"
Case "011" : Return "EL NUMERO DE CONTRATO EN EL REGISTRO HA NO ES NUMERICO"
Case "012" : Return "EL NUMERO DE CONTRATO EN EL REGISTRO HA ES CERO"
Case "013" : Return "EL NUMERO DE CONTRATO NO CORRESPONDE AL ARCHIVO"
Case "014" : Return "EL CONTRATO NO EXISTE"
Case "015" : Return "EL NUMERO DE SECUENCIA EN EL REGISTRO HA NO ES NUMERICO"
Case "016" : Return "EL NUMERO DE SECUENCIA EN EL REGISTRO HA ES CERO"
Case "017" : Return "EL NUMERO DE SECUENCIA NO CORRESPONDE AL ARCHIVO"
Case "018" : Return "EL MOVIMIENTO CUENTA ES UN DATO OBLIGATORIO"
Case "019" : Return "EL MOVIMIENTO CUENTA DEBE SER A"
Case "020" : Return "EL NUMERO DE BANCO NO ES NUMERICO"
Case "021" : Return "EL NUMERO DE BANCO NO EXISTE EN EL CATALOGO"
Case "022" : Return "EL TIPO DE CUENTA ES INVALIDO PARA ESE BANCO"
Case "023" : Return "EL TIPO DE CUENTA NO ES NUMERICO"
Case "024" : Return "LA MONEDA DE LA CUENTA NO ES NUMERICO"
Case "025" : Return "LA MONEDA DE LA CUENTA NO TIENE UN VALOR PERMITIDO"
Case "026" : Return "LA FECHA DE DE VIGENCIA NO ES NUMERICA"
Case "027" : Return "LA FECHA DE VIGENCIA ESTA FUERA DE RANGO"
Case "028" : Return "EL IMPORTE LIMITE ES NO NUMERICO"
Case "029" : Return "EL NUMERO DE ALTAS SOLICITADAS NO ES NUMERICO"
Case "030" : Return "EL NUMERO DE CAMBIOS SOLICITADOS NO ES NUMERICO"
Case "031" : Return "EL NUMERO DE BAJAS SOLICITADAS NO ES NUMERICO"
Case "032" : Return "EL NUMERO DE CONSULTAS SOLICITADAS NO ES NUMERICO"
Case "033" : Return "EL NUMERO DE ALTAS SOLICITADAS NO COINCIDE"
Case "034" : Return "EL NUMERO DE CAMBIOS SOLICITADOS NO COINCIDE"
Case "035" : Return "EL NUMERO DE BAJAS SOLICITADAS NO COINCIDE"
Case "036" : Return "EL NUMERO DE CONSULTAS SOLICITADAS NO COINCIDE"
Case "037" : Return "ARCHIVO RECHAZADO POR MOVIMIENTOS RECHAZADOS"
Case "038" : Return "ARCHIVO RECHAZADO POR NO EXISTIR MOVIMIENTOS CORRECTOS"
Case "039" : Return "EL NUMERO DE CUENTA NO ES NUMERICO"
Case "040" : Return "EL NUMERO DE CUENTA NO CERO"
Case "041" : Return "EL NUMERO DE CUENTA NO EXISTE"
Case "042" : Return "EL NUMERO DE CUENTA NO PERTENECE A ESE BANCO"
Case "043" : Return "LA PLAZA ABM NO EXISTE"
Case "044" : Return "EL DIGITO VERIFICADOR DE LA CLABE NO CORRESPONDE"
Case "045" : Return "LA CUENTA NO ESTA ACTIVA"
Case "046" : Return "LA CUENTA YA EXISTE"
Case "047" : Return "LA CUENTA NO EXISTE"
Case "048" : Return "EL TIPO DE CUENTA NO ES NUMERICO"
Case "049" : Return "EL TIPO DE CUENTA NO TIENE UN VALOR PERMITIDO"
Case "050" : Return "EL IMPORTE LIMITE ES CERO"
Case "051" : Return "NO EXISTE LA CLAVE DE MANTEMIMIENTO/CONSULTA"
Case "052" : Return "LA CLAVE DE MANT/CONS NO TIENE UN VALOR PERMITIDO"
Case "053" : Return "TIPO DE REGISTRO NO VALIDO PARA ARCHIVO DE CONSULTA"
Case Else : Return "CÓDIGO DESCONOCIDO"
End Select
End Function
Public Shared Function PagosScotiaCodigoRespuestaAnexoC(ByVal codigo As String) As String
codigo = codigo.PadLeft(3, "0"c)
Select Case codigo
Case "000" : Return "NO ERROR (OK)"
Case "001" : Return "FIN DE ARCHIVO"
Case "002" : Return "ARCHIVO NO ENCONTRADO"
Case "003" : Return "LECTURA: REGISTRO NO UNICO"
Case "006" : Return "ERROR FUERA DE CATEGORIAS DE CICS"
Case "007" : Return "COMANDOS EN ORDEN ILOGICO"
Case "008" : Return "NO SE TIENE AUTORIZACION"
Case "009" : Return "MISMO BANCO PROGRAMADO - VALIDACION DE ESTRUCTURA Y ESTATUS (INACTIVO, CANCELADO)"
Case "010" : Return "ARCHIVO NO ABIERTO"
Case "011" : Return "TEF - VALIDACION DE ESTRUCTURA (ERRONEA)"
Case "012" : Return "SPEI - VALIDACION DE ESTRUCTURA (ERRONEA)"
Case "013" : Return "ERROR DE I/O NO CUBIERTO POR CICS"
Case "014" : Return "LONGITUD DE REGISTRO ERRONEA"
Case "015" : Return "ARCHIVO NO DISPONIBLE"
Case "016" : Return "ESCRITURA: REGISTRO DUPLICADO"
Case "017" : Return "NO HAY ESPACIO EN EL DISPOSITIVO PARA ADICIONAR REGISTRO"
Case "019" : Return "OTRO ERROR DE I/O"
Case "020" : Return "DATO NO NUMERICO"
Case "021" : Return "DATO REQUERIDO (SI LA OPERACIÓN ES SPID CONTACTE A SU EJECUTIVO DE RELACIÓN PARA REVISAR LA DIRECCION REGISTRADA)"
Case "022" : Return "VALOR FUERA DE RANGO"
Case "023" : Return "DATO NO COINCIDE CON NOMBRE DE ARCHIVO"
Case "024" : Return "ERROR EN SECUENCIA DE REGISTROS"
Case "025" : Return "NO EXISTE CONTRATO"
Case "026" : Return "NO EXISTE PLAZA"
Case "027" : Return "NO EXISTE SUCURSAL"
Case "028" : Return "NO EXISTE CUENTA"
Case "029" : Return "CUENTA NO ACTIVA"
Case "030" : Return "CUENTA NO RELACIONADA AL CONTRATO"
Case "031" : Return "NO EXISTE BANCO"
Case "032" : Return "MONEDA INVALIDA PARA ESE PRODUCTO"
Case "033" : Return "ERROR EN CIFRA DE CONTROL"
Case "034" : Return "ARCHIVO RECHAZADO POR REGISTROS RECHAZADOS"
Case "035" : Return "PAGO DUPLICADO"
Case "036" : Return "NO EXISTE PAGO"
Case "037" : Return "ARCHIVO NO PENDIENTE DE VALIDACION"
Case "038" : Return "CONTRATO NO ACTIVO"
Case "039" : Return "ARCHIVO RECHAZADO POR QUE NO TIENE REGISTROS CORRECTOS"
Case "040" : Return "MONEDA DE REGISTRO DETALLE DIFERENTE A MONEDA DE CUENTA DE CARGO"
Case "041" : Return "FECHA INHABIL"
Case "042" : Return "FECHA DE APLICACION INVALIDA PARA ESE TIPO DE PAGO"
Case "043" : Return "NUMERO DE BANCO INVALIDO PARA ESE TIPO DE PAGO"
Case "044" : Return "HORARIO SUCURSAL NO DISPONIBLE"
Case "045" : Return "IMPORTE SUPERIOR AL PERMITIDO SPEI"
Case "046" : Return "LA CUENTA DE ABONO NO ESTA REGISTRADA EN LA BASE DE DATOS DEL BANCO PARA ESE CONTRATO"
Case "047" : Return "IMPORTE SUPERIOR AL AUTORIZADO POR EL CLIENTE PARA ESA CUENTA DE ABONO"
Case "048" : Return "FECHA DE CONSTITUCION ERRONEA"
Case "049" : Return "TIPO DE CUENTA INVALIDA SPID"
Case "050" : Return "SPID ES SOLO PARA PERSONAS MORALES"
Case "051" : Return "ERROR AL HACER REGISTRO EN TOTALES"
Case "052" : Return "ERROR AL HACER CARGO A CHEQUES"
Case "053" : Return "EL MOVIMIENTO NO ESTA PENDIENTE DE PAGO"
Case "054" : Return "ERROR AL REVERSAR CARGO A CHEQUES"
Case "055" : Return "SU TRANSACCIÓN NO PUEDE SER PROCESADA EN ESTE MOMENTO CONTACTE A SU EJECUTIVO DE RELACIÓN (CLAVE 99)."
Case "056" : Return "EL CERTIFICADO DE SU FIEL NO ES VIGENTE. FAVOR DE SOLICITAR A SU EJECUTIVO LA ACTUALIZACIÓN PARA PODER OPERAR SPID."
Case "057" : Return "SU TRANSACCIÓN NO PUEDE SER PROCESADA EN ESTE MOMENTO CONTACTE A SU EJECUTIVO DE RELACIÓN (CLAVE 88)."
Case "058" : Return "EL MONTO DE LA OPERACIÓN SOBREPASA EL DISPONIBLE PARA ESTE BENEFICIARIO."
Case "059" : Return "TRANSACCION SPID DEVUELTA"
Case "060" : Return "PAGO NO DISPONIBLE EN HORARIO EXTENDIDO"
Case "061" : Return "INSUFICIENCIA DE FONDOS"
Case "062" : Return "CAMBIO A ABONO EN CUENTA DE DEVOLUCIONES"
Case "063" : Return "CAMBIO A PAGO EN VENTANILLA EFECTIVO"
Case "064" : Return "CAMBIO A CHEQUE DE CAJA AL BENEFICIARIO EN VENTANILLA"
Case "065" : Return "CAMBIO A CHEQUE DE CAJA CENTRAL AL BENEFICIARIO"
Case "066" : Return "CAMBIO A CHEQUE DE CAJA CENTRAL A LA EMPRESA POR TOTAL"
Case "067" : Return "CAMBIO A CHEQUE DE CAJA CENTRAL A LA EMPRESA POR DETALLE"
Case "068" : Return "CAMBIO ORIGINADO POR UN PAGO EN VENTANILLA"
Case "069" : Return "CAMBIO ORIGINADO POR UN ABONO A CHEQUES"
Case "070" : Return "CAMBIO ORIGINADO POR UN ABONO A AHORROS"
Case "071" : Return "CAMBIO ORIGINADO POR UN DEPOSITO INTERBANCARIO"
Case "072" : Return "CAMBIO ORIGINADO POR UN MOVIMIENTO DE TRANSFERENCIA DE FONDOS"
Case "073" : Return "BAJA RECHAZADA POR PAGO EN LINEA"
Case "074" : Return "DEVOLUCION GLOBAL POR RECHAZOS"
Case "075" : Return "DEVOLUCION GLOBAL POR VENCIMIENTO DE VIGENCIAS"
Case "076" : Return "DEVOLUCION GLOBAL POR BAJAS SOLICITADAS"
Case "077" : Return "HORARIO DE OPERACIÓN NO DISPONIBLE SPID"
Case "078" : Return "EL ABONO EXCEDE EL MÁXIMO PERMITIDO A LA CUENTA"
Case Else : Return "CÓDIGO DESCONOCIDO"
End Select
End Function
#End Region
#Region "IDisposable Support"
Private disposedValue As Boolean = False
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
'If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
'If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
'If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
'If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
'If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
'If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
End If
' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub
' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
'ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class

View File

@@ -1570,6 +1570,25 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetVentaDetallePreciosLista(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasDetallePreciosListaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los precios de lista en los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddVentaDetalle(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, PU As Decimal, IVA As Decimal, Public Function AddVentaDetalle(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, PU As Decimal, IVA As Decimal,
Total As Decimal, Observaciones As String, Descuento As Decimal, TipoDescuento As Integer, CveSubProyecto As Integer, Total As Decimal, Observaciones As String, Descuento As Decimal, TipoDescuento As Integer, CveSubProyecto As Integer,
CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1, CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1,
@@ -7393,7 +7412,7 @@ Public Class ClsVentas
End Function End Function
Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveUsuarioAtendio As Integer, CveUsuarioConsulta As Integer, CveTipoVenta As Integer, CveMarca As Integer, FechaInicioPago As Date, FechaFinPago As Date) As Boolean Public Function GetComisionesMedicasRep(FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CveSubProyecto As Integer, CveProcedimiento As Integer, CveMedico As Integer, CveVendedor As Integer, CveGerenteVendedor As Integer, CveUsuarioAtendio As Integer, CveUsuarioConsulta As Integer, CveTipoVenta As Integer, CveMarca As Integer, FechaInicioPago As Date, FechaFinPago As Date) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasRepGet") DataAdapter("PA_Vta_ComisionesMedicasRepGet")
@@ -7406,6 +7425,7 @@ Public Class ClsVentas
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveGerenteVendedor", SqlDbType.Int).Value = CveGerenteVendedor
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CveUsuarioAtendio", SqlDbType.Int).Value = CveUsuarioAtendio .Add("@CveUsuarioAtendio", SqlDbType.Int).Value = CveUsuarioAtendio
.Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
@@ -7733,7 +7753,7 @@ Public Class ClsVentas
End Function End Function
Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveVendedor As Integer, CveUsuarioTecnico As Integer, CveEmpresa As Integer) As Boolean Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveVendedor As Integer, CveGerenteVendedor As Integer, CveUsuarioTecnico As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_SMS_IndicadoresGet") DataAdapter("PA_SMS_IndicadoresGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -7742,6 +7762,7 @@ Public Class ClsVentas
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@CveGerenteVendedor", SqlDbType.Int).Value = CveGerenteVendedor
.Add("@CveUsuarioTecnico", SqlDbType.Int).Value = CveUsuarioTecnico .Add("@CveUsuarioTecnico", SqlDbType.Int).Value = CveUsuarioTecnico
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With

View File

@@ -2734,7 +2734,7 @@ concep.DescripcionesEspecificas.NumeroSerie)
#Region "C O M P L E M E N T O D E N O M I N A" #Region "C O M P L E M E N T O D E N O M I N A"
If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then
cfdi.TieneSubsidio = True ' bandera par activar que se vaya la opción de totalotrosingresos si es igual a cero
'cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd") 'cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd")
cfdi.Nomina12(ObjCFDITimbre.Nomina.TipoNomina, ObjCFDITimbre.Nomina.FechaPago.ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaInicio.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaFin.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.NumDiasPagados, If(ObjCFDITimbre.Nomina.Percepciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Percepciones.Count > 0, ObjCFDITimbre.Nomina.TotalPercepciones, 0), If(ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0, ObjCFDITimbre.Nomina.TotalDeducciones, 0), If(ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing AndAlso ObjCFDITimbre.Nomina.OtrosPagos.Count > 0, ObjCFDITimbre.Nomina.TotalOtrosPagos, 0)) cfdi.Nomina12(ObjCFDITimbre.Nomina.TipoNomina, ObjCFDITimbre.Nomina.FechaPago.ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaInicio.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.FechaFin.ToDate().ToString("yyyy-MM-dd"), ObjCFDITimbre.Nomina.NumDiasPagados, If(ObjCFDITimbre.Nomina.Percepciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Percepciones.Count > 0, ObjCFDITimbre.Nomina.TotalPercepciones, 0), If(ObjCFDITimbre.Nomina.Deducciones IsNot Nothing AndAlso ObjCFDITimbre.Nomina.Deducciones.Count > 0, ObjCFDITimbre.Nomina.TotalDeducciones, 0), If(ObjCFDITimbre.Nomina.OtrosPagos IsNot Nothing AndAlso ObjCFDITimbre.Nomina.OtrosPagos.Count > 0, ObjCFDITimbre.Nomina.TotalOtrosPagos, 0))
@@ -2742,7 +2742,6 @@ concep.DescripcionesEspecificas.NumeroSerie)
If UsuarioActual.Empresa.UsaAC Then cfdi.Nomina12EntidadSNCF("IF", 90) If UsuarioActual.Empresa.UsaAC Then cfdi.Nomina12EntidadSNCF("IF", 90)
#Region "Receptor" #Region "Receptor"
cfdi.Nomina12Receptor(ObjCFDITimbre.Nomina.Receptor.CURP, cfdi.Nomina12Receptor(ObjCFDITimbre.Nomina.Receptor.CURP,

View File

@@ -60,7 +60,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
context.Response.ContentType = "application/json" context.Response.ContentType = "application/json"
Dim Auth As AuthMessage = ValidarSolicitud(context) Dim Auth As AuthMessage = ValidarSolicitud(context)
If Auth.IsSucces Then If Auth.IsSuccess Then
retorno = ConsultaRemisiones(context, "") retorno = ConsultaRemisiones(context, "")
Else Else
context.Response.StatusCode = Auth.StatusCode context.Response.StatusCode = Auth.StatusCode
@@ -71,13 +71,24 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
context.Response.ContentType = "application/json" context.Response.ContentType = "application/json"
Dim Auth As AuthMessage = ValidarSolicitud(context) Dim Auth As AuthMessage = ValidarSolicitud(context)
If Auth.IsSucces Then If Auth.IsSuccess Then
retorno = RegistraPagoRemision(context, "") retorno = RegistraPagoRemision(context, "")
Else Else
context.Response.StatusCode = Auth.StatusCode context.Response.StatusCode = Auth.StatusCode
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage) retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
End If End If
context.Response.Write(retorno) context.Response.Write(retorno)
ElseIf Metodo = "ConsultaRemision" Then
context.Response.ContentType = "application/json"
Dim Auth As AuthMessage = ValidarSolicitud(context)
If Auth.IsSuccess AndAlso context.Request("CveVenta").ToEntero > 0 Then
retorno = ConsultaRemision(context, context.Request("CveVenta").ToEntero)
Else
context.Response.StatusCode = Auth.StatusCode
retorno = JsonConvert.SerializeObject(Auth.ErrorMessage)
End If
context.Response.Write(retorno)
End If End If
Catch ex As Exception Catch ex As Exception
ex.GuardaLog(ex.Message) ex.GuardaLog(ex.Message)
@@ -100,7 +111,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
Else Else
respuesta.ErrorMessage = New AppsResponseError() With {.message = "el usuario y/o contraseña son requeridos"} respuesta.ErrorMessage = New AppsResponseError() With {.message = "el usuario y/o contraseña son requeridos"}
respuesta.IsSucces = False respuesta.IsSuccess = False
respuesta.StatusCode = 200 respuesta.StatusCode = 200
Return respuesta Return respuesta
@@ -108,13 +119,13 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
If unauthorized Then If unauthorized Then
respuesta.ErrorMessage = New AppsResponseError() With {.message = "el usuario y/o contraseña no son validos"} respuesta.ErrorMessage = New AppsResponseError() With {.message = "el usuario y/o contraseña no son validos"}
respuesta.IsSucces = False respuesta.IsSuccess = False
respuesta.StatusCode = 200 respuesta.StatusCode = 200
Return respuesta Return respuesta
Else Else
respuesta.ErrorMessage = Nothing respuesta.ErrorMessage = Nothing
respuesta.IsSucces = True respuesta.IsSuccess = True
respuesta.StatusCode = 200 respuesta.StatusCode = 200
Return respuesta Return respuesta
@@ -172,6 +183,56 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
End If End If
End Function End Function
Private Function ConsultaRemision(ByVal context As HttpContext, CveVenta As Integer) As String
Dim Respuesta As New AppsResponse
Dim RespuestaError As New AppsResponseError
Dim TieneError As Boolean = False
Dim CveSubProyecto As String = "11790"
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim data As New JArray
Dim dtt As New DataTable
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
dtt = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
If dtt IsNot Nothing Then
Try
For Each Row As DataRow In dtt.Rows
Dim objVenta As New JObject(
New JProperty("cveventa", Row("CveVenta")),
New JProperty("folio", Row("Folio")),
New JProperty("cliente", Row("ClienteNombre")),
New JProperty("fecha", Row("Fecha")),
New JProperty("total", Row("Total")),
New JProperty("moneda", Row("Moneda")),
New JProperty("saldo", Row("Saldo"))
)
data.Add(objVenta)
Next
Catch ex As Exception
TieneError = True
RespuestaError.message = "Ocurrió un error al obtener las remisiones pendientes."
End Try
dtt.Dispose()
Else
TieneError = True
End If
Respuesta.data = data
If TieneError Then
context.Response.StatusCode = 200
Return JsonConvert.SerializeObject(RespuestaError)
Else
context.Response.StatusCode = 200
Return JsonConvert.SerializeObject(Respuesta)
End If
End Function
Private Function RegistraPagoRemision(ByVal context As HttpContext, CveVenta As String) As String Private Function RegistraPagoRemision(ByVal context As HttpContext, CveVenta As String) As String
Dim Respuesta As New AppsResponse Dim Respuesta As New AppsResponse
Dim RespuestaError As New AppsResponseError Dim RespuestaError As New AppsResponseError
@@ -632,7 +693,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
End Class End Class
Private Class AuthMessage Private Class AuthMessage
Public Property IsSucces As Boolean Public Property IsSuccess As Boolean
Public Property ErrorMessage As AppsResponseError Public Property ErrorMessage As AppsResponseError
Public Property StatusCode As Integer Public Property StatusCode As Integer
End Class End Class

View File

@@ -99,14 +99,17 @@ Public Class E189 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe
Private Function ConsultaDatos(ByVal context As HttpContext) As String Private Function ConsultaDatos(ByVal context As HttpContext) As String
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim Respuesta As New ResponseMsg Dim Respuesta As New ResponseMsg
Dim RespuestaError As New ResponseMsgError Dim RespuestaError As New ResponseMsgError
Dim TieneError As Boolean = False Dim TieneError As Boolean = False
Dim productos As JArray = Nothing Dim productos As JArray = Nothing
Using ObjInventario As New ClsProductosServicios Using ObjInventario As New ClsProductosServicios()
If ObjInventario.GetPS_APIMarcasStock(189) AndAlso ObjInventario.DtResultados IsNot Nothing Then If ObjInventario.GetPS_APIMarcasStock(CveEmpresa) AndAlso ObjInventario.DtResultados IsNot Nothing Then
productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP()) productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP())
Else Else
RespuestaError.message = "no se pudo obtener los datos" RespuestaError.message = "no se pudo obtener los datos"

View File

@@ -6,6 +6,7 @@ Imports Extensiones
Imports System.Xml Imports System.Xml
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports System.Globalization Imports System.Globalization
Imports Telerik.Web.UI
Partial Class Bancos_ConciliacionesBancariasaspx Partial Class Bancos_ConciliacionesBancariasaspx
Inherits ClsPaginas Inherits ClsPaginas
@@ -182,7 +183,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
If Not CBool(Dr("FueConciliado").ToString) And Dr("CveIE").ToString.ToEntero > 0 Then If Not CBool(Dr("FueConciliado").ToString) And Dr("CveIE").ToString.ToEntero > 0 Then
For Each DrE As DataRow In DtDatosEdoCuenta.Rows For Each DrE As DataRow In DtDatosEdoCuenta.Rows
If ((Dr("FechaDocumento").ToString.ToDate = DrE("FechaDocumento").ToString.ToDate And Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 1) Or (Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 2)) And Not CBool(DrE("Seleccionado").ToString) And Not CBool(DrE("FueConciliado").ToString) And Not CBool(Dr("Seleccionado").ToString) Then If ((Dr("FechaDocumento").ToString.ToDate = DrE("FechaDocumento").ToString.ToDate And Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 1) Or (Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 2)) And Not CBool(DrE("Seleccionado").ToString) And Not CBool(DrE("FueConciliado").ToString) And Not CBool(Dr("Seleccionado").ToString) Then
Dim FechaConciliado As Date = TxtFechaAplicado.Text.ToDate 'If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate) Dim FechaConciliado As Date = If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate)
If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, FechaConciliado, -1, 1, 1, UsuarioActual.CveUsuario) Or If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, FechaConciliado, -1, 1, 1, UsuarioActual.CveUsuario) Or
Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, FechaConciliado, DrE("CveIEEstadoCuenta").ToString.ToEntero, 1, 2, UsuarioActual.CveUsuario) Then Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, FechaConciliado, DrE("CveIEEstadoCuenta").ToString.ToEntero, 1, 2, UsuarioActual.CveUsuario) Then
ErrorTrans = True ErrorTrans = True
@@ -231,15 +232,20 @@ Partial Class Bancos_ConciliacionesBancariasaspx
RegistraScript("$('#DModalCriterio').modal()") RegistraScript("$('#DModalCriterio').modal()")
End Sub End Sub
Private Sub ConciliacionManual() Private Sub ConciliacionManual()
If GvDatos.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCCheckBox("ChkConciliado").Checked).Count = 0 OrElse GvEdoConciliacion.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCCheckBox("ChkConciliado").Checked).Count = 0 Then
Alert("Debe seleccionar un folio", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim SumaSIGAbono As Double = 0 Dim SumaSIGAbono As Double = 0
Dim SumaSIGCargo As Double = 0 Dim SumaSIGCargo As Double = 0
Dim SumaExcelAbono As Double = 0 Dim SumaExcelAbono As Double = 0
Dim SumaExcelCargo As Double = 0 Dim SumaExcelCargo As Double = 0
Dim Seleccionados As Integer = 0
Dim Fecha As Date Dim Fecha As Date
For Each Gvr As GridViewRow In GvDatos.Rows For Each Gvr As GridViewRow In GvDatos.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
Seleccionados += 1
Fecha = Gvr.DataKey("FechaDocumento").ToDate Fecha = Gvr.DataKey("FechaDocumento").ToDate
If Gvr.DataKey("Tipo") = "Cargo" Then If Gvr.DataKey("Tipo") = "Cargo" Then
If Gvr.DataKey("Importe").ToDouble < 0 Then ' cuando es negativo suma para el abono If Gvr.DataKey("Importe").ToDouble < 0 Then ' cuando es negativo suma para el abono
@@ -258,13 +264,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
End If End If
End If End If
Next Next
If Seleccionados > 1 Then
Alert("Tiene que tener seleccionado solamente un movimiento.", TipoMensaje.MsgAdvertencia)
Exit Sub
ElseIf Not Seleccionados > 0 Then
Alert("Tiene que tener seleccionado .", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
For Each Gvr As GridViewRow In GvEdoConciliacion.Rows For Each Gvr As GridViewRow In GvEdoConciliacion.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
If (Gvr.DataKey("FechaDocumento").ToDate = Fecha And DdlCriterio.SelectedValue.ToEntero = 1) Or DdlCriterio.SelectedValue.ToEntero = 2 Then If (Gvr.DataKey("FechaDocumento").ToDate = Fecha And DdlCriterio.SelectedValue.ToEntero = 1) Or DdlCriterio.SelectedValue.ToEntero = 2 Then
@@ -279,17 +279,27 @@ Partial Class Bancos_ConciliacionesBancariasaspx
End If End If
End If End If
Next Next
If SumaSIGCargo <> SumaExcelCargo OrElse SumaSIGAbono <> SumaExcelAbono Then If SumaSIGCargo <> SumaExcelCargo OrElse SumaSIGAbono <> SumaExcelAbono Then
Alert($"La suma de los importes no cuadran ({SumaSIGCargo}-{SumaExcelCargo}**{SumaSIGAbono}-{SumaExcelAbono})", TipoMensaje.MsgAdvertencia) Alert($"La suma de los importes no cuadran ({SumaSIGCargo}-{SumaExcelCargo}**{SumaSIGAbono}-{SumaExcelAbono})", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Dim CumpleCriterioContable = GvDatos.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCCheckBox("ChkConciliado").Checked).Count = 1 AndAlso GvEdoConciliacion.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCCheckBox("ChkConciliado").Checked).Count >= 1
Dim CumpleCriterioBancario = GvEdoConciliacion.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCCheckBox("ChkConciliado").Checked).Count = 1 AndAlso GvDatos.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCCheckBox("ChkConciliado").Checked).Count >= 1
If Not (CumpleCriterioContable OrElse CumpleCriterioBancario) Then
Alert("Debe seleccionar solo 1 folio del lado contable o bancario", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
Dim ObjOI As New ClsOIEventos(ObjBancos.IniciaTransacSQL()) Dim ObjOI As New ClsOIEventos(ObjBancos.IniciaTransacSQL())
Dim ErrorTrans As Boolean = False Dim ErrorTrans As Boolean = False
Dim CveIE As Integer = 0 Dim CveIE As Integer = 0
For Each Gvr As GridViewRow In GvDatos.Rows For Each Gvr As GridViewRow In GvDatos.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
Dim FechaConciliado As Date = TxtFechaAplicado.Text.ToDate 'If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate) Dim FechaConciliado As Date = If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate)
If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, FechaConciliado, -1, 1, 1, UsuarioActual.CveUsuario) Then If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, FechaConciliado, -1, 1, 1, UsuarioActual.CveUsuario) Then
ErrorTrans = True ErrorTrans = True
Else Else
@@ -303,7 +313,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Next Next
For Each Gvr As GridViewRow In GvEdoConciliacion.Rows For Each Gvr As GridViewRow In GvEdoConciliacion.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
Dim FechaConciliado As Date = TxtFechaAplicado.Text.ToDate 'If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate) Dim FechaConciliado As Date = If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate)
If Not ObjBancos.UpdateConciliacionBancaria(CveIE, FechaConciliado, Gvr.DataKey("CveIEEstadoCuenta").ToEntero, 1, 2, UsuarioActual.CveUsuario) Then If Not ObjBancos.UpdateConciliacionBancaria(CveIE, FechaConciliado, Gvr.DataKey("CveIEEstadoCuenta").ToEntero, 1, 2, UsuarioActual.CveUsuario) Then
'If Not ObjBancos.UpdateIEEstadoCuenta(Gvr.DataKey("CveIEEstadoCuenta").ToEntero, Gvr.DataKey("Importe").ToDouble, True, CveIE, Gvr.DataKey("Referencia").ToString, 'If Not ObjBancos.UpdateIEEstadoCuenta(Gvr.DataKey("CveIEEstadoCuenta").ToEntero, Gvr.DataKey("Importe").ToDouble, True, CveIE, Gvr.DataKey("Referencia").ToString,
' Gvr.DataKey("Tipo").ToString, Gvr.DataKey("FechaDocumento").ToDate, Gvr.DataKey("CveCuenta").ToEntero) Then ' Gvr.DataKey("Tipo").ToString, Gvr.DataKey("FechaDocumento").ToDate, Gvr.DataKey("CveCuenta").ToEntero) Then

View File

@@ -113,6 +113,11 @@
<td> <td>
<asp:TextBox ID="TxtConvenio" runat="server" MaxLength="18" Width="200px"></asp:TextBox></td> <asp:TextBox ID="TxtConvenio" runat="server" MaxLength="18" Width="200px"></asp:TextBox></td>
</tr> </tr>
<tr id="TrConvenioNomina" runat="server" visible="false">
<td>Convenio:</td>
<td>
<asp:TextBox ID="TxtConvenioNomina" runat="server" MaxLength="18" Width="200px"></asp:TextBox></td>
</tr>
<tr runat="server" id="trFinicial"> <tr runat="server" id="trFinicial">
<td> <td>
<asp:Literal runat="server" ID="LtFInicial" Text="Folio Inicial:"></asp:Literal> <asp:Literal runat="server" ID="LtFInicial" Text="Folio Inicial:"></asp:Literal>

View File

@@ -138,20 +138,21 @@ Partial Class Bancos_CuentasBancariasDetalle
Using ObjContabilidad As New ClsContabilidad Using ObjContabilidad As New ClsContabilidad
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero 'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
DDlCuentaContable.DataSource = ObjContabilidad.DtResultados dt = ObjContabilidad.DtResultados.Copy()
DDlCuentaContable.DataSource = dt
DDlCuentaContable.DataBind() DDlCuentaContable.DataBind()
DDlCuentaContable.Items.Insert(0, New ListItem("Selecione", "-1")) DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
DDlCuentaContable.DataTextField = "CtaCodigo" 'DDlCuentaContable.DataTextField = "CtaCodigo"
DDlCuentaContable.DataValueField = "CveCuenta" 'DDlCuentaContable.DataValueField = "CveCuenta"
End If End If
End Using End Using
DDlCuentaContable.DataSource = dt
DDlCuentaContable.DataBind()
DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
DdlCuentaContableComplementaria.DataSource = dt DdlCuentaContableComplementaria.DataSource = dt
DdlCuentaContableComplementaria.DataBind() DdlCuentaContableComplementaria.DataBind()
DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1")) DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1"))
If dt IsNot Nothing Then dt.Dispose() If dt IsNot Nothing Then dt.Dispose()
trCuentaContable.Visible = True trCuentaContable.Visible = True
trCuentaContableComplementaria.Visible = True trCuentaContableComplementaria.Visible = True
@@ -215,6 +216,7 @@ Partial Class Bancos_CuentasBancariasDetalle
LblFecha.Text = ObjCuentasBancariasDetalle.Fecha.ToShortDateString LblFecha.Text = ObjCuentasBancariasDetalle.Fecha.ToShortDateString
LblUsuario.Text = ObjCuentasBancariasDetalle.Usuario LblUsuario.Text = ObjCuentasBancariasDetalle.Usuario
TxtConvenio.Text = ObjCuentasBancariasDetalle.ConvenioPagoElectronico.ToString TxtConvenio.Text = ObjCuentasBancariasDetalle.ConvenioPagoElectronico.ToString
TxtConvenioNomina.Text = ObjCuentasBancariasDetalle.ConvenioPagoElectronicoNomina
ChkLayout.Checked = ObjCuentasBancariasDetalle.UsaLayout ChkLayout.Checked = ObjCuentasBancariasDetalle.UsaLayout
ChkLayoutGrupos.Checked = ObjCuentasBancariasDetalle.UsaLayoutGrupos ChkLayoutGrupos.Checked = ObjCuentasBancariasDetalle.UsaLayoutGrupos
ChkUsaTarjeta.Checked = ObjCuentasBancariasDetalle.UsaTarjeta ChkUsaTarjeta.Checked = ObjCuentasBancariasDetalle.UsaTarjeta
@@ -235,7 +237,7 @@ Partial Class Bancos_CuentasBancariasDetalle
TxtNumeroSucursal.Text = ObjCuentasBancariasDetalle.NumeroSucursal TxtNumeroSucursal.Text = ObjCuentasBancariasDetalle.NumeroSucursal
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then If UsuarioActual.Empresa.TipoContabilidad = 1 Then
DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaConta.ToString) DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaConta.ToString)
DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaContaComplementaria.ToString) DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaContaComplementaria.ToString)
Else Else
@@ -295,7 +297,8 @@ Partial Class Bancos_CuentasBancariasDetalle
TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble,
"", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, If(ChkLayout.Checked, TxtConvenio.Text, ""), ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, If(ChkLayout.Checked, TxtConvenio.Text, ""), ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked,
TieneTerminal:=ChkTieneTerminal.Checked, TieneTerminal:=ChkTieneTerminal.Checked,
CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim) Then CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim,
ConvenioPagoElectronicoNomina:=TxtConvenioNomina.Text) Then
ViewState("CveCuenta") = ObjCuentasBancariasDetalle.TCveCuenta ViewState("CveCuenta") = ObjCuentasBancariasDetalle.TCveCuenta
Else Else
ErrorUsuarios = True ErrorUsuarios = True
@@ -330,7 +333,8 @@ Partial Class Bancos_CuentasBancariasDetalle
If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0,
TxtLimiteCredito.Text.Trim.ToDouble, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text, TxtLimiteCredito.Text.Trim.ToDouble, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text,
ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked, TieneTerminal:=ChkTieneTerminal.Checked, ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked, TieneTerminal:=ChkTieneTerminal.Checked,
CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim) Then CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim,
ConvenioPagoElectronicoNomina:=TxtConvenioNomina.Text) Then
'CargaDatos() 'CargaDatos()
GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
GlobalDTBancosCuentasGral(UsuarioActual.CveEmpresa) = Nothing GlobalDTBancosCuentasGral(UsuarioActual.CveEmpresa) = Nothing
@@ -687,8 +691,10 @@ Partial Class Bancos_CuentasBancariasDetalle
Private Sub InicializaConvenio() Private Sub InicializaConvenio()
If ChkLayout.Checked Then If ChkLayout.Checked Then
TrConvenio.Visible = True TrConvenio.Visible = True
TrConvenioNomina.Visible = True
Else Else
TrConvenio.Visible = False TrConvenio.Visible = False
TrConvenioNomina.Visible = False
End If End If
End Sub End Sub
Protected Sub ChkLayout_CheckedChanged(sender As Object, e As EventArgs) Protected Sub ChkLayout_CheckedChanged(sender As Object, e As EventArgs)

View File

@@ -641,7 +641,7 @@ Partial Class Bancos_FluctuacionCambiaria
End Sub End Sub
Private Function AjusteFluctuacion(CvePrePoliza As Integer, TipoFluctuacion As Integer, CveConcepto As Integer, FechaUltimoDaMes As Date, ByRef ObjConta As ClsContabilidad, Optional CveVenta As Integer = -1, Optional CveCliente As Integer = -1, Optional CveCompra As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean Private Function AjusteFluctuacion(CvePrePoliza As Integer, TipoFluctuacion As Integer, CveConcepto As Integer, FechaUltimoDaMes As Date, ByRef ObjConta As ClsContabilidad, Optional CveVenta As Integer = -1, Optional CveCliente As Integer = -1, Optional CveCompra As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean
If Not UsuarioActual.CveEmpresa.Contiene(119, 172, 174) Then Return True If Not UsuarioActual.CveEmpresa.Contiene(119, 172, 174, 189) Then Return True
Dim ErrorRegistrar As Boolean = False Dim ErrorRegistrar As Boolean = False
Dim tdt As DataTable = VerificacionFluctuacion(TipoFluctuacion, FechaUltimoDiaMes) Dim tdt As DataTable = VerificacionFluctuacion(TipoFluctuacion, FechaUltimoDiaMes)

File diff suppressed because it is too large Load Diff

View File

@@ -866,7 +866,7 @@ Partial Class Bancos_PagoElectronicoGrupos
ElseIf OpBancos = 2 Then ElseIf OpBancos = 2 Then
AltaProveedoresBajio() AltaProveedoresBajio()
ElseIf OpBancos = 3 Then ElseIf OpBancos = 3 Then
'AltaProveedoresScotia() SE DEJA COMENTADO PORQUE NO SE ESTA USANDO, SE CAMBIO A PAGO ELECTRONICO 'AltaCuentasScotia() SE DEJA COMENTADO PORQUE NO SE ESTA USANDO, SE CAMBIO A PAGO ELECTRONICO
End If End If
@@ -2743,7 +2743,7 @@ Partial Class Bancos_PagoElectronicoGrupos
ElseIf OpBancos = 2 Then ElseIf OpBancos = 2 Then
AltaProveedoresBajio(DTProveedores) AltaProveedoresBajio(DTProveedores)
ElseIf OpBancos = 3 Then ElseIf OpBancos = 3 Then
'AltaProveedoresScotia(DTProveedores) 'AltaCuentasScotia(DTProveedores)
End If End If

View File

@@ -1293,10 +1293,11 @@ Partial Class Bancos_PopIEVentas
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
Pago.TCPago = TxtTCDolaresDolares.Text.ToDecimal Pago.TCPago = TxtTCDolaresDolares.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal Pago.TCPago = TxtTCDolares.Text.ToDecimal
ImportePagadoVenta = (ImportePagadoVenta * Pago.TCPago).RoundSQL
End If End If
'If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal 'If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
If ChkPagarDolares.Checked Then Pago.TCPago = TxtTipoCambio.Text.ToDecimal If ChkPagarDolares.Checked Then Pago.TCPago = TxtTCDolares.Text.ToDecimal
Select Case RBLContado.SelectedValue Select Case RBLContado.SelectedValue
Case "1" ' Banco Case "1" ' Banco

View File

@@ -1662,17 +1662,17 @@ Partial Class Bancos_ProveedoresAbonar
ElseIf OpBanco = 3 Then ElseIf OpBanco = 3 Then
If dtc.Rows.Count > 0 Then If dtc.Rows.Count > 0 Then
DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'") 'dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'")
DdlCuentaDeposito.DataBind() DdlCuentaDeposito.DataBind()
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
End If End If
If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then If dtc.FiltraParametros("Estatus ='True'").Rows.Count > 0 Then
trCuentaDeposito.Visible = True trCuentaDeposito.Visible = True
DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) 'ñDdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1"))
Else Else
BtnIEGuardar.Enabled = False 'BtnIEGuardar.Enabled = False
Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) Alert("El beneficiario no tiene una cuenta deposito activa, de la de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia)
End If End If
End If End If
ElseIf DdlTipoTransaccion.SelectedValue = "17" Then ElseIf DdlTipoTransaccion.SelectedValue = "17" Then

View File

@@ -2729,7 +2729,7 @@ Partial Class Compras_Compras
Msg &= String.Format("- El total generado por los detalles no coincide con el total general <br> ({0}-{1})", Math.Round(TotalTemp, 2), Math.Round(Total, 2)) Msg &= String.Format("- El total generado por los detalles no coincide con el total general <br> ({0}-{1})", Math.Round(TotalTemp, 2), Math.Round(Total, 2))
End If End If
If Msg <> "" Then If Msg <> "" And CveFactura <> 1259189 Then
Alert($"<b>El comprobante XML presenta las siguientes inconsistencias:</b> <br><br> {Msg}", TipoMensaje.MsgAdvertencia) Alert($"<b>El comprobante XML presenta las siguientes inconsistencias:</b> <br><br> {Msg}", TipoMensaje.MsgAdvertencia)
Tab.ActiveTabIndex = 0 Tab.ActiveTabIndex = 0
@@ -9803,7 +9803,7 @@ Partial Class Compras_Compras
respuesta = False 'La fecha de la compra esta por fuera de lo permitido mes actual o mes anterior respuesta = False 'La fecha de la compra esta por fuera de lo permitido mes actual o mes anterior
If FechaCompra.Month > MesReembolsoInt Then If FechaCompra.Month > MesReembolsoInt Then
Alert($"La fecha de la compra que se quiere registrar esta adelantada al mes de la comprobación (Reembolso {TxtRembolsoNumero.Text} ,Fecha comprobación {FechaReembolso.ToString("dd/MM/yyyy")}).", TipoMensaje.MsgAdvertencia) Alert($"La fecha de la compra que se quiere registrar esta adelantada al mes de la comprobación (Reembolso {TxtRembolsoNumero.Text} Personal: {DdlPersonal.SelectedItem.Text} ,Fecha comprobación {FechaReembolso.ToString("dd/MM/yyyy")}).", TipoMensaje.MsgAdvertencia)
Else Else
Alert($"La fecha de la compra que se quiere registrar es anterior al mes permitido por la comprobación (Reembolso {TxtRembolsoNumero.Text}, Fecha comprobación {FechaReembolso.ToString("dd/MM/yyyy")}).", TipoMensaje.MsgAdvertencia) Alert($"La fecha de la compra que se quiere registrar es anterior al mes permitido por la comprobación (Reembolso {TxtRembolsoNumero.Text}, Fecha comprobación {FechaReembolso.ToString("dd/MM/yyyy")}).", TipoMensaje.MsgAdvertencia)
End If End If

View File

@@ -916,7 +916,7 @@
<ajax:TabPanel ID="TabHistorial" runat="server" HeaderText="Historial de Compras"> <ajax:TabPanel ID="TabHistorial" runat="server" HeaderText="Historial de Compras">
<ContentTemplate> <ContentTemplate>
<%-- <table border="0" runat="server" id="tHistorial" class="SubTotales3" width="100%"> <%-- <table border="0" runat="server" id="tHistorial" class="SubTotales3" width="100%">
<tr> <tr>
<td width="120px">Filtrar por Sucursal:</td> <td width="120px">Filtrar por Sucursal:</td>
@@ -1009,6 +1009,7 @@
<td> <td>
<asp:UpdatePanel ID="UpnHistorial" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpnHistorial" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnCargaHistorial" runat="server" ClientIDMode="Static" Text="CargarHistorial" Style="display: none;" OnClick="BtnCargaHistorial_Click" />
<asp:GridView ID="GVHistorial" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron compras del proveedor" ToolTip="Listado de Historial de Ventas" <asp:GridView ID="GVHistorial" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron compras del proveedor" ToolTip="Listado de Historial de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" AlternatingRowStyle-BorderStyle="None" GridLines="None" BorderColor="#D3D3D3" BorderWidth="1"> CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" AlternatingRowStyle-BorderStyle="None" GridLines="None" BorderColor="#D3D3D3" BorderWidth="1">
<Columns> <Columns>
@@ -1079,6 +1080,7 @@
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UPPCxP" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPPCxP" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnCargaCxP" runat="server" ClientIDMode="Static" Text="CargarCxP" Style="display: none;" OnClick="BtnCargaCxP_Click" />
<asp:Button ID="BtnRecargaCxP" ClientIDMode="Static" runat="server" Style="display: none;" Text="ConsultarCxP" /> <asp:Button ID="BtnRecargaCxP" ClientIDMode="Static" runat="server" Style="display: none;" Text="ConsultarCxP" />
<div class="row"> <div class="row">
@@ -1422,7 +1424,7 @@
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnCargaAnticipos" runat="server" ClientIDMode="Static" Text="CargarAnticipos" Style="display: none;" OnClick="BtnCargaAnticipos_Click" />
<%--<table border="0" runat="server" id="tAnticipos" class="SubTotales3" width="100%"> <%--<table border="0" runat="server" id="tAnticipos" class="SubTotales3" width="100%">
<tr> <tr>
@@ -1682,6 +1684,7 @@
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpBancos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpBancos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnCargaBancos" runat="server" ClientIDMode="Static" Text="CargarBancos" Style="display: none;" OnClick="BtnCargaBancos_Click" />
<div class="portlet light xspadding bordered "> <div class="portlet light xspadding bordered ">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
@@ -1978,40 +1981,45 @@
<ajax:TabPanel ID="TabOC" runat="server" HeaderText="Órdenes Compra"> <ajax:TabPanel ID="TabOC" runat="server" HeaderText="Órdenes Compra">
<ContentTemplate> <ContentTemplate>
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda6" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda6','{0}')", GvOC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <asp:UpdatePanel ID="UpOC" runat="server" UpdateMode="Conditional">
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda6','{0}')", GvOC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <ContentTemplate>
</div> <asp:Button ID="BtnCargaOC" runat="server" ClientIDMode="Static" Text="CargarOC" Style="display: none;" OnClick="BtnCargaOC_Click" />
<br /> <div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<asp:GridView ID="GvOC" GridLines="None" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" runat="server" AutoGenerateColumns="False" DataKeyNames="CveOrdenCompra" EmptyDataText="No se encontraron Ordenes de Compra"> <input type="text" id="TxtBusqueda6" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda6','{0}')", GvOC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<%--BorderColor="#D3D3D3" BorderWidth="1"--%> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda6','{0}')", GvOC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
<Columns> </div>
<asp:TemplateField> <br />
<HeaderTemplate>OC</HeaderTemplate> <asp:GridView ID="GvOC" GridLines="None" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" runat="server" AutoGenerateColumns="False" DataKeyNames="CveOrdenCompra" EmptyDataText="No se encontraron Ordenes de Compra">
<ItemTemplate> <Columns>
<asp:HyperLink ID="HplOC" runat="server" CssClass="Texto" Text='<%# Eval("Folio")%>' NavigateUrl='<%# Eval("CveOrdenCompra", "/OC/OC.aspx?OC={0}")%>'></asp:HyperLink> <asp:TemplateField>
</ItemTemplate> <HeaderTemplate>OC</HeaderTemplate>
</asp:TemplateField> <ItemTemplate>
<asp:TemplateField> <asp:HyperLink ID="HplOC" runat="server" CssClass="Texto" Text='<%# Eval("Folio")%>' NavigateUrl='<%# Eval("CveOrdenCompra", "/OC/OC.aspx?OC={0}")%>'></asp:HyperLink>
<HeaderTemplate>Descripción</HeaderTemplate> </ItemTemplate>
<ItemTemplate> </asp:TemplateField>
<asp:Literal ID="LtlDescripcion" runat="server" Text='<%# Eval("Descripcion")%>'></asp:Literal>&nbsp; <asp:TemplateField>
</ItemTemplate> <HeaderTemplate>Descripción</HeaderTemplate>
</asp:TemplateField> <ItemTemplate>
<asp:BoundField HeaderText="Estatus" DataField="Estatus" /> <asp:Literal ID="LtlDescripcion" runat="server" Text='<%# Eval("Descripcion")%>'></asp:Literal>&nbsp;
<asp:TemplateField> </ItemTemplate>
<HeaderTemplate>Fecha</HeaderTemplate> </asp:TemplateField>
<ItemTemplate> <asp:BoundField HeaderText="Estatus" DataField="Estatus" />
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal> <asp:TemplateField>
</ItemTemplate> <HeaderTemplate>Fecha</HeaderTemplate>
</asp:TemplateField> <ItemTemplate>
<asp:BoundField HeaderText="Lugar de Entrega" DataField="LugarEntrega" /> <asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
<asp:BoundField DataField="SubProyecto" HeaderText="SubProyecto" /> </ItemTemplate>
<asp:BoundField DataField="Total" HeaderText="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> </asp:TemplateField>
<asp:BoundField DataField="MonAbreviatura" HeaderText="Mon" /> <asp:BoundField HeaderText="Lugar de Entrega" DataField="LugarEntrega" />
</Columns> <asp:BoundField DataField="SubProyecto" HeaderText="SubProyecto" />
<HeaderStyle CssClass="Titulos"></HeaderStyle> <asp:BoundField DataField="Total" HeaderText="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</asp:GridView> <asp:BoundField DataField="MonAbreviatura" HeaderText="Mon" />
</Columns>
<HeaderStyle CssClass="Titulos"></HeaderStyle>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
@@ -2065,6 +2073,7 @@
<asp:UpdatePanel runat="server" ID="UpDocumentos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpDocumentos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnCargaDocs" runat="server" ClientIDMode="Static" Text="CargarDocs" Style="display: none;" OnClick="BtnCargaDocs_Click" />
<asp:GridView ID="GvDocs" AutoGenerateColumns="false" runat="server" GridLines="none" <asp:GridView ID="GvDocs" AutoGenerateColumns="false" runat="server" GridLines="none"
DataKeyNames="CveDocumentacion,Documentacion,Orden,CveDocumentacionElectronica,Adjunto,Estatus,Observacion,Fecha,FechaIng,Usuario,FechaLimite,FechaVigencia,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento"> DataKeyNames="CveDocumentacion,Documentacion,Orden,CveDocumentacionElectronica,Adjunto,Estatus,Observacion,Fecha,FechaIng,Usuario,FechaLimite,FechaVigencia,DiasLimite,AplicaDiasLimite,AplicaFechaVencimiento">
<Columns> <Columns>
@@ -2147,6 +2156,7 @@
</div> </div>
<asp:UpdatePanel ID="UpGvUsuarios" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpGvUsuarios" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnCargaPortal" runat="server" ClientIDMode="Static" Text="CargarPortal" Style="display: none;" OnClick="BtnCargaPortal_Click" />
<asp:GridView ID="GvUsuarios" runat="server" GridLines="None" DataKeyNames="CveUsuario, Usuario" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios"> <asp:GridView ID="GvUsuarios" runat="server" GridLines="None" DataKeyNames="CveUsuario, Usuario" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
<Columns> <Columns>
<asp:BoundField DataField="Usuario" ItemStyle-Width="30%" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Usuario" ItemStyle-Width="30%" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
@@ -4265,6 +4275,33 @@
<script src="/Metronic/assets/global/scripts/datatable.js"></script> <script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script> <script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function pageLoad(sender, e) {
if (<%= Me.ProveedorID %> > 0) {
$("#__tab_C_Tab_TabHistorial").on("click", function () {
$('#BtnCargaHistorial').click();
});
$("#__tab_C_Tab_TabCxP").on("click", function () {
$('#BtnCargaCxP').click();
});
$("#__tab_C_Tab_TabAnticipos").on("click", function () {
$('#BtnCargaAnticipos').click();
});
$("#__tab_C_Tab_TabBancos").on("click", function () {
$('#BtnCargaBancos').click();
});
$("#__tab_C_Tab_TabOC").on("click", function () {
$('#BtnCargaOC').click();
});
$("#__tab_C_Tab_TabUsuarios").on("click", function () {
$('#BtnCargaPortal').click();
});
}
}
$(document).ready(function () {
pageLoad();
});
//var OrdenarGV = function () { //var OrdenarGV = function () {
// var Tam = TamañoVentana(); // var Tam = TamañoVentana();
// var Alto = Tam.height - 330; // var Alto = Tam.height - 330;

View File

@@ -19,6 +19,11 @@ Partial Class Compras_Proveedores
Return ViewState("CveProveedor").ToString.ToEntero Return ViewState("CveProveedor").ToString.ToEntero
End Get End Get
End Property End Property
Public ReadOnly Property ProveedorID As Integer
Get
Return Me.CveProveedor
End Get
End Property
Private Property CveProveedorSucursal As Integer Private Property CveProveedorSucursal As Integer
Get Get
Return ViewState("CveProveedorSucursal").ToString.ToEntero Return ViewState("CveProveedorSucursal").ToString.ToEntero
@@ -499,15 +504,15 @@ Partial Class Compras_Proveedores
If CargaDatos() Then If CargaDatos() Then
CveMonedaFiltro = -1 CveMonedaFiltro = -1
CargaHistorial(CveProveedorSucursal) 'CargaHistorial(CveProveedorSucursal)
CargaCxP(CveProveedorSucursal) 'CargaCxP(CveProveedorSucursal)
CargaAnticipos(CveProveedorSucursal) 'CargaAnticipos(CveProveedorSucursal)
CargaBancos(CveProveedorSucursal) 'CargaBancos(CveProveedorSucursal)
CargaProveedorSucursales() CargaProveedorSucursales()
CargaCuentasBancarias() CargaCuentasBancarias()
CargaOC() 'CargaOC()
CargaDocs() 'CargaDocs()
'CargaColectivas() 'CargaColectivas()
'CargaSaldosBeneficiarios() 'CargaSaldosBeneficiarios()
'CargaUsuariosPortal() 'CargaUsuariosPortal()
@@ -758,27 +763,27 @@ Partial Class Compras_Proveedores
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
Dim nodo As XmlNode = XMLDoc.DocumentElement Dim nodo As XmlNode = XMLDoc.DocumentElement
Dim Version As String = ValorXml(nodo, "Version") Dim Version As String = ValorXml(nodo, "Version")
If Version = "3.2" Then If Version = "3.2" Then
Prefijo = "cfd" Prefijo = "cfd"
cfdVer = "http://www.sat.gob.mx/cfd/2" cfdVer = "http://www.sat.gob.mx/cfd/2"
ElseIf Version = "3.3" Then ElseIf Version = "3.3" Then
cfdVer = "http://www.sat.gob.mx/cfd/3" cfdVer = "http://www.sat.gob.mx/cfd/3"
Else ' se considera que es la version 4.0 Else ' se considera que es la version 4.0
cfdVer = "http://www.sat.gob.mx/cfd/4" cfdVer = "http://www.sat.gob.mx/cfd/4"
End If End If
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" 'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
namespaces.AddNamespace(Prefijo, cfdVer) namespaces.AddNamespace(Prefijo, cfdVer)
' XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("&lt;br&gt;", "").Replace("&lt;", "").Replace("o;?", "").Replace(ChrW(&HFEFF), "")) ' XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("&lt;br&gt;", "").Replace("&lt;", "").Replace("o;?", "").Replace(ChrW(&HFEFF), ""))
Dim node As XmlNode Dim node As XmlNode
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces) node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces)
If node IsNot Nothing Then If node IsNot Nothing Then
TxtRFC.Text = ValorXml(node, "rfc") TxtRFC.Text = ValorXml(node, "rfc")
@@ -5542,13 +5547,13 @@ Partial Class Compras_Proveedores
Dim ObjBancos As New ClsBancos() Dim ObjBancos As New ClsBancos()
If ObjBancos.NotificacionPago(HdnCveIE.Value.ToEntero, TxtParaMail.Text.Trim, TxtCC.Text.Trim, UsuarioActual) Then If ObjBancos.NotificacionPago(HdnCveIE.Value.ToEntero, TxtParaMail.Text.Trim, TxtCC.Text.Trim, UsuarioActual) Then
Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion) Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
Else Else
Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError) Alert("No se pudo enviar el correo electrónico.", TipoMensaje.MsgError)
End If End If
ObjBancos.Dispose() ObjBancos.Dispose()
'Dim ObjMail As New ClsSisMail() 'Dim ObjMail As New ClsSisMail()
@@ -5925,7 +5930,57 @@ Partial Class Compras_Proveedores
End If End If
UpDatos.Update() UpDatos.Update()
End Sub End Sub
Protected Sub BtnCargaHistorial_Click(sender As Object, e As EventArgs) Handles BtnCargaHistorial.Click
If CveProveedor > 0 Then
CargaHistorial(CveProveedorSucursal) ' <-- Tu método de carga
UpnHistorial.Update() ' <-- UpdatePanel de Historial
End If
End Sub
Protected Sub BtnCargaCxP_Click(sender As Object, e As EventArgs) Handles BtnCargaCxP.Click
If CveProveedor > 0 Then
CargaCxP(CveProveedorSucursal) ' <-- Tu método de carga
UPPCxP.Update() ' <-- UpdatePanel de CxP
End If
End Sub
Protected Sub BtnCargaAnticipos_Click(sender As Object, e As EventArgs) Handles BtnCargaAnticipos.Click
If CveProveedor > 0 Then
CargaAnticipos(CveProveedorSucursal) ' <-- Tu método de carga
UpAnticipos.Update() ' <-- UpdatePanel de Anticipos
End If
End Sub
Protected Sub BtnCargaBancos_Click(sender As Object, e As EventArgs) Handles BtnCargaBancos.Click
If CveProveedor > 0 Then
CargaBancos(CveProveedorSucursal) ' <-- Tu método de carga
UpBancos.Update() ' <-- UpdatePanel de Bancos
End If
End Sub
Protected Sub BtnCargaOC_Click(sender As Object, e As EventArgs) Handles BtnCargaOC.Click
If CveProveedor > 0 Then
CargaOC() ' <-- Tu método de carga
UpOC.Update() ' <-- UpdatePanel de OC
End If
End Sub
Protected Sub BtnCargaDocs_Click(sender As Object, e As EventArgs) Handles BtnCargaDocs.Click
If CveProveedor > 0 Then
CargaDocs() ' <-- Tu método de carga
UpDocumentos.Update() ' <-- UpdatePanel de Documentos
End If
End Sub
Protected Sub BtnCargaPortal_Click(sender As Object, e As EventArgs) Handles BtnCargaPortal.Click
If CveProveedor > 0 Then
CargaUsuariosPortalProveedor() ' <-- Tu método de carga
UpGvUsuarios.Update() ' <-- UpdatePanel de Portal/Usuarios
End If
End Sub
End Class End Class

View File

@@ -1518,7 +1518,7 @@ Partial Class Compras_eFacturas
If dt IsNot Nothing Then If dt IsNot Nothing Then
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}Logo.png")
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
@@ -1529,7 +1529,7 @@ Partial Class Compras_eFacturas
params.Add(New ReportParameter("FechaImpresion", Fecha.ToDateTime.ToShortDateString)) params.Add(New ReportParameter("FechaImpresion", Fecha.ToDateTime.ToShortDateString))
If Imagen.Exists Then If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", $"file//:{Imagen.FullName}")) params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
Else Else
params.Add(New ReportParameter("LogoPath", "")) params.Add(New ReportParameter("LogoPath", ""))
End If End If

View File

@@ -391,8 +391,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
for (int k = firstColumnIndex2; k <= lastColumnIndex2; k++) for (int k = firstColumnIndex2; k <= lastColumnIndex2; k++)
{ {
if (k > 0) if (k > 0)
{ {
bool flag = true;
switch (NombreHoja) switch (NombreHoja)
{ {
case "IVA Trasladado": case "IVA Trasladado":

File diff suppressed because it is too large Load Diff

View File

@@ -5,8 +5,10 @@
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Exportación: <span>
<asp:Label runat="server" Text="Exportación" ID="LblExp"></asp:Label> <asp:Label runat="server" ID="LblTipoOperacion"></asp:Label>
<asp:Label runat="server" ID="LblCveExportacion"></asp:Label>
</span>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
<li id="liImprimir" runat="server"> <li id="liImprimir" runat="server">
@@ -68,16 +70,28 @@
<asp:DropDownList ID="DdlClavePedimento" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPedimentoDescripcion" DataValueField="CvePedimento"></asp:DropDownList> <asp:DropDownList ID="DdlClavePedimento" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPedimentoDescripcion" DataValueField="CvePedimento"></asp:DropDownList>
<label for="<%= DdlClavePedimento.ClientID.ToString()%>">Clave pedimento:</label> <label for="<%= DdlClavePedimento.ClientID.ToString()%>">Clave pedimento:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright" style="width: 150px;"> <div class="form-group form-md-line-input input-iconright" style="width: 170px;">
<asp:TextBox ID="TxtNumPed" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtNumPed" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<ajaxToolkit:MaskedEditExtender ID="meeTxtPedimento" runat="server" <ajaxToolkit:MaskedEditExtender
ClearMaskOnLostFocus="false" ID="meeTxtPedimento"
runat="server"
TargetControlID="TxtNumPed" TargetControlID="TxtNumPed"
Mask="99--99--9999--9999999" Mask="99--99--9999--9999999"
MaskType="Number" MaskType="None"
ClearMaskOnLostFocus="false"
InputDirection="LeftToRight" InputDirection="LeftToRight"
AcceptNegative="None" AcceptNegative="None"
ErrorTooltipEnabled="True" /> ErrorTooltipEnabled="True" />
<asp:CustomValidator
ID="cvNumPed"
runat="server"
ControlToValidate="TxtNumPed"
ErrorMessage="El número de pedimento está incompleto o tiene un formato incorrecto."
ForeColor="Red"
Display="Dynamic"
ValidationGroup="GrpGuardar"
ClientValidationFunction="validaPedimento" />
<label for="<%= TxtNumPed.ClientID.ToString()%>" style="margin: 0; white-space: nowrap;">Número de Pedimento:</label> <label for="<%= TxtNumPed.ClientID.ToString()%>" style="margin: 0; white-space: nowrap;">Número de Pedimento:</label>
</div> </div>
<table> <table>
@@ -132,6 +146,14 @@
<asp:TextBox ID="TxtTipoCambio" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtTipoCambio" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTETipoCambio" runat="server" TargetControlID="TxtTipoCambio" FilterType="Custom, Numbers" ValidChars="." /> <ajax:FilteredTextBoxExtender ID="FTETipoCambio" runat="server" TargetControlID="TxtTipoCambio" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtTipoCambio.ClientID.ToString()%>">Tipo de Cambio:</label> <label for="<%= TxtTipoCambio.ClientID.ToString()%>">Tipo de Cambio:</label>
<asp:RequiredFieldValidator
ID="RFVTipoCambio"
runat="server"
ControlToValidate="TxtTipoCambio"
ErrorMessage="El tipo de cambio es obligatorio."
Display="Dynamic"
ForeColor="Red"
ValidationGroup="GrpGuardar" />
</div> </div>
<div class="form-group form-md-line-input input-iconright" style="width: 150px;"> <div class="form-group form-md-line-input input-iconright" style="width: 150px;">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm"></asp:DropDownList> <asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm"></asp:DropDownList>
@@ -654,6 +676,11 @@
<asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label> <asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTE" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:N2}")%>'> </asp:Label> <asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:N2}")%>'> </asp:Label>
@@ -717,6 +744,54 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
<ajax:TabPanel ID="TabDescargas" runat="server" HeaderText="Descargas">
<ContentTemplate>
<asp:UpdatePanel ID="UpDescargas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button runat="server" ID="BtnAgregarDescarga" OnClick="BtnAgregarDescarga_Click" Text="Agregar Descarga" CssClass="btn btn-primary" style="margin-top: 5px;" />
<br />
<br />
<div style="overflow-x: auto; width: 1235px;">
<asp:GridView ID="GVDescargas" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacionDescarga" OnRowCommand="GVDescargas_RowCommand" ShowFooter="true" OnRowDataBound="GVDescargas_RowDataBound" Width="100%" EmptyDataText="No se encontraron Descargas" ToolTip="Descargas" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Descarga" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblDescarga" runat="server" Text='<%# Eval("CveExportacionDescarga")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Partida Exportación" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblDescargaExp" runat="server" Text='<%# Eval("PSCodigoExp")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Partida Importación" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblDescargaImp" runat="server" Text='<%# Eval("PSCodigoImp")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblDescargaCant" runat="server" Text='<%# Eval("Cantidad")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditarDescarga" CommandName="EditarDescarga" CommandArgument='<%# Eval("CveExportacionDescarga") %>' CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarDescarga" runat="server" CommandName="EliminarDescarga" CommandArgument='<%# Eval("CveExportacionDescarga") %>' CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la Descarga?" data-btn-ok-label="Sí" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer> </ajax:TabContainer>
<br /> <br />
@@ -763,7 +838,7 @@
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-4">
<asp:UpdatePanel ID="UPPUM" runat="server" UpdateMode="Conditional" RenderMode="Inline"> <asp:UpdatePanel ID="UPPUM" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate> <ContentTemplate>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -773,6 +848,16 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
<div class="col-md-4">
<asp:UpdatePanel ID="UPPTE" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoEmpaque" runat="server" CssClass=" form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Width="100"></asp:DropDownList></td>
<label for="<%= DdlTipoEmpaque.ClientID.ToString()%>">Tipo de Empaque:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
@@ -840,7 +925,98 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
<div id="DModalDescarga" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpDescarga" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<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" id="H2" runat="server">Agregar Descarga</h4>
</div>
<div id="DVBodyAddDescarga" style="overflow: auto!important">
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyAddDescarga" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UpDExportacion" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPartidaExp" runat="server" CssClass=" form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="PSCodigo" DataValueField="CveExportacionDetalle" Width="100%" ValidationGroup="GrpAgregaDescarga"></asp:DropDownList></td>
<label for="<%= DdlPartidaExp.ClientID.ToString()%>">Partida Exportación:</label>
<asp:RequiredFieldValidator ID="RFVPartidaExp" runat="server" ControlToValidate="DdlPartidaExp" Display="None" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida Exportación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaDescarga"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPartidaExp" runat="server" HighlightCssClass="vco" TargetControlID="RFVPartidaExp" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<br />
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UpDImportacion" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPartidaImp" runat="server" CssClass=" form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="PSCodigo" DataValueField="CveExportacionDetalle" Width="100%" ValidationGroup="GrpAgregaDescarga"></asp:DropDownList></td>
<label for="<%= DdlPartidaImp.ClientID.ToString()%>">Partida Importación:</label>
<asp:RequiredFieldValidator ID="RFVPartidaImp" runat="server" ControlToValidate="DdlPartidaImp" Display="None" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Partida Importación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregaDescarga"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPartidaImp" runat="server" HighlightCssClass="vco" TargetControlID="RFVPartidaImp" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDCantidad" ClientIDMode="Static" runat="server" CssClass=" form-control " CausesValidation="true" MaxLength="12" ValidationGroup="GrpAgregaDescarga"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTEDCantidad" runat="server" TargetControlID="TxtDCantidad" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtDCantidad.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright" align="right" id="DivAgregarOtraDescarga" runat="server">
<label>Continuar agregando:</label>
<asp:CheckBox ID="ChkSeguirAgregandoDescargas" runat="server" Checked="true" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel ID="UpAddDescargaBotones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:Button ID="BtnDescargaGuardar" OnClick="BtnDescargaGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpAgregaDescarga" />
<asp:Button ID="BtnDescargaActualizar" OnClick="BtnDescargaGuardar_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="GrpAgregaDescarga" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</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">
function validaPedimento(sender, args) {
// Regex: 2 dígitos, --, 2 dígitos, --, 4 dígitos, --, 7 dígitos
var regex = /^\d{2}--\d{2}--\d{4}--\d{7}$/;
args.IsValid = regex.test(args.Value);
}
</script>
</asp:Content> </asp:Content>

View File

@@ -35,6 +35,11 @@ public partial class Export_ExpDetalle : ClsPaginas
get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); } get { return (ViewState["CveExportacionDetalle"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDetalle"]); }
set { ViewState["CveExportacionDetalle"] = value; } set { ViewState["CveExportacionDetalle"] = value; }
} }
private int CveExportacionDescarga
{
get { return (ViewState["CveExportacionDescarga"] == null) ? -1 : Convert.ToInt32(ViewState["CveExportacionDescarga"]); }
set { ViewState["CveExportacionDescarga"] = value; }
}
private bool EsImportacion private bool EsImportacion
{ {
@@ -56,16 +61,13 @@ public partial class Export_ExpDetalle : ClsPaginas
LblTipoExp.InnerText = EsImportacion ? "Tipo Importación:" : "Tipo Exportación:"; LblTipoExp.InnerText = EsImportacion ? "Tipo Importación:" : "Tipo Exportación:";
if (EsImportacion) // Asigna el texto descriptivo
{ LblTipoOperacion.Text = EsImportacion ? "Importación: " : "Exportación: ";
LblExp.Text = "Importaciones";
}
else
{
LblExp.Text = "Exportación";
}
// Asigna el número de clave
CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1; CveExportacion = !string.IsNullOrEmpty(Request["CveExportacion"]) ? Request["CveExportacion"].ToEntero() : -1;
LblCveExportacion.Text = CveExportacion > 0 ? CveExportacion.ToString() : "";
InicializarValores(); InicializarValores();
CargaDatos(); CargaDatos();
} }
@@ -152,7 +154,7 @@ public partial class Export_ExpDetalle : ClsPaginas
DTExportaciones = Exportaciones.DtResultados; DTExportaciones = Exportaciones.DtResultados;
if (DTExportaciones.Rows.Count > 0) if (DTExportaciones.Rows.Count > 0)
{ {
LblExp.Text = DTExportaciones.FiltroPrimeroValor("CveExportacion"); LblCveExportacion.Text = DTExportaciones.FiltroPrimeroValor("CveExportacion");
DdlSubProyecto.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveSubProyecto"); DdlSubProyecto.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveSubProyecto");
@@ -231,6 +233,7 @@ public partial class Export_ExpDetalle : ClsPaginas
DdlDirCon.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveDirConsignatario"); DdlDirCon.SelectedValue = DTExportaciones.FiltroPrimeroValor("CveDirConsignatario");
CargarPartidas(); CargarPartidas();
CargarDescargas();
} }
} }
Exportaciones.Dispose(); Exportaciones.Dispose();
@@ -489,13 +492,14 @@ public partial class Export_ExpDetalle : ClsPaginas
{ {
int CvePS = row["CvePS"].ToEntero(); int CvePS = row["CvePS"].ToEntero();
int CveUnidadMedida = row["CveUnidadMedida"].ToEntero(); int CveUnidadMedida = row["CveUnidadMedida"].ToEntero();
int CveTipoEmpaque = row["CveTipoEmpaque"].ToEntero();
int CvePais = row["CvePais"].ToEntero(); int CvePais = row["CvePais"].ToEntero();
decimal Precio = ModExtensiones.ToDecimal(row["Precio"].ToString()); decimal Precio = ModExtensiones.ToDecimal(row["Precio"].ToString());
decimal Cantidad = ModExtensiones.ToDecimal(row["Cantidad"].ToString()); decimal Cantidad = ModExtensiones.ToDecimal(row["Cantidad"].ToString());
decimal PesoUnitario = ModExtensiones.ToDecimal(row["PesoUnitario"].ToString()); decimal PesoUnitario = ModExtensiones.ToDecimal(row["PesoUnitario"].ToString());
ClsExportaciones Partidas = new ClsExportaciones(); ClsExportaciones Partidas = new ClsExportaciones();
Partidas.AddPartida(CvePS, CveUnidadMedida, Precio, CveEmpresa, CveUsuario, ExportacionGuardada, Cantidad, PesoUnitario, CvePais); Partidas.AddPartida(CvePS, CveUnidadMedida, CveTipoEmpaque, Precio, CveEmpresa, CveUsuario, ExportacionGuardada, Cantidad, PesoUnitario, CvePais);
Partidas.Dispose(); Partidas.Dispose();
} }
} }
@@ -598,7 +602,7 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
Partidas.Dispose(); Partidas.Dispose();
} }
protected void CargarUnidadMedida(string CvePS = "-1", string CveUnidadMedida = "-1") protected void CargarUnidadMedida(string CvePS = "-1", string CveUnidadMedida = "-1", string CveTipoEmpaque = "-1")
{ {
int CveEmpresa = UsuarioActual.CveEmpresa; int CveEmpresa = UsuarioActual.CveEmpresa;
@@ -618,6 +622,23 @@ public partial class Export_ExpDetalle : ClsPaginas
DdlUM.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlUM.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUM.SelectedValue = "-1"; DdlUM.SelectedValue = "-1";
} }
DdlTipoEmpaque.Items.Clear();
if (CvePS != "" && CvePS != "-1")
{
if (UsuarioActual.Empresa.UsaInventarios)
DdlTipoEmpaque.DataSource = get_GlobalDTProductosServiciosEquivalencias(CvePS.ToEntero(), -1, CveEmpresa);
else
DdlTipoEmpaque.DataSource = get_GlobalDTUnidadesMedida(CveEmpresa);
DdlTipoEmpaque.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlTipoEmpaque.DataBind();
DdlTipoEmpaque.SelectedValueExist(CveTipoEmpaque);
}
else
{
DdlTipoEmpaque.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlTipoEmpaque.SelectedValue = "-1";
}
} }
protected void AbrirModalPartida(int GVPartidasRowIndex = -1) protected void AbrirModalPartida(int GVPartidasRowIndex = -1)
{ {
@@ -631,6 +652,7 @@ public partial class Export_ExpDetalle : ClsPaginas
DdlPS.DataBind(); DdlPS.DataBind();
DdlUM.Items.Clear(); DdlUM.Items.Clear();
DdlTipoEmpaque.Items.Clear();
DdlPaisOrigen.Items.Clear(); DdlPaisOrigen.Items.Clear();
DdlPaisOrigen.DataSource = GlobalDTGralPaises; DdlPaisOrigen.DataSource = GlobalDTGralPaises;
@@ -657,7 +679,7 @@ public partial class Export_ExpDetalle : ClsPaginas
TxtCantidad.Text = DTPartidas.FiltroPrimeroValor("Cantidad"); TxtCantidad.Text = DTPartidas.FiltroPrimeroValor("Cantidad");
TxtPesoUnitario.Text = DTPartidas.FiltroPrimeroValor("PesoUnitario"); TxtPesoUnitario.Text = DTPartidas.FiltroPrimeroValor("PesoUnitario");
CargarUnidadMedida(CvePS, DTPartidas.FiltroPrimeroValor("CveUnidadMedida")); CargarUnidadMedida(CvePS, DTPartidas.FiltroPrimeroValor("CveUnidadMedida"), DTPartidas.FiltroPrimeroValor("CveTipoEmpaque"));
} }
} }
Partidas.Dispose(); Partidas.Dispose();
@@ -681,7 +703,7 @@ public partial class Export_ExpDetalle : ClsPaginas
TxtCantidad.Text = DTTemp.Rows[GVPartidasRowIndex]["Cantidad"].ToString(); TxtCantidad.Text = DTTemp.Rows[GVPartidasRowIndex]["Cantidad"].ToString();
TxtPesoUnitario.Text = DTTemp.Rows[GVPartidasRowIndex]["PesoUnitario"].ToString(); TxtPesoUnitario.Text = DTTemp.Rows[GVPartidasRowIndex]["PesoUnitario"].ToString();
CargarUnidadMedida(CvePS, DTTemp.Rows[GVPartidasRowIndex]["CveUnidadMedida"].ToString()); CargarUnidadMedida(CvePS, DTTemp.Rows[GVPartidasRowIndex]["CveUnidadMedida"].ToString(), DTTemp.Rows[GVPartidasRowIndex]["CveTipoEmpaque"].ToString());
} }
} }
else else
@@ -728,6 +750,7 @@ public partial class Export_ExpDetalle : ClsPaginas
if (Continuar) if (Continuar)
{ {
Alert("La Partida se ha eliminado correctamente.", ModExtensiones.TipoMensaje.ToastInformacion); Alert("La Partida se ha eliminado correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
CargarDescargas();
} }
} }
else else
@@ -807,6 +830,8 @@ public partial class Export_ExpDetalle : ClsPaginas
string PSCodigo = DdlPS.SelectedItem.Text; string PSCodigo = DdlPS.SelectedItem.Text;
int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero(); int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero();
string UnidadMedida = (CveUnidadMedida == -1) ? "" : DdlUM.SelectedItem.Text; string UnidadMedida = (CveUnidadMedida == -1) ? "" : DdlUM.SelectedItem.Text;
int CveTipoEmpaque = (DdlTipoEmpaque.Text == "") ? -1 : DdlTipoEmpaque.Text.ToEntero();
string TipoEmpaque = (CveTipoEmpaque == -1) ? "" : DdlTipoEmpaque.SelectedItem.Text;
int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero(); int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero();
string ClaveSATPais = (CvePais == -1) ? "" : DdlPaisOrigen.SelectedItem.Text; string ClaveSATPais = (CvePais == -1) ? "" : DdlPaisOrigen.SelectedItem.Text;
decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text); decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text);
@@ -854,6 +879,8 @@ public partial class Export_ExpDetalle : ClsPaginas
PartidaRow["PSCodigo"] = PSCodigo; PartidaRow["PSCodigo"] = PSCodigo;
PartidaRow["CveUnidadMedida"] = CveUnidadMedida; PartidaRow["CveUnidadMedida"] = CveUnidadMedida;
PartidaRow["UnidadMedida"] = UnidadMedida; PartidaRow["UnidadMedida"] = UnidadMedida;
PartidaRow["CveTipoEmpaque"] = CveTipoEmpaque;
PartidaRow["TipoEmpaque"] = TipoEmpaque;
PartidaRow["CvePais"] = CvePais; PartidaRow["CvePais"] = CvePais;
PartidaRow["ClaveSATPais"] = ClaveSATPais; PartidaRow["ClaveSATPais"] = ClaveSATPais;
PartidaRow["Precio"] = Precio; PartidaRow["Precio"] = Precio;
@@ -878,6 +905,8 @@ public partial class Export_ExpDetalle : ClsPaginas
PartidaRow["PSCodigo"] = PSCodigo; PartidaRow["PSCodigo"] = PSCodigo;
PartidaRow["CveUnidadMedida"] = CveUnidadMedida; PartidaRow["CveUnidadMedida"] = CveUnidadMedida;
PartidaRow["UnidadMedida"] = UnidadMedida; PartidaRow["UnidadMedida"] = UnidadMedida;
PartidaRow["CveTipoEmpaque"] = CveTipoEmpaque;
PartidaRow["TipoEmpaque"] = TipoEmpaque;
PartidaRow["CvePais"] = CvePais; PartidaRow["CvePais"] = CvePais;
PartidaRow["ClaveSATPais"] = ClaveSATPais; PartidaRow["ClaveSATPais"] = ClaveSATPais;
PartidaRow["Precio"] = Precio; PartidaRow["Precio"] = Precio;
@@ -899,6 +928,7 @@ public partial class Export_ExpDetalle : ClsPaginas
{ {
int CvePS = DdlPS.Text.ToEntero(); int CvePS = DdlPS.Text.ToEntero();
int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero(); int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero();
int CveTipoEmpaque = (DdlTipoEmpaque.Text == "") ? -1 : DdlTipoEmpaque.Text.ToEntero();
int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero(); int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero();
decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text); decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text);
decimal ValorTotalMXP = Precio * ModExtensiones.ToDecimal(TxtTipoCambio.Text); decimal ValorTotalMXP = Precio * ModExtensiones.ToDecimal(TxtTipoCambio.Text);
@@ -921,6 +951,8 @@ public partial class Export_ExpDetalle : ClsPaginas
DTTemp.Columns.Add("PSCodigo", typeof(string)); DTTemp.Columns.Add("PSCodigo", typeof(string));
DTTemp.Columns.Add("CveUnidadMedida", typeof(int)); DTTemp.Columns.Add("CveUnidadMedida", typeof(int));
DTTemp.Columns.Add("UnidadMedida", typeof(string)); DTTemp.Columns.Add("UnidadMedida", typeof(string));
DTTemp.Columns.Add("CveTipoEmpaque", typeof(int));
DTTemp.Columns.Add("TipoEmpaque", typeof(string));
DTTemp.Columns.Add("CvePais", typeof(int)); DTTemp.Columns.Add("CvePais", typeof(int));
DTTemp.Columns.Add("ClaveSATPais", typeof(string)); DTTemp.Columns.Add("ClaveSATPais", typeof(string));
DTTemp.Columns.Add("Precio", typeof(decimal)); DTTemp.Columns.Add("Precio", typeof(decimal));
@@ -954,7 +986,7 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
else else
{ {
bool Continuar = Partidas.AddPartida(CvePS, CveUnidadMedida, Precio, UsuarioActual.CveEmpresa, CveUsuario, CveExportacion, Cantidad, PesoUnitario, CvePais); bool Continuar = Partidas.AddPartida(CvePS, CveUnidadMedida, CveTipoEmpaque, Precio, UsuarioActual.CveEmpresa, CveUsuario, CveExportacion, Cantidad, PesoUnitario, CvePais);
Partidas.Dispose(); Partidas.Dispose();
if (Continuar) if (Continuar)
{ {
@@ -965,12 +997,13 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
else else
{ {
bool Continuar = Partidas.UpdatePartida(CveExportacionDetalle, CvePS, CveUnidadMedida, Precio, CveUsuario, Cantidad, PesoUnitario, CvePais); bool Continuar = Partidas.UpdatePartida(CveExportacionDetalle, CvePS, CveUnidadMedida, CveTipoEmpaque, Precio, CveUsuario, Cantidad, PesoUnitario, CvePais);
Partidas.Dispose(); Partidas.Dispose();
if (Continuar) if (Continuar)
{ {
//RegistraScript("$('#DModalPartida').modal('hide');"); //RegistraScript("$('#DModalPartida').modal('hide');");
Alert("La Partida se ha actualizado correctamente.", ModExtensiones.TipoMensaje.ToastInformacion); Alert("La Partida se ha actualizado correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
CargarDescargas();
} }
} }
if (ChkSeguirAgregandoPartidas.Checked == false) if (ChkSeguirAgregandoPartidas.Checked == false)
@@ -980,6 +1013,7 @@ public partial class Export_ExpDetalle : ClsPaginas
else else
{ {
DdlUM.Items.Clear(); DdlUM.Items.Clear();
DdlTipoEmpaque.Items.Clear();
DdlPS.SelectedValue = "-1"; DdlPS.SelectedValue = "-1";
DdlPaisOrigen.SelectedValue = "-1"; DdlPaisOrigen.SelectedValue = "-1";
TxtPrecio.Text = ""; TxtPrecio.Text = "";
@@ -989,9 +1023,199 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
CargarPartidas(); CargarPartidas();
} }
protected void CargarDescargas()
{
DataTable DTDescargas = new DataTable();
ClsExportaciones Descargas = new ClsExportaciones();
if (CveExportacion != -1)
{
if (Descargas.GetDescargas(UsuarioActual.CveEmpresa, CveExportacion))
{
DTDescargas = Descargas.DtResultados;
if (DTDescargas.Rows.Count > 0)
{
GVDescargas.DataSource = DTDescargas;
GVDescargas.DataBind();
UpDescargas.Update();
}
}
}
Descargas.Dispose();
}
protected void AbrirModalDescarga()
{
RegistraScript("$('#DModalDescarga').modal();");
int CveEmpresa = UsuarioActual.CveEmpresa;
DdlPartidaExp.Items.Clear();
DdlPartidaImp.Items.Clear();
ClsExportaciones Partidas = new ClsExportaciones();
if (Partidas.GetPartidas(UsuarioActual.CveEmpresa, CveExportacion))
{
DdlPartidaExp.DataSource = Partidas.DtResultados;
DdlPartidaImp.DataSource = Partidas.DtResultados;
}
Partidas.Dispose();
DdlPartidaExp.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlPartidaExp.DataBind();
DdlPartidaImp.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlPartidaImp.DataBind();
if (CveExportacionDescarga != -1)
{
ChkSeguirAgregandoDescargas.Checked = false;
DivAgregarOtraDescarga.Visible = false;
BtnDescargaGuardar.Visible = false;
BtnDescargaActualizar.Visible = true;
ClsExportaciones Descargas = new ClsExportaciones();
if (Descargas.GetDescargas(CveEmpresa, CveExportacion, CveExportacionDescarga))
{
DataTable DTDescargas = Descargas.DtResultados;
if (DTDescargas.Rows.Count > 0)
{
string CveExpDetalle = DTDescargas.FiltroPrimeroValor("CveExportacionDetalle");
DdlPartidaExp.SelectedValue = CveExpDetalle;
string CveImpDetalle = DTDescargas.FiltroPrimeroValor("CveImportacionDetalle");
DdlPartidaImp.SelectedValue = CveImpDetalle;
TxtDCantidad.Text = DTDescargas.FiltroPrimeroValor("Cantidad");
}
}
Partidas.Dispose();
}
else
{
ChkSeguirAgregandoDescargas.Checked = true;
DivAgregarOtraDescarga.Visible = true;
BtnDescargaGuardar.Visible = true;
BtnDescargaActualizar.Visible = false;
TxtDCantidad.Text = "";
}
UpDescarga.Update();
}
protected void BtnAgregarDescarga_Click(object sender, EventArgs e)
{
if (CveExportacion != -1)
{
ClsExportaciones Partidas = new ClsExportaciones();
if (Partidas.GetPartidas(UsuarioActual.CveEmpresa, CveExportacion))
{
if (Partidas.DtResultados.Rows.Count > 0)
{
CveExportacionDescarga = -1;
AbrirModalDescarga();
}
else
{
Alert("Agregue Partidas para poder añadir una Descarga.", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
Partidas.Dispose();
}
else
{
Alert("Guarde los cambios para poder agregar una Descarga.", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
protected void BtnDescargaGuardar_Click(object sender, EventArgs e)
{
int CveExpDetalle = DdlPartidaExp.Text.ToEntero();
int CveImpDetalle = DdlPartidaImp.Text.ToEntero();
decimal Cantidad = ModExtensiones.ToDecimal(TxtDCantidad.Text);
int CveUsuario = UsuarioActual.CveUsuario;
ClsExportaciones Descargas = new ClsExportaciones();
if (CveExportacionDescarga == -1)
{
if (CveExportacion != -1)
{
bool Continuar = Descargas.AddDescarga(CveExpDetalle, CveImpDetalle, Cantidad, UsuarioActual.CveEmpresa);
Descargas.Dispose();
if (Continuar)
{
Alert("La Descarga se ha agregado correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
}
}
}
else
{
bool Continuar = Descargas.UpdateDescarga(CveExportacionDescarga, CveExpDetalle, CveImpDetalle, Cantidad);
Descargas.Dispose();
if (Continuar)
{
Alert("La Descarga se ha actualizado correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
}
}
if (ChkSeguirAgregandoDescargas.Checked == false)
{
RegistraScript("$('#DModalDescarga').modal('hide');");
}
else
{
DdlPartidaExp.SelectedValue = "-1";
DdlPartidaImp.SelectedValue = "-1";
TxtDCantidad.Text = "";
UpDescarga.Update();
}
CargarDescargas();
}
protected void GVDescargas_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer && GVDescargas.Rows.Count > 0)
{
decimal TotalCantidad = 0;
foreach (GridViewRow row in GVDescargas.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
Label lblDescargaCant = (Label)row.FindControl("lblDescargaCant");
if (lblDescargaCant != null && lblDescargaCant.Text != "")
TotalCantidad += Convert.ToDecimal(lblDescargaCant.Text.Replace(",", "").Trim());
}
}
e.Row.Cells[0].Text = "Total:";
e.Row.Cells[3].Text = TotalCantidad.ToString("#,###.####");
e.Row.Font.Bold = true;
e.Row.BackColor = System.Drawing.Color.LightGray;
}
}
protected void GVDescargas_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditarDescarga")
{
CveExportacionDescarga = -1;
if (CveExportacion != -1)
{
CveExportacionDescarga = e.CommandArgument.ToEntero();
}
AbrirModalDescarga();
}
if (e.CommandName == "EliminarDescarga")
{
if (CveExportacion != -1)
{
ClsExportaciones Descargas = new ClsExportaciones();
bool Continuar = Descargas.RemoveDescarga(e.CommandArgument.ToEntero());
Descargas.Dispose();
if (Continuar)
{
Alert("La Descarga se ha eliminado correctamente.", ModExtensiones.TipoMensaje.ToastInformacion);
}
}
CargarDescargas();
}
}
protected void DdlPS_SelectedIndexChanged(object sender, EventArgs e) protected void DdlPS_SelectedIndexChanged(object sender, EventArgs e)
{ {
CargarUnidadMedida(DdlPS.Text, DdlUM.Text); CargarUnidadMedida(DdlPS.Text, DdlUM.Text, DdlTipoEmpaque.Text);
UpPSS.Update(); UpPSS.Update();
} }
@@ -1002,7 +1226,9 @@ public partial class Export_ExpDetalle : ClsPaginas
int CveEmpresa = UsuarioActual.CveEmpresa; int CveEmpresa = UsuarioActual.CveEmpresa;
DataTable DTExportaciones = new DataTable(); DataTable DTExportaciones = new DataTable();
ClsExportaciones Exportaciones = new ClsExportaciones(); ClsExportaciones Exportaciones = new ClsExportaciones();
if (Exportaciones.GetExportacion(CveExportacion, CveEmpresa))
bool EsExportacion = !EsImportacion;
if (Exportaciones.GetExportacion(CveExportacion, CveEmpresa, EsExportacion))
{ {
DTExportaciones = Exportaciones.DtResultados; DTExportaciones = Exportaciones.DtResultados;
if (DTExportaciones.Rows.Count > 0) if (DTExportaciones.Rows.Count > 0)
@@ -1011,9 +1237,12 @@ public partial class Export_ExpDetalle : ClsPaginas
string ClienteExportador = DTExportaciones.FiltroPrimeroValor("ClienteExportador"); string ClienteExportador = DTExportaciones.FiltroPrimeroValor("ClienteExportador");
string DirExportador = DTExportaciones.FiltroPrimeroValor("DirExportador"); string DirExportador = DTExportaciones.FiltroPrimeroValor("DirExportador");
string RFCExp = DTExportaciones.FiltroPrimeroValor("RFCExp"); string RFCExp = DTExportaciones.FiltroPrimeroValor("RFCExp");
string PPSExp = DTExportaciones.FiltroPrimeroValor("PPSExp");
string IMMEXexp = DTExportaciones.FiltroPrimeroValor("IMMEXexp");
string ClienteImportador = DTExportaciones.FiltroPrimeroValor("ClienteImportador"); string ClienteImportador = DTExportaciones.FiltroPrimeroValor("ClienteImportador");
string DirImportador = DTExportaciones.FiltroPrimeroValor("DirImportador"); string DirImportador = DTExportaciones.FiltroPrimeroValor("DirImportador");
string RFCImp = DTExportaciones.FiltroPrimeroValor("RFCImp"); string RFCImp = DTExportaciones.FiltroPrimeroValor("RFCImp");
string PPSImp = DTExportaciones.FiltroPrimeroValor("PPSImp");
string IMMEXimp = DTExportaciones.FiltroPrimeroValor("IMMEXimp"); string IMMEXimp = DTExportaciones.FiltroPrimeroValor("IMMEXimp");
string NumFactura = DTExportaciones.FiltroPrimeroValor("SerieFolio"); string NumFactura = DTExportaciones.FiltroPrimeroValor("SerieFolio");
string ClaveSATPedimento = DTExportaciones.FiltroPrimeroValor("ClaveSATPedimento"); string ClaveSATPedimento = DTExportaciones.FiltroPrimeroValor("ClaveSATPedimento");
@@ -1043,6 +1272,7 @@ public partial class Export_ExpDetalle : ClsPaginas
string ClienteConsignatario = DTExportaciones.FiltroPrimeroValor("ClienteConsignatario"); string ClienteConsignatario = DTExportaciones.FiltroPrimeroValor("ClienteConsignatario");
string DirConsignatario = DTExportaciones.FiltroPrimeroValor("DirConsignatario"); string DirConsignatario = DTExportaciones.FiltroPrimeroValor("DirConsignatario");
string RFCCon = DTExportaciones.FiltroPrimeroValor("RFCCon"); string RFCCon = DTExportaciones.FiltroPrimeroValor("RFCCon");
string PPSCon = DTExportaciones.FiltroPrimeroValor("PPSCon");
string IMMEXcon = DTExportaciones.FiltroPrimeroValor("IMMEXcon"); string IMMEXcon = DTExportaciones.FiltroPrimeroValor("IMMEXcon");
decimal IncFletes = 0.00m; decimal IncFletes = 0.00m;
@@ -1058,6 +1288,18 @@ public partial class Export_ExpDetalle : ClsPaginas
decimal TotalInc = 0.00m; decimal TotalInc = 0.00m;
decimal TotalDec = 0.00m; decimal TotalDec = 0.00m;
string Sellos = "";
for (int i = 1; i <= 3; i++)
{
string sello = DTExportaciones.FiltroPrimeroValor($"Sello{i}");
if (sello != "")
{
if(Sellos == "")
Sellos += sello;
else
Sellos += $", {sello}";
}
}
string DescContenedor = DTExportaciones.FiltroPrimeroValor("DescripcionContenedor"); string DescContenedor = DTExportaciones.FiltroPrimeroValor("DescripcionContenedor");
string ContenedorPlaca = DTExportaciones.FiltroPrimeroValor("ContenedorPlaca"); string ContenedorPlaca = DTExportaciones.FiltroPrimeroValor("ContenedorPlaca");
string Proveedor = DTExportaciones.FiltroPrimeroValor("Proveedor"); string Proveedor = DTExportaciones.FiltroPrimeroValor("Proveedor");
@@ -1077,9 +1319,12 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("ClienteExportador", ClienteExportador)); para.Add(new ReportParameter("ClienteExportador", ClienteExportador));
para.Add(new ReportParameter("DirExportador", DirExportador)); para.Add(new ReportParameter("DirExportador", DirExportador));
para.Add(new ReportParameter("RFCExp", RFCExp)); para.Add(new ReportParameter("RFCExp", RFCExp));
para.Add(new ReportParameter("PPSExp", PPSExp));
para.Add(new ReportParameter("IMMEXexp", IMMEXexp));
para.Add(new ReportParameter("ClienteImportador", ClienteImportador)); para.Add(new ReportParameter("ClienteImportador", ClienteImportador));
para.Add(new ReportParameter("DirImportador", DirImportador)); para.Add(new ReportParameter("DirImportador", DirImportador));
para.Add(new ReportParameter("RFCImp", RFCImp)); para.Add(new ReportParameter("RFCImp", RFCImp));
para.Add(new ReportParameter("PPSImp", PPSImp));
para.Add(new ReportParameter("IMMEXimp", IMMEXimp)); para.Add(new ReportParameter("IMMEXimp", IMMEXimp));
para.Add(new ReportParameter("NumFactura", NumFactura)); para.Add(new ReportParameter("NumFactura", NumFactura));
para.Add(new ReportParameter("ClaveSATPedimento", ClaveSATPedimento)); para.Add(new ReportParameter("ClaveSATPedimento", ClaveSATPedimento));
@@ -1093,6 +1338,7 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("ClienteConsignatario", ClienteConsignatario)); para.Add(new ReportParameter("ClienteConsignatario", ClienteConsignatario));
para.Add(new ReportParameter("DirConsignatario", DirConsignatario)); para.Add(new ReportParameter("DirConsignatario", DirConsignatario));
para.Add(new ReportParameter("RFCCon", RFCCon)); para.Add(new ReportParameter("RFCCon", RFCCon));
para.Add(new ReportParameter("PPSCon", PPSCon));
para.Add(new ReportParameter("IMMEXcon", IMMEXcon)); para.Add(new ReportParameter("IMMEXcon", IMMEXcon));
ClsExportaciones Gastos = new ClsExportaciones(); ClsExportaciones Gastos = new ClsExportaciones();
@@ -1130,6 +1376,7 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("DecOtros", DecOtros.ToString("#,###.####"))); para.Add(new ReportParameter("DecOtros", DecOtros.ToString("#,###.####")));
para.Add(new ReportParameter("TotalDec", TotalDec.ToString("#,###.####"))); para.Add(new ReportParameter("TotalDec", TotalDec.ToString("#,###.####")));
para.Add(new ReportParameter("Sellos", Sellos));
para.Add(new ReportParameter("DescContenedor", DescContenedor)); para.Add(new ReportParameter("DescContenedor", DescContenedor));
para.Add(new ReportParameter("ContenedorPlaca", ContenedorPlaca)); para.Add(new ReportParameter("ContenedorPlaca", ContenedorPlaca));
para.Add(new ReportParameter("Proveedor", Proveedor)); para.Add(new ReportParameter("Proveedor", Proveedor));
@@ -1162,6 +1409,18 @@ public partial class Export_ExpDetalle : ClsPaginas
DTPartidas.Columns["ValorUnitarioMN"].DefaultValue = 0.0m; DTPartidas.Columns["ValorUnitarioMN"].DefaultValue = 0.0m;
foreach (DataRow row in DTPartidas.Rows) foreach (DataRow row in DTPartidas.Rows)
{ {
string PSCodigoSinDescripcion = row["PSCodigoSinDescripcion"].ToString();
if (PSCodigoSinDescripcion != "")
row["PSCodigo"] = PSCodigoSinDescripcion;
string FraccionArancelaria = row["FraccionArancelaria"].ToString();
if (FraccionArancelaria.Contains("-"))
{
string[] partes = FraccionArancelaria.Split('-');
if (partes[0] != "")
row["FraccionArancelaria"] = partes[0];
}
decimal cantidad = Convert.ToDecimal(row["Cantidad"]); decimal cantidad = Convert.ToDecimal(row["Cantidad"]);
if (cantidad > 0) if (cantidad > 0)
{ {
@@ -1169,21 +1428,54 @@ public partial class Export_ExpDetalle : ClsPaginas
row["ValorUnitarioMN"] = Convert.ToDecimal(row["ValorTotalMXP"]) / cantidad; row["ValorUnitarioMN"] = Convert.ToDecimal(row["ValorTotalMXP"]) / cantidad;
} }
} }
ReportDataSource RDSPartidas = new ReportDataSource(); ReportDataSource RDSPartidas = new ReportDataSource();
RDSPartidas.Name = "DsPartidas"; RDSPartidas.Name = "DsPartidas";
RDSPartidas.Value = DTPartidas; RDSPartidas.Value = DTPartidas;
lrds.Add(RDSPartidas); lrds.Add(RDSPartidas);
var EmpaquesAgrupado = from row in DTPartidas.AsEnumerable()
where !string.IsNullOrWhiteSpace(row.Field<string>("TipoEmpaque"))
group row by row.Field<string>("TipoEmpaque") into g
select new
{
TipoEmpaque = g.Key,
Cantidad = g.Sum(r => r.Field<decimal>("Cantidad"))
};
DataTable DTBultos = new DataTable();
DTBultos.Columns.Add("TipoEmpaque", typeof(string));
DTBultos.Columns.Add("Cantidad", typeof(decimal));
foreach (var item in EmpaquesAgrupado)
{
DTBultos.Rows.Add(item.TipoEmpaque, item.Cantidad);
}
ReportDataSource RDSBultos = new ReportDataSource();
RDSBultos.Name = "DsBultos";
RDSBultos.Value = DTBultos;
lrds.Add(RDSBultos);
} }
} }
Partidas.Dispose();
string NombreArchivo = $"Exportacion_{CveExportacion}"; string NombreArchivo;
string Formato;
if (EsExportacion)
{
NombreArchivo = $"Exportacion_{CveExportacion}";
Formato = "FormatoExportacion.mrt";
}
else
{
NombreArchivo = $"Importacion_{CveExportacion}";
Formato = "FormatoImportacion.mrt";
}
string CveVenta = DTExportaciones.FiltroPrimeroValor("CveVenta"); ; string CveVenta = DTExportaciones.FiltroPrimeroValor("CveVenta"); ;
if (CveVenta != "" && CveVenta != "-1") if (EsExportacion && CveVenta != "" && CveVenta != "-1")
{ {
NombreArchivo = NumFactura; NombreArchivo = NumFactura;
} }
string Formato = "FormatoExportacion.mrt";
para.Add(new ReportParameter("Formato", "PDF")); para.Add(new ReportParameter("Formato", "PDF"));
string Ruta = ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\{UsuarioActual.CveEmpresa}\Formatos\{Formato}"; string Ruta = ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\{UsuarioActual.CveEmpresa}\Formatos\{Formato}";
@@ -1202,18 +1494,6 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
protected void LBImprimir_Click(object sender, EventArgs e) protected void LBImprimir_Click(object sender, EventArgs e)
{ {
/*if (DtDatos != null)
{
ImprimirReporte();
}
else
{
CargaDatos();
if (DtDatos != null)
Alert("No se encontró información para el reporte.", ModExtensiones.TipoMensaje.MsgAdvertencia);
else
ImprimirReporte();
}*/
ImprimirReporte(); ImprimirReporte();
} }

View File

@@ -53,6 +53,21 @@
width: 100%; width: 100%;
height: 500px; height: 500px;
} }
#<%= GVExportaciones.ClientID %> .btn,
#<%= GVExportaciones.ClientID %> .btn-circle {
display: inline-block !important;
width: auto !important;
min-width: 0 !important;
max-width: none !important;
vertical-align: middle !important;
margin-bottom: 0 !important;
margin-right: 4px;
float: none !important;
clear: none !important;
}
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
@@ -148,11 +163,11 @@
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="upDatosExp" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="upDatosExp" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GVExportaciones" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacion" Width="100%" EmptyDataText="No se encontraron Exportaciones" ToolTip="Exportaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None"> <asp:GridView ID="GVExportaciones" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacion" Width="100%" EmptyDataText="No se encontraron Exportaciones" ToolTip="Exportaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" OnRowDataBound="GVExportaciones_RowDataBound" OnRowCreated="GVExportaciones_RowCreated">
<Columns> <Columns>
<asp:TemplateField HeaderText="Exportación" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HlExpDetalle" runat="server" Text='<%# Eval("CveExportacion") %>' NavigateUrl='<%# Eval("CveExportacion", "ExpDetalle.aspx?CveExportacion={0}") %>'>></asp:HyperLink> <asp:HyperLink ID="HlExpDetalle" runat="server" Text='<%# Eval("CveExportacion") %>'></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Fecha de Ingreso" DataFormatString="{0:d}" /> <asp:BoundField DataField="FechaIng" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Fecha de Ingreso" DataFormatString="{0:d}" />
@@ -224,14 +239,28 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"> <asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="EditarExp_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton> <span style="white-space: nowrap;">
</ItemTemplate> <asp:HyperLink
</asp:TemplateField> ID="HlEditar"
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"> runat="server"
<ItemTemplate> CssClass="btn btn-circle btn-sm green"
<asp:LinkButton ID="LnkEliminar" runat="server" OnClick="EliminarExp_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la Exportación?" data-btn-ok-label="Sí" /> Text="<i class='fa fa-pencil'></i>"
ToolTip="Editar">
</asp:HyperLink>
&nbsp;
<asp:LinkButton
ID="LnkEliminar"
runat="server"
OnClick="EliminarExp_Click"
CssClass="btn btn-circle btn-sm red"
Text="<i class='icon-trash'></i>"
data-toggle="confirmation"
data-popout="true"
data-original-title="¿Está seguro que desea eliminar la Exportación?"
data-btn-ok-label="Sí" />
</span>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>

View File

@@ -28,7 +28,7 @@ public partial class Export_RepExportaciones : ClsPaginas
private bool EsImportacion private bool EsImportacion
{ {
get{ return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); } get { return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); }
set { ViewState["EsImportacion"] = value; } set { ViewState["EsImportacion"] = value; }
} }
public string EmptyDataTextPersonalizado { get; set; } public string EmptyDataTextPersonalizado { get; set; }
@@ -43,7 +43,7 @@ public partial class Export_RepExportaciones : ClsPaginas
if (Request["Opcion"] != null) if (Request["Opcion"] != null)
{ {
if (Request["Opcion"] == "I") if (Request["Opcion"] == "I")
EsImportacion = true; EsImportacion = true;
} }
Page.Title = EsImportacion ? "Importaciones" : "Exportaciones"; Page.Title = EsImportacion ? "Importaciones" : "Exportaciones";
@@ -86,7 +86,7 @@ public partial class Export_RepExportaciones : ClsPaginas
} }
protected void CargaExportaciones() protected void CargaExportaciones()
{ {
bool EsExportacion = !EsImportacion; bool EsExportacion = !EsImportacion;
string SubProyectos = DdlSubProyecto.GetSelectedValuesM(); string SubProyectos = DdlSubProyecto.GetSelectedValuesM();
SubProyectos = SubProyectos == "" ? "-1" : SubProyectos; SubProyectos = SubProyectos == "" ? "-1" : SubProyectos;
@@ -125,4 +125,76 @@ public partial class Export_RepExportaciones : ClsPaginas
Alert("La Exportación se ha eliminado correctamente."); Alert("La Exportación se ha eliminado correctamente.");
} }
} }
}
protected void GVExportaciones_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
var dataItem = (System.Data.DataRowView)e.Row.DataItem;
int cveExportacion = Convert.ToInt32(dataItem["CveExportacion"]);
HyperLink hl = (HyperLink)e.Row.FindControl("HlExpDetalle");
// Usa la bandera EsImportacion de la página
if (EsImportacion)
hl.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}&Opcion=I";
else
hl.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}";
// EDITAR
HyperLink hlEditar = (HyperLink)e.Row.FindControl("HlEditar");
if (EsImportacion)
hlEditar.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}&Opcion=I";
else
hlEditar.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}";
// Tipo Exportación
Label lblTipoExp = (Label)e.Row.FindControl("lblTipoExp");
if (lblTipoExp != null)
{
string valor = dataItem["TipoExportacion"].ToString();
switch (valor)
{
case "1":
lblTipoExp.Text = "(IMP) Importación";
break;
case "2":
lblTipoExp.Text = "(EXP) Exportación/retorno";
break;
case "3":
lblTipoExp.Text = "(TRA) Tránsitos";
break;
default:
lblTipoExp.Text = "Desconocido";
break;
}
}
// Estatus
Label lblEstatus = (Label)e.Row.FindControl("lblEstatus");
if (lblEstatus != null)
{
string valor = dataItem["CveExportacionEstatus"].ToString();
switch (valor)
{
case "1":
lblEstatus.Text = "Tránsito";
break;
case "2":
lblEstatus.Text = "Completa";
break;
default:
lblEstatus.Text = "Desconocido";
break;
}
}
}
}
protected void GVExportaciones_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
// Cambia el texto del primer encabezado (ajusta el índice si no es la primera columna)
e.Row.Cells[0].Text = EsImportacion ? "Importación" : "Exportación";
}
}
}

View File

@@ -136,8 +136,6 @@
<asp:UpdatePanel runat="server" ID="UpBalanceGeneral" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpBalanceGeneral" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvBalanceGeneral" runat="server" AutoGenerateColumns="false" DataKeyNames="Codigo,Tipo" OnRowDataBound="GvBalanceGeneral_RowDataBound" Width="60%" <asp:GridView ID="GvBalanceGeneral" runat="server" AutoGenerateColumns="false" DataKeyNames="Codigo,Tipo" OnRowDataBound="GvBalanceGeneral_RowDataBound" Width="60%"
EmptyDataText="No se encontraron registros" EmptyDataText="No se encontraron registros"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-sort="true" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-sort="true"
@@ -278,9 +276,6 @@
<HeaderStyle CssClass="Titulos" /> <HeaderStyle CssClass="Titulos" />
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</ContentTemplate> </ContentTemplate>
@@ -457,7 +452,6 @@
<div style="white-space: nowrap"> <div style="white-space: nowrap">
<%--<asp:HyperLink ID="Hypgrafica" Visible="false" runat="server" CssClass="Texto Hypgrafica" NavigateUrl="javascript:void(0);" onclick="return HandlerGraf(this, event);"><i class="fa fa-bar-chart" aria-hidden="true"></i></asp:HyperLink>--%> <%--<asp:HyperLink ID="Hypgrafica" Visible="false" runat="server" CssClass="Texto Hypgrafica" NavigateUrl="javascript:void(0);" onclick="return HandlerGraf(this, event);"><i class="fa fa-bar-chart" aria-hidden="true"></i></asp:HyperLink>--%>
<asp:HyperLink ID="hpl2" runat="server" CssClass="Texto Hypgrafica" NavigateUrl="javascript:void(0);" > <asp:HyperLink ID="hpl2" runat="server" CssClass="Texto Hypgrafica" NavigateUrl="javascript:void(0);" >
<i class="fa fa-bar-chart" aria-hidden="true"></i></asp:HyperLink> <i class="fa fa-bar-chart" aria-hidden="true"></i></asp:HyperLink>
<asp:CheckBox ID="chkgraf" CssClass="chkgraf" runat="server" /> <asp:CheckBox ID="chkgraf" CssClass="chkgraf" runat="server" />
@@ -601,9 +595,6 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>
</ajax:TabContainer> </ajax:TabContainer>
</ContentTemplate> </ContentTemplate>
@@ -642,22 +633,11 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script>
<script>
function graficahighchartsFinan(idcontainer, titulo, subtitulo, ytitulo, datos, xtitulo, labelpoint, media, datospie1, datospie2, idChkSeleccionado) { function graficahighchartsFinan(idcontainer, titulo, subtitulo, ytitulo, datos, xtitulo, labelpoint, media, datospie1, datospie2, idChkSeleccionado) {
$('#LblTituloGrafica').text(titulo) $('#LblTituloGrafica').text(titulo)
@@ -711,15 +691,11 @@
} }
}); });
}); });
} }
console.log("serieDato:", datosSeries); console.log("serieDato:", datosSeries);
console.log("datosCategorias:", datosCategorias); console.log("datosCategorias:", datosCategorias);
Highcharts.chart(idcontainer, { Highcharts.chart(idcontainer, {
chart: { chart: {

View File

@@ -82,11 +82,8 @@ Partial Class Finanzas_RepRazonesFinancieras2
DdlEjercicio.SelectedIndex = DdlEjercicio2.SelectedIndex DdlEjercicio.SelectedIndex = DdlEjercicio2.SelectedIndex
End If End If
End If End If
'Dim EInicio As Integer = DdlEjercicio.SelectedValue.ToEntero 'Dim EInicio As Integer = DdlEjercicio.SelectedValue.ToEntero
'If EInicio > DdlEjercicio2.SelectedValue.ToEntero Then 'If EInicio > DdlEjercicio2.SelectedValue.ToEntero Then
' If DdlEjercicio2.Items.Count > 0 Then ' If DdlEjercicio2.Items.Count > 0 Then
@@ -98,83 +95,62 @@ Partial Class Finanzas_RepRazonesFinancieras2
' If Not EInicio + 1 > Fejerciosio Then ' If Not EInicio + 1 > Fejerciosio Then
' DdlEjercicio2.SelectedValueExist(EInicio + 1) ' DdlEjercicio2.SelectedValueExist(EInicio + 1)
' End If ' End If
'End If 'End If
UpFiltros.Update() UpFiltros.Update()
End Sub End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
LnkExportar.Visible = False LnkExportar.Visible = False
If UsuarioActual.CveRol = 1 Then
TabBalanceGeneral.Visible = True
TabEstadoResultados.Visible = True
End If
If Tab.ActiveTabIndex = 0 Then If Tab.ActiveTabIndex = 0 Then
CargaDatosBalanceGeneral() CargaDatosBalanceGeneral()
End If End If
If Tab.ActiveTabIndex = 1 Then If Tab.ActiveTabIndex = 1 Then
CargaDatosEstadoResultados() CargaDatosEstadoResultados()
End If End If
If Tab.ActiveTabIndex = 2 Then If Tab.ActiveTabIndex = 2 Then
CargaDatosRatios() CargaDatosRatios()
End If End If
End Sub End Sub
#Region "ESTADO BALANCE GENERAL" #Region "ESTADO BALANCE GENERAL"
Private Sub CargaDatosBalanceGeneral() Private Sub CargaDatosBalanceGeneral()
LnkExportar.Visible = False LnkExportar.Visible = False
GvBalanceGeneralOcultarColumnas(GvBalanceGeneral, 1) GvBalanceGeneralOcultarColumnas(GvBalanceGeneral, 1)
Dim CveSubProyecto = DdlSubproyecto.SelectedValue.ToEntero Dim CveSubProyecto = DdlSubproyecto.SelectedValue.ToEntero
Dim objFinanzas As New ClsFinanzas Dim objFinanzas As New ClsFinanzas
Dim dtTemp As New DataTable Dim dtTemp As New DataTable
Dim FechasConsultar As String = GetFechasConsultar() Dim FechasConsultar As String = GetFechasConsultar()
' Alert(FechasConsultar)
If objFinanzas.GetRazonesFinancierasBalanceGeneralRep(-1, CveSubProyecto, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, 1, DdlPeriodo.SelectedValue.ToEntero, FechasConsultar, DdlVista.SelectedValue.ToEntero) Then If objFinanzas.GetRazonesFinancierasBalanceGeneralRep(-1, CveSubProyecto, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, 1, DdlPeriodo.SelectedValue.ToEntero, FechasConsultar, DdlVista.SelectedValue.ToEntero) Then
dtTemp = objFinanzas.DtResultados dtTemp = objFinanzas.DtResultados
GvBalanceGeneralMostrarColumnas(dtTemp, GvBalanceGeneral) GvBalanceGeneralMostrarColumnas(dtTemp, GvBalanceGeneral)
GvBalanceGeneral.DataSource = dtTemp GvBalanceGeneral.DataSource = dtTemp
If dtTemp.Rows.Count > 0 Then If dtTemp.Rows.Count > 0 Then
' LnkExportar.Visible = True ' LnkExportar.Visible = True
End If End If
Else Else
GvBalanceGeneral.DataSource = Nothing GvBalanceGeneral.DataSource = Nothing
End If End If
objFinanzas.Dispose() objFinanzas.Dispose()
GvBalanceGeneral.DataBind() GvBalanceGeneral.DataBind()
UpBalanceGeneral.Update() UpBalanceGeneral.Update()
End Sub End Sub
Private Sub GvBalanceGeneralOcultarColumnas(ByRef Gv As GridView, Optional index As Integer = 2) Private Sub GvBalanceGeneralOcultarColumnas(ByRef Gv As GridView, Optional index As Integer = 2)
For index = 2 To Gv.Columns.Count - 1 For index = 2 To Gv.Columns.Count - 1
@@ -187,7 +163,6 @@ Partial Class Finanzas_RepRazonesFinancieras2
Private Sub GvBalanceGeneralMostrarColumnas(dt As DataTable, ByRef Gv As GridView) Private Sub GvBalanceGeneralMostrarColumnas(dt As DataTable, ByRef Gv As GridView)
Dim index = 1 Dim index = 1
For index = 1 To dt.Columns.Count - 5 For index = 1 To dt.Columns.Count - 5
CType(Gv.Columns(index + 4), BoundField).DataField = dt.Columns(index + 4).ColumnName CType(Gv.Columns(index + 4), BoundField).DataField = dt.Columns(index + 4).ColumnName
Gv.Columns(index + 4).Visible = True Gv.Columns(index + 4).Visible = True
@@ -216,35 +191,17 @@ Partial Class Finanzas_RepRazonesFinancieras2
e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid") e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid")
e.Row.Cells(0).Text = "" e.Row.Cells(0).Text = ""
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "ESTADO RESULTADOS" #Region "ESTADO RESULTADOS"
Private Sub CargaDatosEstadoResultados() Private Sub CargaDatosEstadoResultados()
LnkExportar.Visible = False LnkExportar.Visible = False
GVEstadoRsultadosOcultarColumnas(GVEstadoRsultados, 1) GVEstadoRsultadosOcultarColumnas(GVEstadoRsultados, 1)
Dim CveSubProyecto = DdlSubproyecto.SelectedValue.ToEntero Dim CveSubProyecto = DdlSubproyecto.SelectedValue.ToEntero
Dim objFinanzas As New ClsFinanzas Dim objFinanzas As New ClsFinanzas
Dim dtTemp As New DataTable Dim dtTemp As New DataTable
@@ -255,18 +212,14 @@ Partial Class Finanzas_RepRazonesFinancieras2
GVEstadoRsultadosMostrarColumnas(dtTemp, GVEstadoRsultados) GVEstadoRsultadosMostrarColumnas(dtTemp, GVEstadoRsultados)
GVEstadoRsultados.DataSource = dtTemp GVEstadoRsultados.DataSource = dtTemp
If dtTemp.Rows.Count > 0 Then If dtTemp.Rows.Count > 0 Then
' LnkExportar.Visible = True ' LnkExportar.Visible = True
End If End If
Else Else
GVEstadoRsultados.DataSource = Nothing GVEstadoRsultados.DataSource = Nothing
End If End If
objFinanzas.Dispose() objFinanzas.Dispose()
GVEstadoRsultados.DataBind() GVEstadoRsultados.DataBind()
UpEstadoResultados.Update() UpEstadoResultados.Update()
End Sub End Sub
@@ -315,34 +268,19 @@ Partial Class Finanzas_RepRazonesFinancieras2
e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid") e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid")
e.Row.Cells(0).Text = "" e.Row.Cells(0).Text = ""
End If End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "RATIOS" #Region "RATIOS"
Private Sub CargaDatosRatios() Private Sub CargaDatosRatios()
DTRatios = New DataTable DTRatios = New DataTable
LnkExportar.Visible = False LnkExportar.Visible = False
GVRatiosOcultarColumnas(GVRatios, 1) GVRatiosOcultarColumnas(GVRatios, 1)
Dim CveSubProyecto = DdlSubproyecto.SelectedValue.ToEntero Dim CveSubProyecto = DdlSubproyecto.SelectedValue.ToEntero
Dim FechasConsultar As String = GetFechasConsultar() Dim FechasConsultar As String = GetFechasConsultar()
Dim objFinanzas As New ClsFinanzas Dim objFinanzas As New ClsFinanzas
If objFinanzas.GetRazonesFinancierasRatiosRep(-1, CveSubProyecto, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, 1, DdlPeriodo.SelectedValue.ToEntero, FechasConsultar, DdlVista.SelectedValue.ToEntero) Then If objFinanzas.GetRazonesFinancierasRatiosRep(-1, CveSubProyecto, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, 1, DdlPeriodo.SelectedValue.ToEntero, FechasConsultar, DdlVista.SelectedValue.ToEntero) Then
@@ -377,26 +315,18 @@ Partial Class Finanzas_RepRazonesFinancieras2
Private Sub GVRatiosMostrarColumnas(dt As DataTable, ByRef Gv As GridView) Private Sub GVRatiosMostrarColumnas(dt As DataTable, ByRef Gv As GridView)
For index = 4 To dt.Columns.Count - 2 For index = 4 To dt.Columns.Count - 2
CType(Gv.Columns(index + 1), BoundField).DataField = dt.Columns(index + 1).ColumnName CType(Gv.Columns(index + 1), BoundField).DataField = dt.Columns(index + 1).ColumnName
Gv.Columns(index + 1).Visible = True Gv.Columns(index + 1).Visible = True
CType(Gv.Columns(index + 1), BoundField).HeaderText = dt.Columns(index + 1).ColumnName CType(Gv.Columns(index + 1), BoundField).HeaderText = dt.Columns(index + 1).ColumnName
Next Next
End Sub End Sub
Protected Sub GVRatios_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GVRatios_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
For x = 1 To DTRatios.Columns.Count For x = 1 To DTRatios.Columns.Count
If e.Row.DataKey("Ratio") = "INCREMENTO DE VENTAS" Then If e.Row.DataKey("Ratio") = "INCREMENTO DE VENTAS" Then
@@ -492,11 +422,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
e.Row.FCHyperLink("hpl2").Visible = False e.Row.FCHyperLink("hpl2").Visible = False
e.Row.FCCheckBox("chkgraf").Visible = False e.Row.FCCheckBox("chkgraf").Visible = False
End If End If
'AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}','{6}',[{8}],[{7}]);", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia, Promedio, "", "") 'AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}','{6}',[{8}],[{7}]);", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia, Promedio, "", "")
End If End If
If e.Row.RowType = DataControlRowType.Header Then If e.Row.RowType = DataControlRowType.Header Then
@@ -543,8 +469,6 @@ Partial Class Finanzas_RepRazonesFinancieras2
#End Region #End Region
#Region "DESCARGA EXCEL" #Region "DESCARGA EXCEL"
@@ -590,11 +514,8 @@ Partial Class Finanzas_RepRazonesFinancieras2
#End Region #End Region
Protected Sub DdlVista_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlVista_SelectedIndexChanged(sender As Object, e As EventArgs)
LblPeriodo.Visible = False LblPeriodo.Visible = False
DivPeriodo.Visible = False DivPeriodo.Visible = False
DdlPeriodo.SelectedValueExist(12) DdlPeriodo.SelectedValueExist(12)
@@ -657,7 +578,6 @@ Partial Class Finanzas_RepRazonesFinancieras2
End Sub End Sub
Private Sub CargaMeses() Private Sub CargaMeses()
Dim Count As Integer = 0 Dim Count As Integer = 0
@@ -677,7 +597,6 @@ Partial Class Finanzas_RepRazonesFinancieras2
DdlEjercicio.Items.Add(New ListItem($"Noviembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-11")) DdlEjercicio.Items.Add(New ListItem($"Noviembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-11"))
DdlEjercicio.Items.Add(New ListItem($"Diciembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-12")) DdlEjercicio.Items.Add(New ListItem($"Diciembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-12"))
DdlEjercicio2.Items.Add(New ListItem($"Enero {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-01")) DdlEjercicio2.Items.Add(New ListItem($"Enero {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-01"))
DdlEjercicio2.Items.Add(New ListItem($"Febrero {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-02")) DdlEjercicio2.Items.Add(New ListItem($"Febrero {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-02"))
DdlEjercicio2.Items.Add(New ListItem($"Marzo {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-03")) DdlEjercicio2.Items.Add(New ListItem($"Marzo {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-03"))
@@ -690,18 +609,13 @@ Partial Class Finanzas_RepRazonesFinancieras2
DdlEjercicio2.Items.Add(New ListItem($"Octubre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-10")) DdlEjercicio2.Items.Add(New ListItem($"Octubre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-10"))
DdlEjercicio2.Items.Add(New ListItem($"Noviembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-11")) DdlEjercicio2.Items.Add(New ListItem($"Noviembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-11"))
DdlEjercicio2.Items.Add(New ListItem($"Diciembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-12")) DdlEjercicio2.Items.Add(New ListItem($"Diciembre {dRow("Ejercicio").ToString}", $"{dRow("Ejercicio").ToString}-12"))
Count = Count + 1 Count = Count + 1
Next Next
If Count > 0 Then If Count > 0 Then
DdlEjercicio.SelectedIndex = 0 DdlEjercicio.SelectedIndex = 0
DdlEjercicio2.SelectedIndex = 0 DdlEjercicio2.SelectedIndex = 0
End If End If
End Sub End Sub
@@ -717,8 +631,6 @@ Partial Class Finanzas_RepRazonesFinancieras2
ListaFechas.Add($"{x}-12-31") ListaFechas.Add($"{x}-12-31")
Next x Next x
End If End If
Else ' POR MESES Else ' POR MESES
If DdlVisualizacion.SelectedValue.ToEntero = 1 Then If DdlVisualizacion.SelectedValue.ToEntero = 1 Then
@@ -728,32 +640,20 @@ Partial Class Finanzas_RepRazonesFinancieras2
Dim FechaInicial As Date = $"{DdlEjercicio.SelectedValue}-01".ToDate.LastDayOfMonth.ToString("yyyy-MM-dd").ToDate Dim FechaInicial As Date = $"{DdlEjercicio.SelectedValue}-01".ToDate.LastDayOfMonth.ToString("yyyy-MM-dd").ToDate
Dim FechaFinal As Date = $"{DdlEjercicio2.SelectedValue}-01".ToDate.LastDayOfMonth.ToString("yyyy-MM-dd").ToDate Dim FechaFinal As Date = $"{DdlEjercicio2.SelectedValue}-01".ToDate.LastDayOfMonth.ToString("yyyy-MM-dd").ToDate
Dim FechaTemp As Date = FechaInicial.LastDayOfMonth Dim FechaTemp As Date = FechaInicial.LastDayOfMonth
ListaFechas.Add(FechaTemp.ToString("yyyy-MM-dd")) ListaFechas.Add(FechaTemp.ToString("yyyy-MM-dd"))
While FechaFinal >= FechaTemp While FechaFinal >= FechaTemp
FechaTemp = FechaTemp.AddMonths(1).LastDayOfMonth FechaTemp = FechaTemp.AddMonths(1).LastDayOfMonth
If FechaFinal >= FechaTemp Then If FechaFinal >= FechaTemp Then
ListaFechas.Add(FechaTemp.ToString("yyyy-MM-dd")) ListaFechas.Add(FechaTemp.ToString("yyyy-MM-dd"))
End If End If
End While End While
End If End If
End If End If
Return String.Join(",", ListaFechas) Return String.Join(",", ListaFechas)
End Function End Function
End Class End Class

View File

@@ -141,112 +141,112 @@ Partial Class Inicio
If UsuarioActual.TienePermisoProceso(270) Then MuestraComprasPUE() If UsuarioActual.TienePermisoProceso(270) Then MuestraComprasPUE()
If UsuarioActual.TienePermisoProceso(343) Then MuestraPsProximosAVencer() If UsuarioActual.TienePermisoProceso(343) Then MuestraPsProximosAVencer()
If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer() If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer()
MuestraAniversarioLaboral() If UsuarioActual.CveRol = 1 Then MuestraAniversarioLaboral()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso
(UsuarioActual.CveUsuario.Contiene(3964, 3984, 4165, 3960) OrElse UsuarioActual.CveRol.Contiene(1639, 1577, 1578, 1582)) Then (UsuarioActual.CveUsuario.Contiene(3964, 3984, 4165, 3960, 4527) OrElse UsuarioActual.CveRol.Contiene(1639, 1577, 1578, 1582)) Then
',4527-pamela
divsms1.Visible = True
txtFechaInicioSMS.Text = Now.FirstDayOfMonth.ToString
txtFechaFinSMS.Text = Now.LastDayOfMonth.ToString
If UsuarioActual.CveUsuario.Contiene(3964, 4165, 3960, 4527) Then 'diego de la concha
DdlSMSOpciones.SelectedValue = "2"
DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 ")
DdlSMSVendedores.DataBind()
DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582")
DdlSMSTecnico.DataBind()
End If
If UsuarioActual.CveRol.Contiene(1639) Then 'gerente ventas
DdlSMSOpciones.SelectedValue = "2"
DdlSMSOpciones.Items.RemoveAt(4)
DdlSMSOpciones.Items.RemoveAt(3)
DdlSMSOpciones.Items.RemoveAt(2)
Dim CveGerenteVendedor As Integer = -1
If UsuarioActual.CveUsuario = 4419 Then CveGerenteVendedor = 1386 '; --' daniela
If UsuarioActual.CveUsuario = 4137 Then CveGerenteVendedor = 1172 '; --'jesus alvarez
divsms1.Visible = True DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 and CveSuperior = {CveGerenteVendedor} ")
txtFechaInicioSMS.Text = Now.FirstDayOfMonth.ToString DdlSMSVendedores.DataBind()
txtFechaFinSMS.Text = Now.LastDayOfMonth.ToString DdlSMSTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
If UsuarioActual.CveUsuario.Contiene(3964, 4165, 3960) Then 'diego de la concha End If
DdlSMSOpciones.SelectedValue = "2" If UsuarioActual.CveRol = 1577 Then 'vendedores
DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 ") DdlSMSOpciones.SelectedValue = "1"
DdlSMSVendedores.DataBind() DdlSMSVendedores.Items.Add(New ListItem(UsuarioActual.Nombre, UsuarioActual.CveVendedor.ToString))
DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582") DdlSMSVendedores.SelectedValue = UsuarioActual.CveVendedor.ToString
DdlSMSTecnico.DataBind() DdlSMSVendedores.Enabled = False
End If DdlSMSOpciones.Enabled = False
If UsuarioActual.CveRol.Contiene(1639) Then 'gerente ventas End If
DdlSMSOpciones.SelectedValue = "2" If UsuarioActual.CveRol = 1578 Then 'almacenista
DdlSMSOpciones.Items.RemoveAt(4) DdlSMSOpciones.SelectedValue = "3"
DdlSMSOpciones.Items.RemoveAt(3) DdlSMSOpciones.Enabled = False
DdlSMSOpciones.Items.RemoveAt(2) End If
Dim CveGerenteVendedor As Integer = -1 If UsuarioActual.CveUsuario = 3984 Then 'Erick, modalidad de gerente de técnicos
If UsuarioActual.CveUsuario = 4419 Then CveGerenteVendedor = 1386 '; --' daniela DdlSMSOpciones.SelectedValue = "5"
If UsuarioActual.CveUsuario = 4137 Then CveGerenteVendedor = 1172 '; --'jesus alvarez DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582")
DdlSMSTecnico.DataBind()
DdlSMSOpciones.Items.RemoveAt(2) : DdlSMSOpciones.Items.RemoveAt(1) : DdlSMSOpciones.Items.RemoveAt(0)
DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveEstatus=1 and CveSuperior = {CveGerenteVendedor} ") ElseIf UsuarioActual.CveRol = 1582 Then 'tecnicos
DdlSMSVendedores.DataBind() DdlSMSOpciones.SelectedValue = "4"
DdlSMSTecnico.Items.Insert(0, New ListItem("Todos", "-1")) DdlSMSOpciones.Enabled = False
End If DdlSMSTecnico.Items.Add(New ListItem(UsuarioActual.Nombre, UsuarioActual.CveUsuario.ToString))
If UsuarioActual.CveRol = 1577 Then 'vendedores DdlSMSTecnico.SelectedValue = UsuarioActual.CveUsuario.ToString
DdlSMSOpciones.SelectedValue = "1" DdlSMSTecnico.Enabled = False
DdlSMSVendedores.Items.Add(New ListItem(UsuarioActual.Nombre, UsuarioActual.CveVendedor.ToString)) End If
DdlSMSVendedores.SelectedValue = UsuarioActual.CveVendedor.ToString
DdlSMSVendedores.Enabled = False CargaSMSKPI()
DdlSMSOpciones.Enabled = False
End If
If UsuarioActual.CveRol = 1578 Then 'almacenista
DdlSMSOpciones.SelectedValue = "3"
DdlSMSOpciones.Enabled = False
End If
If UsuarioActual.CveUsuario = 3984 Then 'Erick, modalidad de gerente de técnicos
DdlSMSOpciones.SelectedValue = "5"
DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582")
DdlSMSTecnico.DataBind()
DdlSMSOpciones.Items.RemoveAt(2) : DdlSMSOpciones.Items.RemoveAt(1) : DdlSMSOpciones.Items.RemoveAt(0)
ElseIf UsuarioActual.CveRol = 1582 Then 'tecnicos
DdlSMSOpciones.SelectedValue = "4"
DdlSMSOpciones.Enabled = False
DdlSMSTecnico.Items.Add(New ListItem(UsuarioActual.Nombre, UsuarioActual.CveUsuario.ToString))
DdlSMSTecnico.SelectedValue = UsuarioActual.CveUsuario.ToString
DdlSMSTecnico.Enabled = False
End If End If
CargaSMSKPI() If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then
CargaGraficas()
End If
CargaTareas()
If UsuarioActual.CveRol = 1 Then
divInd.Visible = True
CargaSubProyectos()
End If
'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD
InicializaCalendar()
If UsuarioActual.CveEmpresa = 72 Then
DivDirectorioTelefonico.Visible = True
CargaDirectorioTelefonico()
Else
DivDirectorioTelefonico.Visible = False
End If
'CARGA COMUNICADO
If UsuarioActual.TienePermisoProceso(224) Then
LnkAgregar.Visible = True
End If
CargaComunicado()
'Evaluacion del proveedor
CargaEvaluacionProveedor()
CargaDocumentacion()
If UsuarioActual.CveRol = 1 Or UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100, 1918) Then
LnkInconsistencias.Visible = True
End If
IniializaDdlsOpcionesAgenda()
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
DVTareas.Visible = True
End If
End If End If
If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then
CargaGraficas()
End If
CargaTareas()
If UsuarioActual.CveRol = 1 Then
divInd.Visible = True
CargaSubProyectos()
End If
'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD
InicializaCalendar()
If UsuarioActual.CveEmpresa = 72 Then
DivDirectorioTelefonico.Visible = True
CargaDirectorioTelefonico()
Else
DivDirectorioTelefonico.Visible = False
End If
'CARGA COMUNICADO
If UsuarioActual.TienePermisoProceso(224) Then
LnkAgregar.Visible = True
End If
CargaComunicado()
'Evaluacion del proveedor
CargaEvaluacionProveedor()
CargaDocumentacion()
If UsuarioActual.CveRol = 1 Or UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100, 1918) Then
LnkInconsistencias.Visible = True
End If
IniializaDdlsOpcionesAgenda()
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
DVTareas.Visible = True
End If
End If
End Sub End Sub
Public Function GetFacturasCanceladasPendientesWS(objventas As ClsVentas, RFC As String, CveEmpresa As Integer, Optional showalert As Boolean = True) As Boolean Public Function GetFacturasCanceladasPendientesWS(objventas As ClsVentas, RFC As String, CveEmpresa As Integer, Optional showalert As Boolean = True) As Boolean

View File

@@ -139,48 +139,51 @@
left: 120px; left: 120px;
} }
*/ */
/*Begin ScrollADS V2*/
.divContainerads { /*Begin ScrollADS V2*/
width: 100%;
max-height: calc(100vh - 260px);
overflow-y: auto;
}
table.adssigscroll {
min-width: 100%;
background-color: #fff;
}
table.adssigscroll tbody, table.adssigscroll thead {
background-color: #fff;
}
table.adssigscroll tr { .divContainerads {
background-color: inherit; width: 100%;
} max-height: calc(100vh - 260px);
overflow-y: auto;
table.adssigscroll tr.stickyRow {
position: sticky;
top: 0; /* Se mantiene pegado en la parte superior */
background-color: inherit; /* Para que no se superponga con otros elementos */
z-index: 4; /* Asegura que esté sobre otros elementos */
} }
.adssigrid-order tr > th::after {
content: "\f0dc";
font:normal normal normal 14px / 1 FontAwesome;
display: inline-block;
margin-left: 5px;
color: #32A1CF;
}
.adssigrid-order tr > th.asce::after {
content: "\f0de";
}
.adssigrid-order tr > th.desc::after { table.adssigscroll {
content: "\f0dd"; min-width: 100%;
} background-color: #fff;
}
table.adssigscroll tbody, table.adssigscroll thead {
background-color: #fff;
}
table.adssigscroll tr {
background-color: inherit;
}
table.adssigscroll tr.stickyRow {
position: sticky;
top: 0; /* Se mantiene pegado en la parte superior */
background-color: inherit; /* Para que no se superponga con otros elementos */
z-index: 4; /* Asegura que esté sobre otros elementos */
}
.adssigrid-order tr > th::after {
content: "\f0dc";
font: normal normal normal 14px / 1 FontAwesome;
display: inline-block;
margin-left: 5px;
color: #32A1CF;
}
.adssigrid-order tr > th.asce::after {
content: "\f0de";
}
.adssigrid-order tr > th.desc::after {
content: "\f0dd";
}
/*END ScrollADS V2*/ /*END ScrollADS V2*/
</style> </style>
</asp:Content> </asp:Content>
@@ -221,17 +224,25 @@ table.adssigscroll {
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" /> <asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div> </div>
<div class="titlefiltros titlefiltrosmedia caption "> <div class="titlefiltros titlefiltrosmedia caption ">
<div class="row" style="padding-top: 10px; position: relative;"> <div class="row" style="display: flex; align-items: center;">
<div class="col-md-1 truncate textfilter">Proveedor</div> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div style="width: 100px;">Proveedor</div>
<ADS:Dropdownlost ID="DdlProveedor" runat="server" DataValueField="CveProveedor" DataTextField="RazonSocial" Width="100%" CssClassDdl="select2me" CssStyle="width: 100%;"></ADS:Dropdownlost> <ADS:Dropdownlost ID="DdlProveedor" runat="server" DataValueField="CveProveedor" DataTextField="RazonSocial" Width="100%" CssClassDdl="select2me" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div> </div>
<label class="col-md-1 truncate textfilter2">Producto:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div style="width: 100px;">Producto</div>
<ADS:Dropdownlost ID="ddlProducto2" runat="server" AutoPostBack="False" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" Width="100%" CssStyle="width: 100%; "></ADS:Dropdownlost> <ADS:Dropdownlost ID="ddlProducto2" runat="server" AutoPostBack="False" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" Width="100%" CssStyle="width: 100%; "></ADS:Dropdownlost>
</div> </div>
<label class="col-md-1 textfilter">Fecha Fin:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-1" style="min-width: 110px;"> <div style="width: 100px;">Existencia</div>
<asp:DropDownList ID="DdlExistencia" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
<asp:ListItem Text="Con existencia" Value="2" />
<asp:ListItem Text="Sin existencia" Value="3" />
<asp:ListItem Text="Todos" Value="4" />
</asp:DropDownList>
</div>
<div class="col-md-2" style="display: flex; align-items: center;">
<div style="width: 100px;">Fecha Fin</div>
<div style="display: inline-block; vertical-align: text-bottom;"> <div style="display: inline-block; vertical-align: text-bottom;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 80px" MaxLength="10"></asp:TextBox> <asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 80px" MaxLength="10"></asp:TextBox>
@@ -243,15 +254,8 @@ table.adssigscroll {
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div> </div>
</div> </div>
<label class="col-md-1 truncate">Producto:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-1"> <div style="width: 100px;">Ver por</div>
<asp:DropDownList ID="DdlExistencia" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
<asp:ListItem Text="Con existencia" Value="2" />
<asp:ListItem Text="Sin existencia" Value="3" />
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Ver por:</label>
<div class="col-md-1">
<asp:DropDownList ID="Ddlgrupo" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;"> <asp:DropDownList ID="Ddlgrupo" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
<asp:ListItem Text="Almacenes" Value="1" /> <asp:ListItem Text="Almacenes" Value="1" />
<asp:ListItem Text="Sucursales" Value="2" /> <asp:ListItem Text="Sucursales" Value="2" />
@@ -261,51 +265,60 @@ table.adssigscroll {
</div> </div>
</div> </div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>> <div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row"> <div class="row" style="display: flex; align-items: center;">
<label class="col-md-1 truncate">Clasificación:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div style="width: 100px;">Clasificación</div>
<asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"> <asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
<asp:ListItem Selected="True" Text=" Todas" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text=" Todas" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Unidad Medida:</label>
<div class="col-md-1"> <div class="col-md-2" style="display: none; align-items: center;">
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 100px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida"> <div style="width: 100px;" class="truncate text" title="Unidad de medida">Unidad de medida</div>
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 100% !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Almacén:</label>
<div class="col-md-2"> <div class="col-md-2" style="display: flex; align-items: center;">
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" <div style="width: 100px;" class="truncate text" title="Tipo Almacen">Tipo Almacen</div>
DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox> <asp:DropDownList ID="DdlTipoAlmacen" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
<%--<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me " Style="width: 200px !important;" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>--%>
</div>
<label class="col-md-1 truncate">Tipo Almacen:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTipoAlmacen" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Tránsito?:</label>
<div class="col-md-1"> <div class="col-md-1" style="display: flex; align-items: center;">
<div style="width: 100px;" class="truncate text" title="Incluir Proyectados">Incluir Proyectados</div>
<asp:DropDownList ID="DdlProyeccionFiltro" runat="server" CssClass="select2me" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Text="Todos (Entradas/Salidas)" Value="3" />
<asp:ListItem Text="Entradas" Value="1" />
<asp:ListItem Text="Salidas" Value="2" />
<asp:ListItem Text="No" Value="0" Selected="True" />
</asp:DropDownList>
</div>
<div class="col-md-1" style="display: flex; align-items: center;">
<div style="width: 100px;">Tránsito?</div>
<asp:DropDownList ID="DdlIncluyeTransitorios" CssClass="select2me" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"> <asp:DropDownList ID="DdlIncluyeTransitorios" CssClass="select2me" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Text="No" Value="0" Selected="True"></asp:ListItem> <asp:ListItem Text="No" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="Si (Origen)" Value="1"></asp:ListItem> <asp:ListItem Text="Si (Origen)" Value="1"></asp:ListItem>
<asp:ListItem Text="Si (Destino)" Value="2"></asp:ListItem> <asp:ListItem Text="Si (Destino)" Value="2"></asp:ListItem>
<asp:ListItem Text="Separado(Destino)" Value="3" /> <asp:ListItem Text="Separado(Destino)" Value="3" />
</asp:DropDownList> </asp:DropDownList>
<%--<asp:CheckBox ID="ChkIncluyeTransitorios" runat="server" Checked="false" />--%> </div>
<div class="col-md-4" style="display: flex; align-items: center;">
<div style="width: 120px;margin-left: -10px;">Almacén</div>
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100% !important;" runat="server"
DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
</div> </div>
</div> </div>
<asp:Panel ID="pnlOrden" runat="server" CssClass="row"> <asp:Panel ID="pnlOrden" runat="server" CssClass="row">
<div class="col-md-2" style="display: flex; align-items: center;">
<asp:Label runat="server" ID="Label3" Text="Producto:" class="col-md-1 truncate" /> <div style="width: 100px;" class="truncate text" title="Producto">Producto</div>
<div class="col-md-2"> <asp:TextBox runat="server" ID="TxtPS" CssClass="form-control" Height="30px" Width="100%"></asp:TextBox>
<asp:TextBox runat="server" ID="TxtPS" CssClass="form-control" Height="30px"></asp:TextBox>
</div> </div>
<asp:Label runat="server" ID="LblOrden" class="col-md-1 truncate">Orden:</asp:Label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div runat="server" id="LblOrden" class="col-md-1 truncate">Orden</div>
<asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%"> <asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" /> <asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
<asp:ListItem Text="Marca,Modelo,Rin,Medida de Barrenación" Value="1" /> <asp:ListItem Text="Marca,Modelo,Rin,Medida de Barrenación" Value="1" />
@@ -314,32 +327,16 @@ table.adssigscroll {
<asp:ListItem Text="Rin,Medida de Barrenación" Value="4" /> <asp:ListItem Text="Rin,Medida de Barrenación" Value="4" />
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-3">
<div class="row"> <div class="col-md-3" style="display: flex; align-items: center;">
<asp:Label runat="server" ID="LblMarca" class="col-md-3 truncate">Marca:</asp:Label> <div runat="server" id="LblMarca" class="truncate text">Marca</div>
<div class="col-md-9"> <asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height: 50px !important;">
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height: 50px !important;"> <asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem> </asp:ListBox>
</asp:ListBox>
</div>
</div>
</div>
<asp:Label runat="server" ID="LblProyectado" Text="Incluir Proyectados" class="col-md-1 truncate" />
<div class="col-md-2">
<asp:DropDownList ID="DdlProyeccionFiltro" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Todos (Entradas/Salidas)" Value="3" />
<asp:ListItem Text="Entradas" Value="1" />
<asp:ListItem Text="Salidas" Value="2" />
<asp:ListItem Text="No" Value="0" Selected="True" />
</asp:DropDownList>
</div> </div>
</asp:Panel> </asp:Panel>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -352,8 +349,8 @@ table.adssigscroll {
<ContentTemplate> <ContentTemplate>
<div class="divContainerads"> <div class="divContainerads">
<asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True" ShowHeaderWhenEmpty="true" <asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True" ShowHeaderWhenEmpty="true"
DataKeyNames="CvePS" CssClass="adssigrid-scroll adssigrid-order table table-striped table-advance table-hover " data-cols="2" data-rows="2" data-heightmenos="300" GridLines="None" > DataKeyNames="CvePS" CssClass="adssigrid-scroll adssigrid-order table table-striped table-advance table-hover " data-cols="2" data-rows="2" data-heightmenos="300" GridLines="None">
<Columns> <Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="120px"> <asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="120px">
<HeaderTemplate> <HeaderTemplate>

View File

@@ -184,7 +184,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
dt = ObjMovimientos.DtResultados dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn) Dim ListaBorrar As New List(Of DataColumn)
If Not TienePermisoImportes AndAlso DdlExistencia.SelectedValue.ToEntero = 2 Then If Not TienePermisoImportes AndAlso DdlExistencia.SelectedValue.ToEntero().Contiene(2, 4) Then
dt.Columns.RemoveAt(dt.Columns.Count - 2) 'CP-quito columna de importe total dt.Columns.RemoveAt(dt.Columns.Count - 2) 'CP-quito columna de importe total
dt.Columns.RemoveAt(dt.Columns.Count - 2) 'Valor-quito columna de importe total dt.Columns.RemoveAt(dt.Columns.Count - 2) 'Valor-quito columna de importe total
End If End If
@@ -247,17 +247,21 @@ Partial Class Inventarios_KardexAlmacenHorizontal
'Dim Liga As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={e.Row.DataKey("CveAlmacen")}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}") 'Dim Liga As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={e.Row.DataKey("CveAlmacen")}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}")
'e.Row.FCHyperLink("HplAlmacen").NavigateUrl = Liga 'e.Row.FCHyperLink("HplAlmacen").NavigateUrl = Liga
If e.Row.RowIndex = 0 Then If e.Row.RowIndex = 0 AndAlso DdlExistencia.SelectedValue.ToEntero().Contiene(2, 4) Then
e.Row.CssClass = "Totales" e.Row.CssClass = "Totales"
End If End If
'e.Row.Attributes.Add("style", " max-height:31px!important") 'e.Row.Attributes.Add("style", " max-height:31px!important")
e.Row.HorizontalAlign = HorizontalAlign.Right If DdlExistencia.SelectedValue.ToEntero = 3 Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left e.Row.HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left Else
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left e.Row.HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
End If
Dim Index As Integer = 0 Dim Index As Integer = 0
For Each Cells As TableCell In e.Row.Cells For Each Cells As TableCell In e.Row.Cells
@@ -315,17 +319,15 @@ Partial Class Inventarios_KardexAlmacenHorizontal
'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui). 'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui).
' e.Row.Cells(0).Width = New Unit("200px") ' e.Row.Cells(0).Width = New Unit("200px")
If DdlExistencia.SelectedValue.ToEntero.Contiene(2, 3, 4) Then
If DdlExistencia.SelectedValue.ToEntero = 2 Then
Try Try
If DdlExistencia.SelectedValue.ToEntero = 3 Then
e.Row.Cells(1).Visible = False
End If
e.Row.Cells(2).Visible = False e.Row.Cells(2).Visible = False
e.Row.Cells(3).Visible = False e.Row.Cells(3).Visible = False
Catch ex As Exception Catch ex As Exception
End Try End Try
Else
e.Row.Cells(0).Visible = False
End If End If
If e.Row.RowType = DataControlRowType.Header Then If e.Row.RowType = DataControlRowType.Header Then
@@ -334,7 +336,6 @@ Partial Class Inventarios_KardexAlmacenHorizontal
End Sub End Sub
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Imprimir("Excel") Imprimir("Excel")
End Sub End Sub
Private Sub Imprimir(Optional reporte As String = "PDF") Private Sub Imprimir(Optional reporte As String = "PDF")

View File

@@ -15,7 +15,6 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content> </asp:Content>
@@ -32,7 +31,7 @@
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<div class="row" style="margin-left: 10px;"> <div class="row" style="margin-left: 10px;">
<asp:label class="col-md-1 " id="LblDdlSucursal" runat="server" style="width: 90px; margin-top: 5px;">Sucursal:</asp:label> <asp:Label class="col-md-1 " ID="LblDdlSucursal" runat="server" Style="width: 90px; margin-top: 5px;">Sucursal:</asp:Label>
<div class="col-md-2" id="DivDdlSucursal" runat="server"> <div class="col-md-2" id="DivDdlSucursal" runat="server">
<asp:DropDownList ID="DdlSucursales" runat="server" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me"> <asp:DropDownList ID="DdlSucursales" runat="server" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me">
</asp:DropDownList> </asp:DropDownList>
@@ -43,63 +42,61 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 " style="width: 90px;">Fecha Inicial:</label> <label class="col-md-1 " style="width: 90px;">Fecha Inicial:</label>
<div class="col-md-1" style="min-width: 115px"> <div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="80px" MaxLength="10"></asp:TextBox> <asp:TextBox ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="80px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn "> <span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton> <asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span> </span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 " style="width: 80px;">Fecha Final:</label> <label class="col-md-1 " style="width: 80px;">Fecha Final:</label>
<div class="col-md-1" style="min-width: 115px"> <div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="80px" MaxLength="10"></asp:TextBox> <asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="80px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn "> <span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton> <asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span> </span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="TxtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="TxtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="portlet-body" style="display: none;"> <div class="portlet-body" style="display: none;">
<div class="row"> <div class="row">
<label class="col-md-1 " id="Label1" runat="server" >Chofer:</label> <label class="col-md-1 " id="Label1" runat="server">Chofer:</label>
<div class="col-md-2" > <div class="col-md-2">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="Chofer" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true"></asp:DropDownList> <asp:DropDownList ID="DdlChofer" runat="server" DataTextField="Chofer" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true"></asp:DropDownList>
</div> </div>
<label class="col-md-1 " id="LblTipo" runat="server">Tipo:</label> <label class="col-md-1 " id="LblTipo" runat="server">Tipo:</label>
<div class="col-md-2" > <div class="col-md-2">
<asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true"> <asp:DropDownList ID="DdlTipo" runat="server" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true">
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem> <asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
<asp:ListItem Value="T" Text="Traspasos"></asp:ListItem> <asp:ListItem Value="T" Text="Traspasos"></asp:ListItem>
<asp:ListItem Value="R" Text="Recolecciones"></asp:ListItem> <asp:ListItem Value="R" Text="Recolecciones"></asp:ListItem>
<asp:ListItem Value="E" Text="Entregas"></asp:ListItem> <asp:ListItem Value="E" Text="Entregas"></asp:ListItem>
<asp:ListItem Value="I" Text="Ingresos"></asp:ListItem> <asp:ListItem Value="I" Text="Ingresos"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -109,75 +106,68 @@
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:GridView ID="GVDatos" runat="server" <asp:GridView ID="GVDatos" runat="server"
DataKeyNames="CveSubProyecto, CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen,Tipo,AplicaCP,RFCReceptor,RFCEmisor,CveTimbre,CvePAC,FolioFiscal,TimbreTipoDocto,CveMovimiento,FechaLlegada,CveCamionRemolque1,CveCamionRemolque2,Distancia,CveConfigAutoTransporte,SerieFolio,DireccionOrigen,Direccion" DataKeyNames="CveSubProyecto, CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen,Tipo,AplicaCP,RFCReceptor,RFCEmisor,CveTimbre,CvePAC,FolioFiscal,TimbreTipoDocto,CveMovimiento,FechaLlegada,CveCamionRemolque1,CveCamionRemolque2,Distancia,CveConfigAutoTransporte,SerieFolio,DireccionOrigen,Direccion,FolioReferencia"
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound"> EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
<Columns> <Columns>
<asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Tipo"> <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Tipo">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LtTipo" runat="server" Text='<%# Eval("TipoDescripcion") %>'></asp:Label> <asp:Label ID="LtTipo" runat="server" Text='<%# Eval("TipoDescripcion") %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
<HeaderStyle HorizontalAlign="Left" /> <HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="CP"> <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="CP">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtCP" runat="server" Text='<%# Eval("AplicaCP").ToString()=="True"?"Si":"No" %>'></asp:Literal> <asp:Literal ID="LtCP" runat="server" Text='<%# Eval("AplicaCP").ToString()=="True"?"Si":"No" %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<HeaderStyle HorizontalAlign="Left" /> <HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal"> <asp:BoundField DataField="SubProyecto" HeaderText="Sucursal"></asp:BoundField>
</asp:BoundField>
<asp:BoundField DataField="SerieFolio" HeaderText="Folio" >
</asp:BoundField>
<asp:BoundField DataField="Nombre" HeaderText="Cliente" >
</asp:BoundField>
<asp:BoundField DataField="EnvioDireccionOrigen" HeaderText="Dirección" >
</asp:BoundField>
<asp:HyperLinkField DataTextField="FolioAlmacen" HeaderText="Folio Alm" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" DataNavigateUrlFields="CveMovimiento" ControlStyle-CssClass="Texto" />
<asp:BoundField DataField="Chofer" HeaderText="Operador" >
</asp:BoundField>
<asp:BoundField DataField="Unidad" HeaderText="Unidad" >
</asp:BoundField>
<asp:BoundField DataField="EstatusStr" HeaderText="Estatus" >
</asp:BoundField>
<asp:BoundField DataField="FechaEntrega" HeaderText="Fecha Entrega" ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" > <asp:BoundField DataField="SerieFolio" HeaderText="Folio"></asp:BoundField>
<ItemStyle HorizontalAlign="Center" Width="4%" /> <asp:BoundField DataField="Nombre" HeaderText="Cliente"></asp:BoundField>
<asp:BoundField DataField="EnvioDireccionOrigen" HeaderText="Dirección"></asp:BoundField>
<asp:HyperLinkField DataTextField="FolioAlmacen" HeaderText="Folio Alm" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" DataNavigateUrlFields="CveMovimiento" ControlStyle-CssClass="Texto" />
<asp:BoundField DataField="Chofer" HeaderText="Operador"></asp:BoundField>
<asp:BoundField DataField="Unidad" HeaderText="Unidad"></asp:BoundField>
<asp:BoundField DataField="EstatusStr" HeaderText="Estatus"></asp:BoundField>
<asp:BoundField DataField="FechaEntrega" HeaderText="Fecha Entrega" ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center">
<ItemStyle HorizontalAlign="Center" Width="4%" />
</asp:BoundField> </asp:BoundField>
<asp:BoundField DataField="FolioReferencia" HeaderText="Folio Ref" > <asp:BoundField DataField="FolioReferencia" HeaderText="Folio Ref"></asp:BoundField>
</asp:BoundField> <asp:TemplateField ItemStyle-Width="75px" HeaderStyle-HorizontalAlign="Left" HeaderText="Opciones">
<asp:TemplateField ItemStyle-Width="75px" HeaderStyle-HorizontalAlign="Left" HeaderText="Opciones">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkEditar" runat="server" OnClick="imgEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-pencil'></i>" /> <asp:LinkButton ID="LnkEditar" runat="server" OnClick="imgEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="LnkTimbrar" runat="server" OnClick="LnkTimbrar_Click" AlternateText="Timbrar" ToolTip="Timbrar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-external-link'></i>" /> <asp:LinkButton ID="LnkTimbrar" runat="server" OnClick="LnkTimbrar_Click" AlternateText="Timbrar" ToolTip="Timbrar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-external-link'></i>" />
<asp:LinkButton ID="LnkCancelaTimbre" runat="server" OnClick="LnkCancelaTimbre_Click" AlternateText="Cancelar timbre" ToolTip="Cancelar timbre" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar cancelación?" data-btn-ok-label="si" /> <asp:LinkButton ID="LnkCancelaTimbre" runat="server" OnClick="LnkCancelaTimbre_Click" AlternateText="Cancelar timbre" ToolTip="Cancelar timbre" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>"/>
<asp:HyperLink ID="HplR" runat="server" visible="false" AlternateText="Registrar" ToolTip="Registrar entrada" CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-location-arrow'></i>" /> <%-- <asp:LinkButton ID="LnkReactivarTimbre" Visible="false" runat="server" OnClick="LnkReactivarTimbre_Click" AlternateText="Reactivar timbre" ToolTip="Reactivar timbre" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-refresh'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar reactivacion?" data-btn-ok-label="si" />--%>
<asp:HyperLink ID="HplR" runat="server" Visible="false" AlternateText="Registrar" ToolTip="Registrar entrada" CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-location-arrow'></i>" />
</ItemTemplate> </ItemTemplate>
<HeaderStyle HorizontalAlign="Left" /> <HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" Width="75px" /> <ItemStyle HorizontalAlign="Left" Width="75px" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-Width="50px" HeaderStyle-HorizontalAlign="Center" HeaderText="Direcciones" Visible="false"> <asp:TemplateField ItemStyle-Width="50px" HeaderStyle-HorizontalAlign="Center" HeaderText="Direcciones" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="LnkEditarDirOrigen" Visible="false" runat="server" OnClick="EditDireccionOrigen_Click" AlternateText="Editar" ToolTip="Actualizar dirección Origen" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-location-arrow'></i>" /> <asp:LinkButton ID="LnkEditarDirOrigen" Visible="false" runat="server" OnClick="EditDireccionOrigen_Click" AlternateText="Editar" ToolTip="Actualizar dirección Origen" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-location-arrow'></i>" />
<asp:LinkButton ID="LnkEditarDirDestino" Visible="false" runat="server" OnClick="EditDireccionDestino_Click" AlternateText="Editar" ToolTip="Actualizar dirección Destino" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-location-arrow'></i>" /> <asp:LinkButton ID="LnkEditarDirDestino" Visible="false" runat="server" OnClick="EditDireccionDestino_Click" AlternateText="Editar" ToolTip="Actualizar dirección Destino" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-location-arrow'></i>" />
</ItemTemplate> </ItemTemplate>
<HeaderStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Left" Width="50px" /> <ItemStyle HorizontalAlign="Left" Width="50px" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="PDF"> <asp:TemplateField HeaderText="PDF">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HplPDF" Target="_blank" runat="server" ><i class='fa fa-file-pdf-o'></i></asp:HyperLink> <asp:HyperLink ID="HplPDF" Target="_blank" runat="server"><i class='fa fa-file-pdf-o'></i></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="4%" /> <ItemStyle HorizontalAlign="Center" Width="4%" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="XML"> <asp:TemplateField HeaderText="XML">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HplXML" Target="_blank" runat="server" ><i class='fa fa-file-code-o'></i></asp:HyperLink> <asp:HyperLink ID="HplXML" Target="_blank" runat="server"><i class='fa fa-file-code-o'></i></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="4%" /> <ItemStyle HorizontalAlign="Center" Width="4%" />
</asp:TemplateField> </asp:TemplateField>
@@ -188,10 +178,10 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div id="DivEditarEntrega" class="modal ADS fade" role="dialog">
<div id="DivEditarEntrega" class="modal ADS fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<asp:UpdatePanel ID="UpModalEditarentrega" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpModalEditarentrega" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
@@ -206,13 +196,13 @@
<div class="row"> <div class="row">
<label class="col-md-3">Chofer:</label> <label class="col-md-3">Chofer:</label>
<div class="col-md-9"> <div class="col-md-9">
<asp:DropDownList ID="DdlModalChofer" runat="server" DataTextField="Chofer" DataValueField="CveChofer" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlModalChofer" runat="server" DataTextField="Chofer" DataValueField="CveChofer" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalChofer" runat="server" Enabled="false" ControlToValidate="DdlModalChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RfvDdlModalChofer" runat="server" Enabled="false" ControlToValidate="DdlModalChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvDdlModalChofer" runat="server" HighlightCssClass="vco" TargetControlID="rfvDdlModalChofer" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VceRfvDdlModalChofer" runat="server" HighlightCssClass="vco" TargetControlID="rfvDdlModalChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-md-3">Unidad:</label> <label class="col-md-3">Unidad:</label>
@@ -251,7 +241,7 @@
<asp:UpdatePanel runat="server" ID="UpModalDirecciones" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpModalDirecciones" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row" runat="server" id="DVDireccionOrigen" visible="false"> <div class="row" runat="server" id="DVDireccionOrigen" visible="false">
@@ -272,7 +262,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="row"> <div class="row">
@@ -310,15 +300,69 @@
<asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control input-sm" Width="100%" Text="1"></asp:TextBox> <asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control input-sm" Width="100%" Text="1"></asp:TextBox>
<ajax:TextBoxWatermarkExtender ID="TBWEDistancia" runat="server" TargetControlID="TxtDistancia" WatermarkText="Distancia" WatermarkCssClass="watermarked" /> <ajax:TextBoxWatermarkExtender ID="TBWEDistancia" runat="server" TargetControlID="TxtDistancia" WatermarkText="Distancia" WatermarkCssClass="watermarked" />
</div> </div>
</div> </div>
<div class="row" id="DivTxtRec" runat="server" visible="false">
<div class=" col-md-2">
<div class="form-group form-md-line-input input-iconright" style="max-width: 85px">
<asp:TextBox ID="TxtModalRecoleccionCantidad" Width="50px" MaxLength="7" runat="server" TabIndex="1" CssClass="form-control"></asp:TextBox>
<label for="<%= TxtModalRecoleccionCantidad.ClientID.ToString()%>">Cantidad:</label>
<ajax:FilteredTextBoxExtender ID="FETxtModalRecoleccionCantidad" runat="server" TargetControlID="TxtModalRecoleccionCantidad" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator runat="server" ID="RfvTxtModalRecoleccionCantidad" ControlToValidate="TxtModalRecoleccionCantidad" ValidationGroup="GrpModalRecoleccionGuardaPS" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario por favor introdúzcalo." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CevRfvTxtModalRecoleccionCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalRecoleccionCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVTxtModalRecoleccionCantidad" runat="server" ControlToValidate="TxtModalRecoleccionCantidad" Display="None" Type="Double" MinimumValue="0.001" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor introdúzcalo." ValidationGroup="GrpModalRecoleccionGuardaPS"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtModalRecoleccionCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
</div>
<div class=" col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModalRecoleccionUnidad" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me" Style="width: 85px !important;"></asp:DropDownList>
<label for="<%= TxtModalRecoleccionCantidad.ClientID.ToString()%>">Unidad:</label>
<asp:RequiredFieldValidator ID="RfvDdlModalRecoleccionUnidad" runat="server" ControlToValidate="DdlModalRecoleccionUnidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpModalRecoleccionGuardaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvDdlModalRecoleccionUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModalRecoleccionUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
</div>
<div class=" col-md-7">
<div class="psagregar">
<div class="comboxes">
<label for="<%= DdlProducto2.ClientID.ToString()%>" style="font-size: 13px; color: #888888; opacity: 1; margin-bottom: 0px;">Producto:</label>
<ADS:Dropdownlost runat="server" ID="DdlProducto2" UsaWebService="true" Width="100%"
CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2"
DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlProducto_ValueChanged" />
</div>
</div>
</div>
<div class="col-md-1" style="text-align: right!important; padding-top: 15px; padding-left: 0px;">
<asp:LinkButton ID="LnkModalAgregarPS" runat="server" CssClass="btn btn-primary smallplus" ValidationGroup="GrpModalRecoleccionGuardaPS"
OnClick="LnkModalAgregarPS_Click"><i class="fa fa-plus"></i></asp:LinkButton>
</div>
</div>
<div class="row" id="DivGvRec" runat="server" visible="false">
<div class="col-md-12">
<asp:GridView ID="GvModalPSRecoleccion" DataKeyNames="CveEntregaAlmacenDetalle,CodigoPS,CvePS,CveUnidadMedida,Cantidad" runat="server"
ShowHeader="true" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-Width="86px" HeaderStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Unidad" DataField="Abreviatura" ItemStyle-Width="86px" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="500px" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LnkModalGvModalPSRecoleccionEliminar" runat="server" CssClass="btn btn-circle btn-xs red" OnClick="LnkModalGvModalPSRecoleccionEliminar_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el producto?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel runat="server"> <asp:UpdatePanel runat="server">
<ContentTemplate> <ContentTemplate>
<asp:Button ID="BtnModalEditarentrega" runat="server" OnClick="BtnModalEditarentrega_Click" CssClass="btn btn-success" Text="Actualizar" ValidationGroup="GrpModalEditarentrega" /> <asp:Button ID="BtnModalEditarentrega" runat="server" OnClick="BtnModalEditarentrega_Click" CssClass="btn btn-success" Text="Actualizar" ValidationGroup="GrpModalEditarentrega" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -329,8 +373,8 @@
</div> </div>
<div id="divAddDireccionEnvio" class="modal ADS fade" role="dialog"> <div id="divAddDireccionEnvio" class="modal ADS fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<asp:UpdatePanel ID="UpModalDVDireccionEnvio" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpModalDVDireccionEnvio" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
@@ -338,12 +382,14 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" id="myModalLabel"> <asp:Label runat="server" ID="LblTitulodireccion"></asp:Label> </h4> <h4 class="modal-title" id="myModalLabel">
<asp:Label runat="server" ID="LblTitulodireccion"></asp:Label>
</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<asp:UpdatePanel ID="UpBodyDireccion" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpBodyDireccion" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEnvioDireccion" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="100"></asp:TextBox> <asp:TextBox ID="TxtEnvioDireccion" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="100"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEnvioDireccion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEnvioDireccion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
@@ -365,7 +411,7 @@
</div> </div>
<div class="row "> <div class="row ">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -438,11 +484,11 @@
</div> </div>
</div> </div>
</div> </div>
<div style="display: none"> <div style="display: none">
@@ -465,12 +511,39 @@
</div> </div>
</div> </div>
<div id="DivModalCancelar" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalCancelar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<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">Opciones de cancelación de timbre
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<asp:RadioButtonList ID="RBLOpcionCancelacion" CssClass="iradio_square-blue" runat="server" RepeatDirection="Horizontal" Width="100%">
<asp:ListItem Value="1">Solo cancelar timbre</asp:ListItem>
<asp:ListItem Value="2">Cancelar timbre y generar un nuevo registro</asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LnkCancelar" runat="server" CssClass="btn btn-success" Text="Cancelar" ValidationGroup="GrpCancelar" OnClick="LnkCancelar_Click"></asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -1,4 +1,5 @@
using Extensiones; using Extensiones;
using Newtonsoft.Json;
using System; using System;
using System.Data; using System.Data;
using System.IO; using System.IO;
@@ -255,7 +256,22 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
} }
} }
private string DatosTimbre
{
get
{
if (ViewState["DatosTimbre"] == null)
{
ViewState["DatosTimbre"] = "";
}
return ViewState["DatosTimbre"].ToString();
}
set
{
ViewState["DatosTimbre"] = value;
}
}
@@ -331,7 +347,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
DdlEstatus.SelectedValueExist("1"); DdlEstatus.SelectedValueExist("1");
} }
protected void InicializaFechas() protected void InicializaFechas()
{ {
@@ -345,7 +361,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
{ {
ClsGenerales ObjGeneral = new ClsGenerales(); ClsGenerales ObjGeneral = new ClsGenerales();
if (ObjGeneral.GetInvEntregaAlmacenRutaRep(DdlSucursales.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero(), TxtFechaI.Text.ToDate(), TxtFechaF.Text.ToDate(), DdlChofer.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, Tipo:DdlTipo.SelectedValue)) if (ObjGeneral.GetInvEntregaAlmacenRutaRep(DdlSucursales.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero(), TxtFechaI.Text.ToDate(), TxtFechaF.Text.ToDate(), DdlChofer.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, Tipo: DdlTipo.SelectedValue))
{ {
DTDatos = ObjGeneral.DtResultados; DTDatos = ObjGeneral.DtResultados;
GVDatos.DataSource = DTDatos; GVDatos.DataSource = DTDatos;
@@ -371,7 +387,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero(); CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
CveTimbre = GvRow.DataKey("CveTimbre").ToEntero(); CveTimbre = GvRow.DataKey("CveTimbre").ToEntero();
DdlModalCamion.SelectedValueExist(GvRow.DataKey("CveCamion")); DdlModalCamion.SelectedValueExist(GvRow.DataKey("CveCamion"));
DdlModalChofer.SelectedValueExist(GvRow.DataKey("CveChofer")); DdlModalChofer.SelectedValueExist(GvRow.DataKey("CveChofer"));
@@ -411,12 +427,54 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
DVDireccionDestino.Visible = true; DVDireccionDestino.Visible = true;
LnkDireccionDestino.Text = GvRow.DataKey("Direccion") + " <i class='fa fa-search' aria-hidden='true'></i>"; LnkDireccionDestino.Text = GvRow.DataKey("Direccion") + " <i class='fa fa-search' aria-hidden='true'></i>";
} }
string TimbreTipoDocto = GvRow.DataKey("TimbreTipoDocto");
if (TimbreTipoDocto == "Rec")
{
DivTxtRec.Visible = true;
DivGvRec.Visible = true;
CargaDatosRecoleccionDetallePS();
}
else
{
DivTxtRec.Visible = false;
DivGvRec.Visible = false;
}
UpModalEditarentrega.Update(); UpModalEditarentrega.Update();
RegistraScript("$('#DivEditarEntrega').modal({ backdrop: 'static', keyboard: false });"); RegistraScript("$('#DivEditarEntrega').modal({ backdrop: 'static', keyboard: false });");
} }
private void CargaDatosRecoleccionDetallePS()
{
if (CveEntregaAlmacen > 0)
{
ClsGenerales ObjGenerales = new ClsGenerales();
if (ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen))
{
GvModalPSRecoleccion.DataSource = ObjGenerales.DtResultados;
}
else
{
GvModalPSRecoleccion.DataSource = null;
}
ObjGenerales.Dispose();
}
GvModalPSRecoleccion.DataBind();
}
protected void DdlProducto_ValueChanged(object sender, EventArgs e)
{
DdlModalRecoleccionUnidad.Items.Clear();
DdlModalRecoleccionUnidad.DataSource = get_GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa);
DdlModalRecoleccionUnidad.DataBind();
UpModalEditarentrega.Update();
}
private void ModalActualizaDirecciones(int CveTimbre) private void ModalActualizaDirecciones(int CveTimbre)
{ {
ClsGenerales ObjGeneral = new ClsGenerales(); ClsGenerales ObjGeneral = new ClsGenerales();
@@ -508,70 +566,198 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
protected void LnkCancelaTimbre_Click(object sender, EventArgs e) protected void LnkCancelaTimbre_Click(object sender, EventArgs e)
{ {
this.DatosTimbre = "";
bool ProcesoOK = false;
LinkButton LnkCancelarFolioFiscal = (LinkButton)sender; LinkButton LnkCancelarFolioFiscal = (LinkButton)sender;
GridViewRow GvRow = (GridViewRow)LnkCancelarFolioFiscal.BindingContainer; GridViewRow GvRow = (GridViewRow)LnkCancelarFolioFiscal.BindingContainer;
int CveTimbre = GvRow.DataKey("CveTimbre").ToEntero(); int CveTimbre = GvRow.DataKey("CveTimbre").ToEntero();
string FolioFiscalCancelar = GvRow.DataKey("FolioFiscal").ToString(); string FolioFiscalCancelar = GvRow.DataKey("FolioFiscal");
string RFCReceptor = GvRow.DataKey("RFCReceptor").ToString(); string RFCReceptor = GvRow.DataKey("RFCReceptor");
string RFCEmisor = GvRow.DataKey("RFCEmisor").ToString(); string RFCEmisor = GvRow.DataKey("RFCEmisor").ToString();
int CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero(); int CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero();
int CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero(); int CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero();
int CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero(); int CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
string TimbreTipoDocto = GvRow.DataKey("TimbreTipoDocto").ToString(); string TimbreTipoDocto = GvRow.DataKey("TimbreTipoDocto");
string FolioReferencia = GvRow.DataKey("FolioReferencia");
string SerieFolio = GvRow.DataKey("SerieFolio");
var objJson = new
{
CveTimbre,
FolioFiscalCancelar,
RFCReceptor,
RFCEmisor,
CvePACCancelacion,
CveSubProyecto,
CveEntregaAlmacen,
TimbreTipoDocto,
FolioReferencia,
SerieFolio
};
if (TimbreTipoDocto == "Tra")
{
RBLOpcionCancelacion.Enabled = false;
RBLOpcionCancelacion.SelectedValue = "2";
}
if (TimbreTipoDocto == "Ent")
{
RBLOpcionCancelacion.Enabled = false;
RBLOpcionCancelacion.SelectedValue = "1";
}
if (TimbreTipoDocto == "Rec")
{
RBLOpcionCancelacion.Enabled = true;
RBLOpcionCancelacion.SelectedValue = "1";
}
this.DatosTimbre = JsonConvert.SerializeObject(objJson);
UpModalCancelar.Update();
RegistraScript("$('#DivModalCancelar').modal('show');");
}
private void CancelarTimbre()
{
bool ProcesoOK = false;
var objJson = new
{
CveTimbre = -1,
FolioFiscalCancelar = "",
RFCReceptor = "",
RFCEmisor = "",
CvePACCancelacion = -1,
CveSubProyecto = -1,
CveEntregaAlmacen = -1,
TimbreTipoDocto = "",
FolioReferencia = "",
SerieFolio = ""
};
int CveTimbre = -1;
string FolioFiscalCancelar = "";
string RFCReceptor = "";
string RFCEmisor = "";
int CvePACCancelacion = -1;
int CveSubProyecto = -1;
int CveEntregaAlmacen = -1;
string TimbreTipoDocto = "";
string FolioReferencia = "";
string SerieFolio = "";
bool RegenerarTimbre = RBLOpcionCancelacion.SelectedValue == "2";
if (!string.IsNullOrEmpty(this.DatosTimbre))
{
var obj = JsonConvert.DeserializeAnonymousType(this.DatosTimbre, objJson);
CveTimbre = obj.CveTimbre;
FolioFiscalCancelar = obj.FolioFiscalCancelar;
RFCReceptor = obj.RFCReceptor;
RFCEmisor = obj.RFCEmisor;
CvePACCancelacion = obj.CvePACCancelacion;
CveSubProyecto = obj.CveSubProyecto;
CveEntregaAlmacen = obj.CveEntregaAlmacen;
TimbreTipoDocto = obj.TimbreTipoDocto;
FolioReferencia = obj.FolioReferencia;
SerieFolio = obj.SerieFolio;
}
Timbrado ObjCancelacion = new Timbrado(); Timbrado ObjCancelacion = new Timbrado();
ClsGenerales ObjGenerales = new ClsGenerales(); ClsGenerales ObjGenerales = new ClsGenerales();
ObjGenerales.IniciaTransacSQL(); ObjGenerales.IniciaTransacSQL();
if (EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptor)) StringBuilder sbMsg = new StringBuilder();
{
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, NowADS(), CvePACCancelacion, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
ProcesoOK = true;
}
}
else
{
ModExtensiones.RespuestaCancelacionSAT Resp = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion, CveSATMotivoCancelacion: 3);
if (Resp.Verificado) try
{
if (EsProduccion)
{ {
if (EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptor))
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, NowADS(), CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{ {
//regenero el timbre AplicarCancelacion(ref ProcesoOK, ref sbMsg, ref ObjGenerales, ref CveTimbre, SerieFolio, CveEntregaAlmacen, RegenerarTimbre, CvePACCancelacion, "", CveSubProyecto, TimbreTipoDocto, FolioReferencia);
if (TimbreTipoDocto == "Tra") }
else
{
ModExtensiones.RespuestaCancelacionSAT Resp = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion, CveSATMotivoCancelacion: 3);
if (Resp.Verificado)
{ {
CveTimbre = ObjGenerales.AddGralTimbre("Tra", CveSubProyecto, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true); AplicarCancelacion(ref ProcesoOK, ref sbMsg, ref ObjGenerales, ref CveTimbre, SerieFolio, CveEntregaAlmacen, RegenerarTimbre, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, CveSubProyecto, TimbreTipoDocto, FolioReferencia);
} }
////regenero el timbre
//if (TimbreTipoDocto == "Ent")
//{
// CveTimbre = ObjGenerales.AddGralTimbre("Ent", CveSubProyecto, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
//}
ProcesoOK = true;
} }
} }
else
{
AplicarCancelacion(ref ProcesoOK, ref sbMsg, ref ObjGenerales, ref CveTimbre, SerieFolio, CveEntregaAlmacen, RegenerarTimbre, CvePACCancelacion, "", CveSubProyecto, TimbreTipoDocto, FolioReferencia);
}
}
catch (Exception ex)
{
ProcesoOK = false;
sbMsg.Clear();
sbMsg.Append("Ocurrió un error al cancelar");
} }
if (ProcesoOK) if (ProcesoOK)
{ {
ObjGenerales.Commit(); ObjGenerales.Commit();
Alert("El complemento se cancelo correctamente."); Alert(sbMsg.ToString());
} }
else else
{ {
ObjGenerales.RollBack(); ObjGenerales.RollBack();
Alert("Se presento un error al cancelar el Folio Fiscal", ModExtensiones.TipoMensaje.MsgAdvertencia); Alert(sbMsg.ToString(), ModExtensiones.TipoMensaje.MsgError);
} }
ObjGenerales.Dispose(); ObjGenerales.Dispose();
RegistraScript("$('#DivModalCancelar').modal('hide');");
if (RegenerarTimbre)
{
DdlEstatus.SelectedValueExist("0");
UPFiltros.Update();
CargaDatos();
}
} }
private void AplicarCancelacion(ref bool ProcesoOK, ref StringBuilder sbMsg, ref ClsGenerales ObjGenerales, ref int CveTimbre, string SerieFolioCancelar, int CveEntregaAlmacen, bool RegenerarTimbre, int CvePACCancelacion, string Acuse, int CveSubProyecto, string TimbreTipoDocto, string FolioReferencia)
{
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, NowADS(), CvePACCancelacion, Acuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
ProcesoOK = true;
sbMsg.Append($"El timbre <b>{SerieFolioCancelar}</b> se cancelo correctamente.");
//regenero el timbre
if (RegenerarTimbre)
{
CveTimbre = ObjGenerales.AddGralTimbre(TimbreTipoDocto, CveSubProyecto, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
if (CveTimbre > 0)
{
sbMsg.Append($"<br/>Se genero un nuevo registro.<br/> Serie Folio: <b>{ObjGenerales.SerieInsertada} - {ObjGenerales.FolioInsertado}</b>");
if (TimbreTipoDocto == "Rec")
{
sbMsg.Append($"<br/>Folio de referencia: <b>{FolioReferencia}</b>");
}
}
else
{
ProcesoOK = false;
}
}
}
else
{
ProcesoOK = false;
}
}
public bool EstatusSATCancelado(string FolioFiscal, string RFCDe, string RFCReceptor) public bool EstatusSATCancelado(string FolioFiscal, string RFCDe, string RFCReceptor)
{ {
bool respuesta = false; bool respuesta = false;
@@ -598,7 +784,6 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
protected void BtnModalEditarentrega_Click(object sender, EventArgs e) protected void BtnModalEditarentrega_Click(object sender, EventArgs e)
{ {
bool ProcesoOK = true; bool ProcesoOK = true;
ClsGenerales ObjGral = new ClsGenerales(); ClsGenerales ObjGral = new ClsGenerales();
@@ -634,6 +819,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
LinkButton LnkEditar = e.Row.FCLinkButton("LnkEditar"); LinkButton LnkEditar = e.Row.FCLinkButton("LnkEditar");
LinkButton LnkTimbrar = e.Row.FCLinkButton("LnkTimbrar"); LinkButton LnkTimbrar = e.Row.FCLinkButton("LnkTimbrar");
LinkButton LnkCancelaTimbre = e.Row.FCLinkButton("LnkCancelaTimbre"); LinkButton LnkCancelaTimbre = e.Row.FCLinkButton("LnkCancelaTimbre");
//LinkButton LnkReactivarTimbre = e.Row.FCLinkButton("LnkReactivarTimbre");
LnkEditar.Visible = false; LnkEditar.Visible = false;
LnkTimbrar.Visible = false; LnkTimbrar.Visible = false;
@@ -652,6 +838,11 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" + e.Row.DBCampo("CveEntregaAlmacen"); e.Row.FCHyperLink("HplR").NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveEntregaAlmacen=" + e.Row.DBCampo("CveEntregaAlmacen");
} }
//if (e.Row.DataKey("Estatus").ToEntero() == 2)
//{
// LnkReactivarTimbre.Visible = true;
//}
if (e.Row.DataKey("Estatus").ToEntero() == 1) if (e.Row.DataKey("Estatus").ToEntero() == 1)
{ {
LnkCancelaTimbre.Visible = UsuarioActual.TienePermisoProceso(338); LnkCancelaTimbre.Visible = UsuarioActual.TienePermisoProceso(338);
@@ -661,10 +852,10 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
} }
if (bool.Parse(e.Row.DataKey("AplicaCP"))) if (bool.Parse(e.Row.DataKey("AplicaCP")))
{ {
if(e.Row.DataKey("Tipo").ToString() == "I") if (e.Row.DataKey("Tipo").ToString() == "I")
{ {
if (e.Row.FCHyperLink("HplPDF") != null) if (e.Row.FCHyperLink("HplPDF") != null)
e.Row.FCHyperLink("HplPDF").NavigateUrl = "/Compras/PopUpVerFactura.aspx?P=" + Extensiones.ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", -1, "PDF", e.Row.DataKey("SerieFolio"), e.Row.DataKey("TimbreTipoDocto"))); e.Row.FCHyperLink("HplPDF").NavigateUrl = "/Compras/PopUpVerFactura.aspx?P=" + Extensiones.ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", -1, "PDF", e.Row.DataKey("SerieFolio"), e.Row.DataKey("TimbreTipoDocto")));
@@ -687,7 +878,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
{ {
if (e.Row.DataKey("Tipo").ToString() == "I") if (e.Row.DataKey("Tipo").ToString() == "I")
{ {
if (e.Row.FCHyperLink("HplXML") != null) if (e.Row.FCHyperLink("HplXML") != null)
e.Row.FCHyperLink("HplXML").NavigateUrl = "/Compras/PopUpVerFactura.aspx?P=" + Extensiones.ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", -1, "XML", e.Row.DataKey("SerieFolio"), e.Row.DataKey("TimbreTipoDocto"))); e.Row.FCHyperLink("HplXML").NavigateUrl = "/Compras/PopUpVerFactura.aspx?P=" + Extensiones.ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", -1, "XML", e.Row.DataKey("SerieFolio"), e.Row.DataKey("TimbreTipoDocto")));
} }
else else
@@ -984,7 +1175,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
DdlDirClienteLocalidad.Items.Clear(); DdlDirClienteLocalidad.Items.Clear();
if (DdlDirClienteEstado.SelectedValue.ToEntero() > 0) if (DdlDirClienteEstado.SelectedValue.ToEntero() > 0)
{ {
DdlDirClienteLocalidad.DataSource = get_GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero(), DdlDirClienteMunicipio.SelectedValue.ToEntero(), CodigoPostal:TxtEnvioCP.Text.Trim()); DdlDirClienteLocalidad.DataSource = get_GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero(), DdlDirClienteMunicipio.SelectedValue.ToEntero(), CodigoPostal: TxtEnvioCP.Text.Trim());
DdlDirClienteLocalidad.DataBind(); DdlDirClienteLocalidad.DataBind();
} }
@@ -1039,7 +1230,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
public void EditDireccionOrigen_Click(object sender, EventArgs e) public void EditDireccionOrigen_Click(object sender, EventArgs e)
{ {
//GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); //GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
//int CveDireccionOrigen = GvRow.DataKey("CveDireccionOrigen").ToEntero(); //int CveDireccionOrigen = GvRow.DataKey("CveDireccionOrigen").ToEntero();
CveDireccionEditar = CveDireccionOrigen; CveDireccionEditar = CveDireccionOrigen;
//CveCliente = GvRow.DataKey("CveCliente").ToEntero(); //CveCliente = GvRow.DataKey("CveCliente").ToEntero();
@@ -1139,6 +1330,92 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
RegistraScript("$('#divAddDireccionEnvio').modal('show');"); RegistraScript("$('#divAddDireccionEnvio').modal('show');");
} }
protected void LnkReactivarTimbre_Click(object sender, EventArgs e)
{
bool ProcesoOK = false;
LinkButton LnkCancelarFolioFiscal = (LinkButton)sender;
GridViewRow GvRow = (GridViewRow)LnkCancelarFolioFiscal.BindingContainer;
int CveTimbre = GvRow.DataKey("CveTimbre").ToEntero();
int CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
Timbrado ObjCancelacion = new Timbrado();
ClsGenerales ObjGenerales = new ClsGenerales();
ObjGenerales.IniciaTransacSQL();
if (ObjGenerales.ReactivarTimbreEntregaAlmacen(CveTimbre, CveEntregaAlmacen, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
ProcesoOK = true;
}
if (ProcesoOK)
{
ObjGenerales.Commit();
Alert("El complemento se reactivo correctamente.");
}
else
{
ObjGenerales.RollBack();
Alert("Se presento un error al reactivar el folio fiscal", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
ObjGenerales.Dispose();
CargaDatos();
}
protected void LnkModalAgregarPS_Click(object sender, EventArgs e)
{
if (CveEntregaAlmacen > 0)
{
ClsGenerales ObjGenerales = new ClsGenerales();
if (ObjGenerales.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, DdlProducto2.SelectedValue.ToEntero(), TxtModalRecoleccionCantidad.Text.ToEntero(), DdlModalRecoleccionUnidad.SelectedValue.ToEntero(), UsuarioActual.CveUsuario))
{
}
ObjGenerales.Dispose();
}
LimpiarControlesPS();
CargaDatosRecoleccionDetallePS();
}
private void LimpiarControlesPS()
{
TxtModalRecoleccionCantidad.Text = "";
DdlModalRecoleccionUnidad.Items.Clear();
DdlProducto2.txtText.Value = "";
DdlProducto2.txtValue.Value = "";
UpModalEditarentrega.Update();
}
protected void LnkModalGvModalPSRecoleccionEliminar_Click(object sender, EventArgs e)
{
LinkButton LnkEliminar = (LinkButton)sender;
GridViewRow GvRow = (GridViewRow)LnkEliminar.NamingContainer;
if (CveEntregaAlmacen > 0)
{
int CveEntregaAlmacenDetalleEliminar = GvRow.DataKey("CveEntregaAlmacenDetalle").ToEntero();
ClsGenerales ObjGenerales = new ClsGenerales();
if (ObjGenerales.RemoveEntregaAlmacenRutaDetalle(CveEntregaAlmacenDetalleEliminar))
{
Alert("Recolección Eliminada correctamente.");
}
ObjGenerales.Dispose();
}
CargaDatosRecoleccionDetallePS();
}
protected void LnkCancelar_Click(object sender, EventArgs e)
{
CancelarTimbre();
}
} }

View File

@@ -49,7 +49,7 @@
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Asistencia Cheador Asistencias Checador
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content> </asp:Content>
@@ -69,6 +69,11 @@
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter"> <div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle"> <div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="LnkConsultar_Click" class="btn btn-primary" Width="95px" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<div class="row"> <div class="row">
@@ -79,14 +84,20 @@
<asp:ListItem Text="Registros" Value="2"></asp:ListItem> <asp:ListItem Text="Registros" Value="2"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<asp:Label ID="LblSubProyeccto" CssClass="col-md-1 compoonenlabel" runat="server" Text="SubProyecto:" Style="max-width: 103px;"></asp:Label>
<div class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 100% !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1">Tipo Período:</label> <label class="col-md-1">Tipo Período:</label>
<div class="col-md-2"> <div class="col-md-1">
<asp:DropDownList ID="DdlTipoPeriodo" runat="server" CssClass="select2me" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;"> <asp:DropDownList ID="DdlTipoPeriodo" runat="server" CssClass="select2me" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo" Style="width: 100% !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 mediocol">del:</label> <label class="col-md-1">Inicio:</label>
<div class="col-md-1"> <div class="col-md-1">
<%--<asp:TextBox ID="TxtPeriodoInicio" Text="0" CssClass="form-control" runat="server"></asp:TextBox>--%> <%--<asp:TextBox ID="TxtPeriodoInicio" Text="0" CssClass="form-control" runat="server"></asp:TextBox>--%>
@@ -101,7 +112,7 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaInicio"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaInicio"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<label class="col-md-1 mediocol">al:</label> <label class="col-md-1 mediocol">Fin:</label>
<div class="col-md-1"> <div class="col-md-1">
<%--<asp:TextBox ID="TxtPeriodoFin" Text="99" CssClass="form-control" runat="server"></asp:TextBox>--%> <%--<asp:TextBox ID="TxtPeriodoFin" Text="99" CssClass="form-control" runat="server"></asp:TextBox>--%>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
@@ -115,9 +126,7 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaFin"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaFin"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="col-md-3">
<asp:LinkButton ID="LnkConsultar" OnClick="LnkConsultar_Click" runat="server" Text="Consultar" Visible="true" class="btn btn-primary" />
</div>
</div> </div>
</div> </div>
<div class="tools"> <div class="tools">

View File

@@ -50,6 +50,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
DdlMotivoHoraExtra.DataSource = get_GlobalDTMotivosHorasExtras(UsuarioActual.CveEmpresa); DdlMotivoHoraExtra.DataSource = get_GlobalDTMotivosHorasExtras(UsuarioActual.CveEmpresa);
DdlMotivoHoraExtra.DataBind(); DdlMotivoHoraExtra.DataBind();
cargaChecadores(); cargaChecadores();
CargarCentrosDeCosto(null, DdlSubProyecto, null, LblSubProyeccto);
CargarCentrosDeCosto(DdlAsisProyecto, DdlAsisSubProyecto, LblAsisProyecto, LblAsisSubProyecto); CargarCentrosDeCosto(DdlAsisProyecto, DdlAsisSubProyecto, LblAsisProyecto, LblAsisSubProyecto);
PnlProyecto.Visible = DdlAsisProyecto.Visible; PnlProyecto.Visible = DdlAsisProyecto.Visible;
if (PnlProyecto.Visible) if (PnlProyecto.Visible)
@@ -103,7 +104,7 @@ public partial class Nomina_ChecadorAsistencia : ClsPaginas
using (ClsNominas objnom = new ClsNominas()) using (ClsNominas objnom = new ClsNominas())
{ {
int CveSubProyecto = -1; int CveSubProyecto = -1;
if (objnom.GetchecadorAsistencia(FechaI, FechaF, UsuarioActual.CveEmpresa)) if (objnom.GetchecadorAsistencia(FechaI, FechaF, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa))
{ {
DataTable dtASis = objnom.DTSetResultados.Tables[0]; DataTable dtASis = objnom.DTSetResultados.Tables[0];
dtper = objnom.DTSetResultados.Tables[1]; dtper = objnom.DTSetResultados.Tables[1];

View File

@@ -4977,20 +4977,53 @@
<ajax:ValidatorCalloutExtender ID="VCERfvTxtModalLayoutBancosFecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalLayoutBancosFecha" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCERfvTxtModalLayoutBancosFecha" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalLayoutBancosFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<asp:UpdatePanel runat="server" ID="UpControlesScotia" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" runat="server" id="DVCuentasScotia" visible="false">
<br />
<div class="col-md-3">
<asp:Label runat="server" ID="LblCuentasScotia" ></asp:Label>
</div>
<div class="col-md-3">
<asp:Button runat="server" ID="BtnGenerarAlta" Text="Generar Alta" OnClick="BtnGenerarAlta_Click" class="btn btn-primary" Enabled="false" />
</div>
<div class="col-md-3">
<div class="btn-file btn green" onclick="$('#FUTxt').click();">
<i class="fa fa-plus"></i>
<span>Seleccionar</span>
</div>
<span id="FUTxtt"></span>
</div>
<div class="col-md-3">
<asp:Button runat="server" ID="BtnCargarAlta" Text="Cargar Alta" OnClick="BtnCargarAlta_Click" class="btn btn-primary" />
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnCargarAlta" />
<asp:PostBackTrigger ControlID ="BtnGenerarAlta" />
</Triggers>
</asp:UpdatePanel>
<%-- <div class="form-group form-md-line-input input-iconright" runat="server" visible="false" >
<asp:TextBox ID="TxtModalLayoutBancosFecha" runat="server" CausesValidation="True" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfTxtModalLayoutBancosFecha" runat="server" ControlToValidate="TxtModalLayoutBancosFecha" CssClass="help-block errorimput" Display="none"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario "
ValidationGroup="GrpModalBancoLayout"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfTxtModalLayoutBancosFecha" runat="server" HighlightCssClass="vco" TargetControlID="RfTxtModalLayoutBancosFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" Text="Fecha: " AssociatedControlID="TxtModalLayoutBancosFecha"></asp:Label> <%--
<ajax:MaskedEditExtender ID="MaskedEditExtender6" runat="server" TargetControlID="TxtModalLayoutBancosFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" BehaviorID="_content_MKEFechaBaja" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""></ajax:MaskedEditExtender> <div class="form-group form-md-line-input input-iconright" runat="server" visible="false" >
<ajax:CalendarExtender ID="CalendarExtender5" runat="server" TargetControlID="TxtModalLayoutBancosFecha" PopupButtonID="ImgFechaBaja" PopupPosition="BottomRight" BehaviorID="_content_CEFechaBaja"></ajax:CalendarExtender> <asp:TextBox ID="TxtModalLayoutBancosFecha" runat="server" CausesValidation="True" CssClass="form-control"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtModalLayoutBancosFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpModalBancoLayout" Visible="False"></asp:CompareValidator> <asp:RequiredFieldValidator ID="RfTxtModalLayoutBancosFecha" runat="server" ControlToValidate="TxtModalLayoutBancosFecha" CssClass="help-block errorimput" Display="none"
</div>--%> ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario "
ValidationGroup="GrpModalBancoLayout"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfTxtModalLayoutBancosFecha" runat="server" HighlightCssClass="vco" TargetControlID="RfTxtModalLayoutBancosFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" Text="Fecha: " AssociatedControlID="TxtModalLayoutBancosFecha"></asp:Label>
<ajax:MaskedEditExtender ID="MaskedEditExtender6" runat="server" TargetControlID="TxtModalLayoutBancosFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" BehaviorID="_content_MKEFechaBaja" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarExtender5" runat="server" TargetControlID="TxtModalLayoutBancosFecha" PopupButtonID="ImgFechaBaja" PopupPosition="BottomRight" BehaviorID="_content_CEFechaBaja"></ajax:CalendarExtender>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtModalLayoutBancosFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Baja''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpModalBancoLayout" Visible="False"></asp:CompareValidator>
</div>
--%>
<br /> <br />
@@ -5012,6 +5045,11 @@
<asp:PostBackTrigger ControlID="BtnEfectivaleXLS" /> <asp:PostBackTrigger ControlID="BtnEfectivaleXLS" />
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
<div style="display:none!important">
<asp:FileUpload ID="FUTxt" runat="server" onchange="$('#FUTxtt').text(this.value);" ClientIDMode="Static" />
</div>
</div> </div>

View File

@@ -1,22 +1,24 @@
using Extensiones; using DocumentFormat.OpenXml.Drawing;
using Extensiones;
using Ionic.Zip;
using iTextSharp.text.pdf; using iTextSharp.text.pdf;
using iTextSharp.text.pdf.parser;
using Modelos;
using Profact.TimbraCFDI40;
using StackExchange.Redis;
using System; using System;
using System.Activities.Expressions;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using static Extensiones.ModExtensiones; using static Extensiones.ModExtensiones;
using Modelos;
using System.Text.RegularExpressions;
using iTextSharp.text.pdf.parser;
using Profact.TimbraCFDI40;
using Ionic.Zip;
using DocumentFormat.OpenXml.Drawing;
using System.Web;
public partial class Nomina_Nomina2 : ClsPaginas public partial class Nomina_Nomina2 : ClsPaginas
{ {
@@ -10742,7 +10744,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
SinSelccion, SinSelccion,
Bancomer, Bancomer,
Banorte, Banorte,
Banamex Banamex,
ScotiaBank
} }
@@ -10786,6 +10789,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
CargaCuentas(); CargaCuentas();
DivModalLayoutBancosFecha.Visible = false; DivModalLayoutBancosFecha.Visible = false;
DVCuentasScotia.Visible = false;
TxtModalLayoutBancosFecha.Text = ""; TxtModalLayoutBancosFecha.Text = "";
RegistraScript("$('#ModalLayoutBancos').modal('show');"); RegistraScript("$('#ModalLayoutBancos').modal('show');");
@@ -10798,7 +10802,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
DdlCuenta.Items.Clear(); DdlCuenta.Items.Clear();
DataTable DTCuentas = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta <> 1 AND UsaLayout = 'True' AND LEN(ConvenioPagoElectronico) > 0 "); DataTable DTCuentas = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta <> 1 AND UsaLayout = 'True' AND LEN(ConvenioPagoElectronico) > 0 ");
DTCuentas.CaseSensitive = false; DTCuentas.CaseSensitive = false;
DdlCuenta.DataSource = DTCuentas.FiltraParametros(" Banco IN('BANCOMER','BANORTE','BBVA Bancomer','BBVA','BANAMEX')"); DdlCuenta.DataSource = DTCuentas.FiltraParametros(" Banco IN('BANCOMER','BANORTE','BBVA Bancomer','BBVA','BANAMEX') OR Banco LIKE '%SCOTIA%' ");
DdlCuenta.DataBind(); DdlCuenta.DataBind();
DdlCuenta.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlCuenta.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlCuenta.SelectedValueExist("-1"); DdlCuenta.SelectedValueExist("-1");
@@ -10808,6 +10812,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
{ {
ConvenioPagoElectronico = string.Empty; ConvenioPagoElectronico = string.Empty;
DivModalLayoutBancosFecha.Visible = false; DivModalLayoutBancosFecha.Visible = false;
DVCuentasScotia.Visible = false;
BtnGenerarAlta.Enabled = false;
if (DdlCuenta.SelectedValue.ToEntero() > 0) if (DdlCuenta.SelectedValue.ToEntero() > 0)
{ {
@@ -10827,6 +10833,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
Banco = Bancos.Banamex; Banco = Bancos.Banamex;
DivModalLayoutBancosFecha.Visible = true; DivModalLayoutBancosFecha.Visible = true;
} }
else if (DdlCuenta.SelectedItem.Text.ToUpper().Contains("SCOTIA"))
{
//DivModalLayoutBancosFecha.Visible = false;
Banco = Bancos.ScotiaBank;
//PreparaLayoutBancosScotiaBank();
}
else else
{ {
ConvenioPagoElectronico = string.Empty; ConvenioPagoElectronico = string.Empty;
@@ -10838,6 +10850,274 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
} }
#region Layout ScotiaBank
private void PreparaLayoutBancosScotiaBank()
{
BtnGenerarAlta.Enabled = false;
int cuentasPendientes = 0;
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetDispersionNomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa, 18))
{
string fechaHoy = DateTime.Today.ToString("MM/dd/yyyy");
cuentasPendientes = objnom.DtResultados.FiltraParametros($" EstatusPagoElectronicoScotia = False OR FechaEliminacion < #{fechaHoy}# ").Rows.Count;
}
}
LblCuentasScotia.Text = string.Format("Pendientes: {0}", cuentasPendientes);
if (cuentasPendientes > 0)
{
BtnGenerarAlta.Enabled = true;
BtnModalBancosProcesar.Enabled = false;
DVCuentasScotia.Visible = true;
}
else
{
BtnModalBancosProcesar.Enabled = true;
}
UpControlesScotia.Update();
UpModalBancosLayout.Update();
}
protected void BtnGenerarAlta_Click(object sender, EventArgs e)
{
DataTable DTCuentasPendientes = new DataTable();
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetDispersionNomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa, 18))
{
string fechaHoy = DateTime.Today.ToString("MM/dd/yyyy");
DTCuentasPendientes = objnom.DtResultados.FiltraParametros($" EstatusPagoElectronicoScotia = False OR FechaEliminacion < #{fechaHoy}# ");
}
}
string NumeroConvenio = "";
using (ClsBancos objBancos = new ClsBancos())
{
if (objBancos.GetBancosCuentas(DdlCuenta.SelectedValue.ToEntero()))
{
if (objBancos.DtResultados.Rows.Count > 0)
{
NumeroConvenio = objBancos.DtResultados.Rows[0]["ConvenioPagoElectronico"].ToString();
}
}
}
if (NumeroConvenio.Length > 0)
{
using (ClsPagoScotia objPagoScotia = new ClsPagoScotia())
{
if (objPagoScotia.AltaCuentasScotia(DTCuentasPendientes, UsuarioActual, NumeroConvenio))
{
Response.Clear();
Response.Buffer = true;
Response.ContentType = "text/plain";
Response.AddHeader("Content-Disposition", "attachment;filename=" + objPagoScotia.NombreArchivo);
Response.Write(objPagoScotia.LayoutStr);
Response.Flush();
Response.End();
}
else{
Alert(objPagoScotia.LayouErrorStr, TipoMensaje.MsgAdvertencia);
RegistraScript("$('#ModalLayoutBancos').modal('show');");
//UpModalBancosLayout.Update();
//Response.Clear();
//Response.Buffer = true;
//Response.ContentType = "text/plain";
///Response.AddHeader("Content-Disposition", "attachment;filename=" + objPagoScotia.NombreArchivo);
//Response.Write(objPagoScotia.LayoutStr);
//Response.Flush();
//Response.End();
}
}
}
else {
Alert("La cuenta seleccionada no tiene un Convenio de Pago Electronico");
}
}
private string GuardaTXT()
{
string NombreArchivo = "";
try
{
string FileName = System.IO.Path.GetFileName(FUTxt.PostedFile.FileName);
NombreArchivo = FileName;
string Extension = System.IO.Path.GetExtension(FUTxt.PostedFile.FileName);
string FolderPath = string.Format("{0}Empresas\\", Request.ApplicationPath);
string FilePath = Server.MapPath(FolderPath + FileName);
FUTxt.SaveAs(FilePath);
NombreArchivo = FilePath;
}
catch (Exception ex)
{
//Retorno = false;
this.GuardaLog( $" Error al guardar el archivo TXT --> {ex.StackTrace}");
NombreArchivo = "";
}
return NombreArchivo;
}
protected void BtnCargarAlta_Click(object sender, EventArgs e)
{
bool ErrorArchivo = false;
string RutaArchivo = "";
if (FUTxt.HasFile)
{
RutaArchivo = GuardaTXT();
if (RutaArchivo.Length == 0)
{
Alert("Ocurrió un error Scotia al cargar el archivo", TipoMensaje.MsgError);
return;
}
}
else
{
Alert("No tiene ningún archivo", TipoMensaje.MsgAdvertencia);
return;
}
// LEE TXT
string Texto;
Texto = System.IO.File.ReadAllText(RutaArchivo);
string[] TextoArreglo = Texto.Split(new[] { "\r\n" }, StringSplitOptions.None);
//if (OpBancos == 3)
//{
TextoArreglo = System.IO.File.ReadAllLines(RutaArchivo);
StringBuilder SBCuentasAltas = new StringBuilder();
StringBuilder SBErrores = new StringBuilder();
bool ErrorArchivoScotia = false;
string H = TextoArreglo[0];
if (!(TextoArreglo.Length >= 3))
{
Alert("El archivo no tiene el formato correcto, debe tener al menos 3 líneas (Header, Detalle y Trailer)", TipoMensaje.MsgAdvertencia);
return;
}
if (H.Length != 140)
{
Alert("La longitud de la cabecera es incorrecta", TipoMensaje.MsgAdvertencia);
return;
}
string TipoArchivo = H.Substring(0, 2).ToUpper();
if (TipoArchivo != "SP")
{
Alert($"El archivo no es un archivo de respuesta, inicia con código {TipoArchivo}", TipoMensaje.MsgAdvertencia);
}
string HCodigo = H.Substring(40, 3);
if (HCodigo != "000" && HCodigo != " ")
{
SBErrores.Append($"El código de la cabecera es incorrecto {HCodigo} - {ClsPagoScotia.AltaCuentaScotiaCodigoRespuestaAnexoC(HCodigo)}.</br>");
ErrorArchivoScotia = true;
}
ClsBancos ObjBancos = new ClsBancos();
ObjBancos.IniciaTransacSQL();
for (int i = 1; i <= TextoArreglo.Length - 2; i++)
{
string Linea = TextoArreglo[i];
if (Linea.Length == 140)
{
string CodigoRespuesta = Linea.Substring(109, 3);
string DTipoArchivo = Linea.Substring(0, 2);
string Cuenta = Linea.Substring(12, 20);
DateTime FechaEliminacion = DateTime.ParseExact(Linea.Substring(32, 8), "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
if (DTipoArchivo != "SP")
{
SBErrores.Append($"Error Línea {i} el tipo de archivo no es un archivo de respuesta (SP), inicia con código {DTipoArchivo}.</br>");
ErrorArchivoScotia = true;
}
if (CodigoRespuesta == "000" || CodigoRespuesta == " ")
{
int CveCuentaDeposito = Linea.Substring(40, 50).Trim().ToEntero();
if (CveCuentaDeposito > 0)
{
if (ObjBancos.UpdateCuentaDepositoPagoElectronico(CveCuentaDeposito, Opcion: 3, FechaEliminacion: FechaEliminacion))
{
SBCuentasAltas.Append($"Cuenta: {Cuenta} registrada correctamente.</br>");
}
else
{
ErrorArchivoScotia = true;
}
}
else
{
SBErrores.Append($"Error Línea {i} Cve: {CveCuentaDeposito} cuenta: {Cuenta} no encontrada.</br>");
ErrorArchivoScotia = true;
}
}
else
{
SBErrores.Append($"Error Línea {i} cuenta no dada de alta código {CodigoRespuesta} - {ClsPagoScotia.AltaCuentaScotiaCodigoRespuestaAnexoC(CodigoRespuesta)}.</br>");
ErrorArchivoScotia = true;
}
}
else
{
SBErrores.Append($"Error en longitud de la línea {i} es incorrecta.</br>");
ErrorArchivoScotia = true;
}
}
if (ErrorArchivoScotia)
{
ObjBancos.RollBack();
Alert($"El archivo presentó errores en su procesamiento ({SBErrores.Length}). Correctos {SBCuentasAltas.Length} cuentas.</br>Altas:</br>{SBCuentasAltas.ToString()}<br><br>Errores:<br>{SBErrores.ToString()}", TipoMensaje.MsgAdvertencia);
}
else
{
ObjBancos.Commit();
Alert($"El archivo se analizó correctamente y se efectuaron todos los cambios en el sistema. Cuentas procesadas:</br>{SBCuentasAltas.ToString()}", TipoMensaje.MsgInformacion);
}
ObjBancos.Dispose();
if (ErrorArchivo)
{
Alert("Ocurrió un error al cargar el archivo", TipoMensaje.MsgError);
return;
}
else {
Alert("El archivo se cargó correctamente", TipoMensaje.MsgInformacion);
System.IO.File.Delete(RutaArchivo);
PreparaLayoutBancosScotiaBank();
RegistraScript("$('#ModalLayoutBancos').modal('show');");
}
}
#endregion
protected void BtnLayoutXLS_Click(object sender, EventArgs e) protected void BtnLayoutXLS_Click(object sender, EventArgs e)
{ {
@@ -10970,6 +11250,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
protected void BtnModalBancosProcesar_Click(object sender, EventArgs e) protected void BtnModalBancosProcesar_Click(object sender, EventArgs e)
{ {
BtnModalBancosProcesar.Enabled = true;
if (Banco == Bancos.Bancomer) if (Banco == Bancos.Bancomer)
{ {
@@ -11001,6 +11282,147 @@ public partial class Nomina_Nomina2 : ClsPaginas
} }
} }
} }
else if (Banco == Bancos.ScotiaBank)
{
DataTable DTResultados = new DataTable();
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetDispersionNomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa, 18))
{
DTResultados = objnom.DtResultados;
}
}
if (DTResultados.Rows.Count > 0)
{
using (ClsPagoScotia objPagoScotia = new ClsPagoScotia())
{
string ConvenioPagoElectronicoScotia = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("ConvenioPagoElectronico", $" CveCuenta = {DdlCuenta.SelectedValue}").ToString();
string ConvenioPagoElectronicoNomina = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("ConvenioPagoElectronicoNomina", $" CveCuenta = {DdlCuenta.SelectedValue}").ToString();
string NumCuentaOrigen = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("NumCuenta", $" CveCuenta = {DdlCuenta.SelectedValue}").ToString();
string CLABEOrigen = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CLABE", $" CveCuenta = {DdlCuenta.SelectedValue}").ToString();
//CASE WHEN LEN(BC.NumCuenta) > 0 THEN BC.NumCuenta ELSE BC.CLABE END AS CLABEOrigen,
if (!DTResultados.Columns.Contains("ConvenioPagoElectronico"))
{
DTResultados.Columns.Add("ConvenioPagoElectronico", typeof(string));
}
if (!DTResultados.Columns.Contains("ConvenioPagoElectronicoNomina"))
{
DTResultados.Columns.Add("ConvenioPagoElectronicoNomina", typeof(string));
}
if (!DTResultados.Columns.Contains("CLABEOrigen"))
{
DTResultados.Columns.Add("CLABEOrigen", typeof(string));
}
if (!DTResultados.Columns.Contains("Observaciones"))
{
DTResultados.Columns.Add("Observaciones", typeof(string));
}
foreach (DataRow dRow in DTResultados.Rows)
{
dRow["ConvenioPagoElectronico"] = ConvenioPagoElectronicoScotia;
dRow["CLABEOrigen"] = NumCuentaOrigen.Length > 0 ? NumCuentaOrigen : CLABEOrigen; // Si no tiene numero de cuenta, se usa la CLABE4
dRow["ConvenioPagoElectronicoNomina"] = ConvenioPagoElectronicoNomina;
dRow["Observaciones"] = dRow["CveNominaDetalle"].ToString();
}
//DTResultados.Columns["CLABEOrigen"].ColumnName = "CLABEOrigen"; // CLABE Origen
//DTResultados.Columns["ConvenioPagoElectronico"].ColumnName = "ConvenioPagoElectronico"; // Convenio Pago Electronico
//DTResultados.Columns["Importe"].ColumnName = "Importe"; // Importe
DTResultados.Columns["CvePersonal"].ColumnName = "CveProveedor"; // Cve Proveedor
//DTResultados.Columns["RFC"].ColumnName = "RFC"; // RFC
DTResultados.Columns["Nombre"].ColumnName = "RazonSocial"; // Razon Social
DTResultados.Columns["CveNominaDetalle"].ColumnName = "CveIE"; // Cve IE
//DTResultados.Columns["CLABEDestino"].ColumnName = "CLABEDestino"; // CLABE Destino
//DTResultados.Columns["CLABE"].ColumnName = "CLABE"; // CLABE
//DTResultados.Columns["CveBanco"].ColumnName = "CveBanco"; // Cve Banco
DTResultados.Columns["Observaciones"].ColumnName = "Observaciones"; // Observaciones
DTResultados.Columns["Correo"].ColumnName = "Correo"; // Correo
//DTResultados.Columns["CvePersonal"].ColumnName = "CvePersonal"; // Cve Personal
/*
CLABEOrigen
ConvenioPagoElectronico
Importe
CveProveedor
RFC
RazonSocial
CveIE
CLABEDestino
CLABE
CveBanco
Observaciones
Correo
CvePersonal
*/
ClsBancos ObjBancos = new ClsBancos();
bool errorScotia = false;
ObjBancos.IniciaTransacSQL();
string NombreArchivoPagos = $"pagos_{ClsPaginas.NowADS().ToString("ddMMyyyy")}_001.txt";
int CveLayoutEnvio = ObjBancos.AddLayoutEnvios(NombreArchivoPagos, ClsPaginas.NowADS(), DdlCuenta.SelectedValue.ToEntero(), PorGrupos: false, GenSecuencia: true, AltaCuenta: false);
int SecuenciaLayout = ObjBancos.SecuenciaLayout;
string objPagoScotiaNombreArchivo = "";
string objPagoScotiaLayoutStr = "";
if (CveLayoutEnvio > 0 && SecuenciaLayout > 0)
{
if (objPagoScotia.GeneraPagoScotiaBank(DTResultados, false, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual, Secuencia:SecuenciaLayout,EsNomina:true))
{
objPagoScotiaNombreArchivo = objPagoScotia.NombreArchivo;
objPagoScotiaLayoutStr = objPagoScotia.LayoutStr;
}
else
{
Alert(objPagoScotia.LayouErrorStr, TipoMensaje.MsgAdvertencia);
RegistraScript("$('#ModalLayoutBancos').modal('show');");
}
}
else
{
errorScotia = true;
}
if (!errorScotia)
{
ObjBancos.Commit();
Response.Clear();
Response.Buffer = true;
Response.ContentType = "text/plain";
Response.AddHeader("Content-Disposition", "attachment;filename=" + objPagoScotiaNombreArchivo);
Response.Write(objPagoScotiaLayoutStr);
Response.Flush();
Response.End();
}
else
{
ObjBancos.RollBack();
}
ObjBancos.Dispose();
}
}
else{
Alert("No se encontraron registros para generar el layout de ScotiaBank", TipoMensaje.MsgAdvertencia);
}
}
} }
private void CrearLayoutNominaBancomer(DataTable DTNomina) private void CrearLayoutNominaBancomer(DataTable DTNomina)
{ {
@@ -12489,4 +12911,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
{ {
CargaMovtoPermanente(); CargaMovtoPermanente();
} }
} }

View File

@@ -207,7 +207,7 @@
<asp:Label ID="lblAplicado" runat="server" Text='<%# Eval("MontoAplicado","{0:N2}")%>'> </asp:Label> <asp:Label ID="lblAplicado" runat="server" Text='<%# Eval("MontoAplicado","{0:N2}")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Acumulado"> <asp:TemplateField HeaderText="Acumulado" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblsaldo" runat="server" Text='<%# Eval("Acumulado","{0:N2}")%>'> </asp:Label> <asp:Label ID="lblsaldo" runat="server" Text='<%# Eval("Acumulado","{0:N2}")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>

View File

@@ -3976,6 +3976,8 @@ Partial Class OC_OC
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs) Handles BtnCancelar.Click Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs) Handles BtnCancelar.Click
Dim ObjEventos As New ClsOIEventos Dim ObjEventos As New ClsOIEventos
If CveEstatusFinalError > 0 Then If CveEstatusFinalError > 0 Then
Dim objOrdenCompra As New ClsOC Dim objOrdenCompra As New ClsOC
objOrdenCompra.IniciaTransacSQL() objOrdenCompra.IniciaTransacSQL()
@@ -9499,6 +9501,10 @@ Partial Class OC_OC
Dim Respuesta As Boolean = True Dim Respuesta As Boolean = True
If TipoOC <> "OC" Then
Return True 'solo genera poliza de presupuesto si es OC
End If
If UsuarioActual.Empresa.Funcionalidad(532).Contiene("2") Then If UsuarioActual.Empresa.Funcionalidad(532).Contiene("2") Then
Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero

View File

@@ -402,15 +402,16 @@ Partial Class RepOC
Dim Cantidad As Integer = DtOC.COUNT("CveOrdenCompra") Dim Cantidad As Integer = DtOC.COUNT("CveOrdenCompra")
Dim TotalPesos As Double = DtOC.SUM("Total", "CveMoneda = 1") Dim TotalPesos As Double = DtOC.SUM("Total", "CveMoneda = 1")
Dim TotalDolares As Double = DtOC.SUM("Total", "CveMoneda = 2") Dim TotalDolares As Double = DtOC.SUM("Total", "CveMoneda = 2")
Dim Total As Double = TotalPesos + (TotalDolares * GlobalTipoCambio) 'Dim Total As Double = TotalPesos + (TotalDolares * GlobalTipoCambio)
Dim TotalMN As Decimal = DtOC.AsEnumerable() _
.Sum(Function(row) Math.Round(Convert.ToDecimal(row.Field(Of Decimal)("Total")) * Convert.ToDecimal(row.Field(Of Decimal)("TipoCambio")), 2))
MuestraIndicador(DivIndicadores, "green-haze", "fa fa-money", "Órdenes de Compra", Cantidad.ToString, "Cantidad", "$" + Total.FormatoNumero, "Total", "$" + TotalPesos.FormatoNumero, "Pesos", "$" + TotalDolares.FormatoNumero, "Dólares")
MuestraIndicador(DivIndicadores, "green-haze", "fa fa-money", "Órdenes de Compra", Cantidad.ToString, "Cantidad", "$" + TotalMN.FormatoNumero, "Total", "$" + TotalPesos.FormatoNumero, "Pesos", "$" + TotalDolares.FormatoNumero, "Dólares")
UPPIndicador.Update() UPPIndicador.Update()
DivIndicadoresCompradoRecibido.Visible = True DivIndicadoresCompradoRecibido.Visible = True
DivIndicadoresCompradoRecibido.InnerHtml = String.Empty DivIndicadoresCompradoRecibido.InnerHtml = String.Empty
Dim Recibidos As Decimal = DtOC.SUM("Comprado") Dim Recibidos As Decimal = DtOC.SUM("Comprado")
Dim Comprados As Decimal = DtOC.SUM("Recibido") Dim Comprados As Decimal = DtOC.SUM("Recibido")

View File

@@ -695,7 +695,11 @@ Partial Class Sistemas_CatSesiones
Dim dominio As String = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) Dim dominio As String = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
GlobalDTRegimenesFiscales = Nothing GlobalDTRegimenesFiscales = Nothing
GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing
End If End If
'If Not dominio.Contains("gps.adsistemas") Then 'If Not dominio.Contains("gps.adsistemas") Then
' dominio = dominio.Replace("http", "https") ' dominio = dominio.Replace("http", "https")
@@ -712,6 +716,8 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaTipoVenta() Private Sub CargaTipoVenta()
GlobalDTTipoVenta(UsuarioActual.CveEmpresa) = Nothing GlobalDTTipoVenta(UsuarioActual.CveEmpresa) = Nothing
End Sub End Sub
End Class End Class

View File

@@ -10956,13 +10956,13 @@ Partial Class Clientes
tCveMoneda = GlobalDTBancosCuentasGral(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveMoneda", $"CveCuenta={DdlCuenta.SelectedValue}").ToEntero tCveMoneda = GlobalDTBancosCuentasGral(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CveMoneda", $"CveCuenta={DdlCuenta.SelectedValue}").ToEntero
CvePrePoliza = ObjMov.AddPrePolizas("Clientes/IE/DEV ", 1, tImporteDev, tImporteDev, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=2) CvePrePoliza = ObjMov.AddPrePolizas("Clientes/IE/DEV ", 1, tImporteDev, tImporteDev, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=2)
If tCveMoneda > 1 Then tTipoCambio = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToDecimal
'valida prepoliza 'valida prepoliza
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
tFolio = ObjIE.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero).ToString tFolio = ObjIE.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero).ToString
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, tFolio, PagueseA, tImporteDev, tCveMoneda, CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, tFolio, PagueseA, tImporteDev, tCveMoneda,
tTipoCambio, tObs, "", False, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero) tTipoCambio, tObs, "", False, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero, Modulo:="Clientes/IE/DEV ")
If CveIE > 0 Then If CveIE > 0 Then
Dim ImporteAplicar As Decimal = 0.0D Dim ImporteAplicar As Decimal = 0.0D
@@ -10990,7 +10990,7 @@ Partial Class Clientes
'BANCOS COMPLEMENTARIAs 'BANCOS COMPLEMENTARIAs
If tCveMoneda > 1 Then If tCveMoneda > 1 Then
ImporteAplicarMN = ((ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)) - ImporteAplicar).RoundSQL() ImporteAplicarMN = ((ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)) - ImporteAplicar).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ImporteAplicarMN, 204, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=-1, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ImporteAplicarMN, 204, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=-1, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, TipoCambio:=tTipoCambio) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
End If End If
End If End If
@@ -11015,29 +11015,39 @@ Partial Class Clientes
For Each gvr As GridViewRow In GVAnticipos.Rows For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("chkDevolver").Checked Then If gvr.FCCheckBox("chkDevolver").Checked Then
Dim PorcentajePagoDevDin As Decimal = (gvr.DataKey("Saldo").ToDecimal / gvr.DataKey("Total").ToDecimal).RoundSQL(6) Dim PorcentajePagoDevDin As Decimal = (gvr.DataKey("Saldo").ToDecimal / gvr.DataKey("Total").ToDecimal).RoundSQL(6)
Dim tCveConcepto As Integer Dim tConceptosTipoSaldo As ConceptosTipoSaldo = Nothing
ImporteAplicar = gvr.DataKey("Saldo").ToDecimal ImporteAplicar = gvr.DataKey("Saldo").ToDecimal
ImporteAplicarMN = ImporteAplicar
Dim CveVentaAmortizacion As Integer = -1 Dim CveVentaAmortizacion As Integer = -1
If gvr.DataKey("Tipo") = "IxC" Then If gvr.DataKey("Tipo") = "IxC" Then
tCveConcepto = 92 : tTipoMovto = False tTipoMovto = False
tConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(18, tCveMoneda, True, -1)
ElseIf gvr.DataKey("Tipo").Contiene("Dev", "NC") Then ElseIf gvr.DataKey("Tipo").Contiene("Dev", "NC") Then
CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero
tCveConcepto = 91 : ImporteAplicar = ImporteAplicar : tTipoMovto = False tConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(6, tCveMoneda, True, -1)
ImporteAplicar = ImporteAplicar : tTipoMovto = False
ElseIf gvr.DataKey("Tipo").Contiene("Ant") Then ElseIf gvr.DataKey("Tipo").Contiene("Ant") Then
tCveConcepto = 11 : ImporteAplicar = ImporteAplicar : tTipoMovto = False tConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(12, tCveMoneda, True, -1)
ImporteAplicar = ImporteAplicar : tTipoMovto = False
End If End If
If tCveMoneda > 1 Then ImporteAplicarME = ImporteAplicar
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)).RoundSQL() If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, ImporteAplicar, ImporteAplicarMN, tConceptosTipoSaldo.CveConcepto, ReferenciaAplicar, ConceptoAplicar, CveIE:=gvr.DataKey("CveIE").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, CveVentaAmortizacion:=CveVentaAmortizacion, TipoCambio:=tTipoCambio) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, ImporteAplicar, ImporteAplicarMN, tCveConcepto, ReferenciaAplicar, ConceptoAplicar, CveIE:=gvr.DataKey("CveIE").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, CveVentaAmortizacion:=CveVentaAmortizacion) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
Exit For Exit For
End If End If
If tCveMoneda > 1 Then
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio - 1)).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, ImporteAplicar, ImporteAplicarMN, tConceptosTipoSaldo.CveConceptoComplementario, ReferenciaAplicar, ConceptoAplicar, CveIE:=gvr.DataKey("CveIE").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, CveVentaAmortizacion:=CveVentaAmortizacion, TipoCambio:=tTipoCambio) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
Exit For
End If
End If
'IMPUESTOS 'IMPUESTOS
If gvr.DataKey("IVA").ToDecimal > 0 Then If gvr.DataKey("IVA").ToDecimal > 0 Then
tImporte = -(gvr.DataKey("IVA").ToDecimal * PorcentajePagoDevDin).RoundSQL tImporte = -(gvr.DataKey("IVA").ToDecimal * PorcentajePagoDevDin * tTipoCambio).RoundSQL
If gvr.DataKey("Tipo").Contiene("Dev", "NC") AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 13, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=gvr.DataKey("PorcentajeIVA").ToDecimal) Then If gvr.DataKey("Tipo").Contiene("Dev", "NC") AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 13, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=gvr.DataKey("PorcentajeIVA").ToDecimal) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For Exit For
@@ -11049,7 +11059,7 @@ Partial Class Clientes
End If End If
If gvr.DataKey("IEPS").ToDecimal > 0 Then If gvr.DataKey("IEPS").ToDecimal > 0 Then
tImporte = (gvr.DataKey("IEPS").ToDecimal * PorcentajePagoDevDin).RoundSQL tImporte = (gvr.DataKey("IEPS").ToDecimal * PorcentajePagoDevDin * tTipoCambio).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, tImporte, tImporte, 39, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, tImporte, tImporte, 39, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For Exit For
@@ -11057,7 +11067,7 @@ Partial Class Clientes
End If End If
If gvr.DataKey("RetIVA").ToDecimal > 0 Then If gvr.DataKey("RetIVA").ToDecimal > 0 Then
tImporte = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePagoDevDin).RoundSQL tImporte = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePagoDevDin * tTipoCambio).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 62, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 62, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For Exit For
@@ -11065,13 +11075,12 @@ Partial Class Clientes
End If End If
If gvr.DataKey("RetISR").ToDecimal > 0 Then If gvr.DataKey("RetISR").ToDecimal > 0 Then
tImporte = (gvr.DataKey("RetISR").ToDecimal * PorcentajePagoDevDin).RoundSQL tImporte = (gvr.DataKey("RetISR").ToDecimal * PorcentajePagoDevDin * tTipoCambio).RoundSQL
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 63, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 63, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
Exit For Exit For
End If End If
End If End If
End If End If
Next Next
@@ -11131,8 +11140,6 @@ Partial Class Clientes
#End Region #End Region
End Class End Class

View File

@@ -286,7 +286,7 @@
<i></i> <i></i>
</div> </div>
<div class="row" runat="server" visible="false"> <div class="row" runat="server" visible="false" id="divPSExtranjero">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPSExtranjero" TextMode="MultiLine" Rows="2" CssClass="form-control" runat="server" MaxLength="846"></asp:TextBox> <asp:TextBox ID="TxtPSExtranjero" TextMode="MultiLine" Rows="2" CssClass="form-control" runat="server" MaxLength="846"></asp:TextBox>

View File

@@ -414,6 +414,10 @@ Partial Class ProductosyServicios
divPrecio.Visible = True divPrecio.Visible = True
End If End If
If UsuarioActual.CveRol = 1 Then
divPSExtranjero.Visible = True
End If
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then '' empresa deduce IEPS If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then '' empresa deduce IEPS
divIEPS.Visible = True divIEPS.Visible = True
End If End If

View File

@@ -281,6 +281,12 @@ Partial Class Ventas_Promociones
'DdlPS.Items.Insert(0, New ListItem("Todos", "-1")) 'DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
If DdlSubProyecto.Items.FindByValue("-1") Is Nothing Then
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End If
End If
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind() DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1")) DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))

View File

@@ -3438,7 +3438,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol"> <div class="portlet light xspadding bordered whitoutcol" id="DivComplementoSC" runat="server" visible="false">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
@@ -3455,16 +3455,17 @@
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="display: none;"> <div class="portlet-body form-horizontal form-row-sepe formnombottom" style="display: none;">
<div class="form-body"> <div class="form-body">
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4" style="display:flex"> <div class="col-md-4" style="display: flex">
No.Permiso <div style="color:red">*</div> No.Permiso
<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtNumPerLicoAut" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtNumPerLicoAut" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4" style="display:flex"> <div class="col-md-4" style="display: flex">
Calle<div style="color:red">*</div> Calle<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtSCCalle" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtSCCalle" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
@@ -3511,16 +3512,16 @@
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4" style="display:flex"> <div class="col-md-4" style="display: flex">
Municipio<div style="color:red">*</div> Municipio<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtSCMunicipio" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtSCMunicipio" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4" style="display:flex"> <div class="col-md-4" style="display: flex">
Estado<div style="color:red">*</div> Estado<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlSCEstado" DataTextField="NombreEstado" DataValueField="CveEstado" runat="server" CssClass="form-control input-sm select2me" Width="100%"> <asp:DropDownList ID="DdlSCEstado" DataTextField="NombreEstado" DataValueField="CveEstado" runat="server" CssClass="form-control input-sm select2me" Width="100%">
@@ -3528,8 +3529,8 @@
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4" style="display:flex"> <div class="col-md-4" style="display: flex">
C.Postal<div style="color:red">*</div> C.Postal<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtSCCP" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtSCCP" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
@@ -6943,6 +6944,8 @@
<asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" /> <asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" />
<asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" /> <asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" />
<asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" /> <asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" />
<asp:Button ID="BtnCreaApartirDePrecioOriginal" runat="server" ClientIDMode="Static" Text="Crear" Style="display: none;" OnClick="BtnCreaApartirDePrecioOriginal_Click" />
<asp:Button ID="BtnCreaApartirDePrecioNuevo" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" OnClick="BtnCreaApartirDePrecioNuevo_Click" />
<asp:HiddenField ID="HdnCveVentaAcuse" runat="server" ClientIDMode="Static" Value="0" /> <asp:HiddenField ID="HdnCveVentaAcuse" runat="server" ClientIDMode="Static" Value="0" />
<%--FLETES--%> <%--FLETES--%>
@@ -11225,6 +11228,13 @@
$('#BtnCargarPSAdicionales').click(); $('#BtnCargarPSAdicionales').click();
} }
function BtnCreaApartirDePrecioOriginal() {
$('#BtnCreaApartirDePrecioOriginal').click();
}
function BtnCreaApartirDePrecioNuevo() {
$('#BtnCreaApartirDePrecioNuevo').click();
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); }); $('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) { $("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {

View File

@@ -2738,6 +2738,8 @@ Partial Class Ventas
CargaDdlClientesSucursal() CargaDdlClientesSucursal()
End If End If
DivComplementoSC.Visible = UsuarioActual.CveRol = 1
DdlSCEstado.DataSource = GlobalDTGralEstados("MEX") DdlSCEstado.DataSource = GlobalDTGralEstados("MEX")
DdlSCEstado.DataBind() DdlSCEstado.DataBind()
DdlSCEstado.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlSCEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -20323,10 +20325,10 @@ Partial Class Ventas
Dim Existencia As Decimal = 0D Dim Existencia As Decimal = 0D
Using ObjInv2 As New ClsInventarios Using ObjInv2 As New ClsInventarios
If RBLTipoVenta.SelectedValue.ToEntero = 6 Then If RBLTipoVenta.SelectedValue = "6" Then
Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlmacenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1, Existencia = ObjInv2.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlmacenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1,
CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1, CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=0, PendientePorSurtir:=1,
RestringirAlmacenes:=1, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla) RestringirAlmacenes:=0, ExcluyeApartados:=-1, BuscarEnTabla:=BuscarEnTabla)
Else Else
Dim CveAlmacenConsulta As Integer = -1 Dim CveAlmacenConsulta As Integer = -1
@@ -35909,7 +35911,14 @@ Partial Class Ventas
#Region " CREAR APARTIR DE " #Region " CREAR APARTIR DE "
Protected Sub BtnCrearApartirDe_Click(sender As Object, e As System.EventArgs) Handles BtnCrearApartirDe.Click Protected Sub BtnCrearApartirDe_Click(sender As Object, e As System.EventArgs) Handles BtnCrearApartirDe.Click
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
Alert("Se va crear una nueva cotización. ¿Requiere que se actualicen a los precios actuales?", TipoMensaje.MsgDosBotones, "BtnCreaApartirDePrecioOriginal()", TextoConfirmacion:="No", TextoSegundoBoton:="Si", JSBtn2:="BtnCreaApartirDePrecioNuevo()", ShowCloseButton:=False)
Else
CreaAPartirDe(False)
End If
End Sub
Private Sub CreaAPartirDe(Optional RecargaPrecios As Boolean = False)
Dim FolioOriginal As String = TxtFolio.Text Dim FolioOriginal As String = TxtFolio.Text
HdnCveVenta.Value = "" HdnCveVenta.Value = ""
@@ -36102,6 +36111,14 @@ Partial Class Ventas
GvFacturasRelacionadas.Columns(2).Visible = True GvFacturasRelacionadas.Columns(2).Visible = True
If RecargaPrecios Then
Dim CvePrecioListaSugerido As Integer = Me.CvePrecioListaCliente
If CvePrecioListaSugerido <= 0 Then
CvePrecioListaSugerido = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "Predeterminada = 'True'").ToEntero()
End If
RecalculaPrecios(False, AplicarPromociones:=False, AplicarDescuentoGlobal:=False, CvePrecioListaSugerido:=CvePrecioListaSugerido)
End If
CalculaTotalesVenta() CalculaTotalesVenta()
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
@@ -36169,6 +36186,7 @@ Partial Class Ventas
UpFacturasRelacionadas.Update() UpFacturasRelacionadas.Update()
UpEmitirTransitorio.Update() UpEmitirTransitorio.Update()
End Sub End Sub
#End Region #End Region
#Region " GENERAR FACTURA " #Region " GENERAR FACTURA "
@@ -37637,7 +37655,7 @@ Partial Class Ventas
Try Try
Using wc As New HttpClient() Using wc As New HttpClient()
Dim Url As New Uri("http://polizavirtual.com.mx/webservice/api/Venta") Dim Url As New Uri("https://polizavirtual.com.mx/webservice/api/Venta")
Dim Parametros As New List(Of KeyValuePair(Of String, String)) Dim Parametros As New List(Of KeyValuePair(Of String, String))
@@ -40587,23 +40605,7 @@ Partial Class Ventas
End If End If
End If End If
For Each GvRow As GridViewRow In GvPSProced.Rows
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
Dim CodigoPS As String = GvRow.DataKey("CodigoPS")
Dim PU As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal
If Cantidad > 0 Then
If Not ValidaAgregarPS(0, CvePS, CveUnidadMedida, PU, 2, CveClasificacion, DdlSubProyectoDatos.SelectedValue.ToEntero(), Nothing, CantidadModal:=Cantidad, PSValidarModal:=CodigoPS) Then
Alert("No hay existencia.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Next
ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked
TxtFechaOS.Text = TxtFechaModal.Text TxtFechaOS.Text = TxtFechaModal.Text
@@ -40665,6 +40667,29 @@ Partial Class Ventas
End If End If
End If End If
If RBLTipoVenta.SelectedValue.Contiene("5", "6") Then ' 3.avista,4.consig,5.consig mat, 6. avista mat.
AsignaAlmacenWS()
'CargaPS(-1, DdlPS)
End If
For Each GvRow As GridViewRow In GvPSProced.Rows
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero
Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString
Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero
Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
Dim CodigoPS As String = GvRow.DataKey("CodigoPS")
Dim PU As Decimal = GvRow.FCTextBox("TxtPrecio").Text.ToDecimal
If Cantidad > 0 Then
If Not ValidaAgregarPS(0, CvePS, CveUnidadMedida, PU, 2, CveClasificacion, DdlSubProyectoDatos.SelectedValue.ToEntero(), Nothing, CantidadModal:=Cantidad, PSValidarModal:=CodigoPS) Then
Alert("No hay existencia.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Next
DdlTipoComprobante_SelectedIndexChanged(sender, Nothing) DdlTipoComprobante_SelectedIndexChanged(sender, Nothing)
Dim CountPsAgregados As Integer = 0 Dim CountPsAgregados As Integer = 0
@@ -40703,10 +40728,7 @@ Partial Class Ventas
UpParametros.Update() UpParametros.Update()
End If End If
If RBLTipoVenta.SelectedValue.Contiene("5", "6") Then ' 3.avista,4.consig,5.consig mat, 6. avista mat.
AsignaAlmacenWS()
'CargaPS(-1, DdlPS)
End If
If RBLTipoVenta.SelectedValue.Contiene("1") Then If RBLTipoVenta.SelectedValue.Contiene("1") Then
TxtPrecio.Enabled = True TxtPrecio.Enabled = True
UpPS.Update() UpPS.Update()
@@ -41133,7 +41155,7 @@ Partial Class Ventas
RegistraScript("MuestraAnticipos();", "AE") RegistraScript("MuestraAnticipos();", "AE")
End Sub End Sub
Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False, Optional AplicarDescuentoGlobal As Boolean = False) Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False, Optional AplicarDescuentoGlobal As Boolean = False, Optional CvePrecioListaSugerido As Integer = -1)
Dim PuedeRecalcular As Boolean = False Dim PuedeRecalcular As Boolean = False
Dim DescuentoManual As Decimal = 0, DescuentoPorcentaje As Decimal = 0 Dim DescuentoManual As Decimal = 0, DescuentoPorcentaje As Decimal = 0
@@ -41168,8 +41190,6 @@ Partial Class Ventas
Dim CodigoPS As String = Row("CodigoPS").ToString() Dim CodigoPS As String = Row("CodigoPS").ToString()
Dim PUOriginal As Decimal = Row("PU").ToString().ToDecimal() Dim PUOriginal As Decimal = Row("PU").ToString().ToDecimal()
Dim CvePrecioListaSugerido As Integer = -1
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = Nothing Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = Nothing
If AplicarPromociones OrElse AplicarDescuentoGlobal Then If AplicarPromociones OrElse AplicarDescuentoGlobal Then
@@ -41177,7 +41197,7 @@ Partial Class Ventas
ObjPrecioSugerido.PrecioSugerido = PUOriginal ObjPrecioSugerido.PrecioSugerido = PUOriginal
ObjPrecioSugerido.CvePrecioLista = Row("CvePrecioLista").ToString().ToEntero() ObjPrecioSugerido.CvePrecioLista = Row("CvePrecioLista").ToString().ToEntero()
Else Else
ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion) ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion, CvePrecioListaSugerido:=CvePrecioListaSugerido)
End If End If
If ObjPrecioSugerido.PrecioSugerido > 0 Then If ObjPrecioSugerido.PrecioSugerido > 0 Then
@@ -42041,6 +42061,7 @@ Partial Class Ventas
Where row.RowType = DataControlRowType.DataRow Where row.RowType = DataControlRowType.DataRow
Select New With Select New With
{ {
.CveVentaDetalle = row.DataKey("CveVentaDetalle").ToEntero(),
.Codigo = row.DataKey("Codigo").Trim(), .Codigo = row.DataKey("Codigo").Trim(),
.NumeroParte = row.DataKey("NumeroParte").Trim(), .NumeroParte = row.DataKey("NumeroParte").Trim(),
.Descripcion = row.DataKey("PS").Trim(), .Descripcion = row.DataKey("PS").Trim(),
@@ -42049,13 +42070,32 @@ Partial Class Ventas
.Precio = row.FCLiteral("LtlPU").Text.Trim().ToDecimal(), .Precio = row.FCLiteral("LtlPU").Text.Trim().ToDecimal(),
.SubImporte = row.DataKey("TotalImporte").ToDecimal(), .SubImporte = row.DataKey("TotalImporte").ToDecimal(),
.MargenUtilidad = row.FCLabel("LblCostoPorcentaje").Text.Replace("%", "").Replace(" ", "").Trim().ToDecimal(), .MargenUtilidad = row.FCLabel("LblCostoPorcentaje").Text.Replace("%", "").Replace(" ", "").Trim().ToDecimal(),
.UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal() .UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal(),
.PL1 = 0D,
.PL2 = 0D
}).QueryToDataTable(True) }).QueryToDataTable(True)
If DtExcel.Rows.Count < 1 Then If DtExcel.Rows.Count < 1 Then
Alert("No hay resultados en la busqueda.", TipoMensaje.MsgAdvertencia) Alert("No hay resultados en la busqueda.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Dim DtPreciosLista As DataTable = Nothing
If UsuarioActual.CveEmpresa = 189 Then
Dim ObjVta As New ClsVentas
If ObjVta.GetVentaDetallePreciosLista(Me.CveVenta, UsuarioActual.CveEmpresa) Then
DtPreciosLista = ObjVta.DtResultados.Copy()
End If
ObjVta.Dispose()
If DtPreciosLista IsNot Nothing Then
For Each Row As DataRow In DtExcel.Rows
Row("PL1") = DtPreciosLista.FiltroPrimeroValor("PL1", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal()
Row("PL2") = DtPreciosLista.FiltroPrimeroValor("PL2", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal()
Next
End If
End If
Dim folio = LblSerie.Text + "-" + TxtFolio.Text Dim folio = LblSerie.Text + "-" + TxtFolio.Text
@@ -42069,6 +42109,9 @@ Partial Class Ventas
DtExcel.Columns("MargenUtilidad").ColumnName = "Margen de utilidad" DtExcel.Columns("MargenUtilidad").ColumnName = "Margen de utilidad"
DtExcel.Columns("UltimoCosto").ColumnName = "Último costo" DtExcel.Columns("UltimoCosto").ColumnName = "Último costo"
'QUITAR COLUMNA DE VENTA DETALLE, EL USUARIO NO DEBE VERLA
DtExcel.Columns.Remove("CveVentaDetalle")
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim FileExcel As New ExcelFile() Dim FileExcel As New ExcelFile()
@@ -42093,6 +42136,10 @@ Partial Class Ventas
worksheet.Columns(7).Style.NumberFormat = "#,##0.00" worksheet.Columns(7).Style.NumberFormat = "#,##0.00"
'ULTIMO COSTO 'ULTIMO COSTO
worksheet.Columns(8).Style.NumberFormat = "$#,##0.00_);($#,##0.00)" worksheet.Columns(8).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
'PL1
worksheet.Columns(9).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
'PL2
worksheet.Columns(10).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns() Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns()
For i As Integer = 0 To columnCount For i As Integer = 0 To columnCount
@@ -42101,5 +42148,14 @@ Partial Class Ventas
FileExcel.Save(Response, $"{folio}.xlsx", SaveOptions.XlsxDefault) FileExcel.Save(Response, $"{folio}.xlsx", SaveOptions.XlsxDefault)
End Sub End Sub
Protected Sub BtnCreaApartirDePrecioOriginal_Click(sender As Object, e As EventArgs)
CreaAPartirDe(RecargaPrecios:=False)
End Sub
Protected Sub BtnCreaApartirDePrecioNuevo_Click(sender As Object, e As EventArgs)
CreaAPartirDe(RecargaPrecios:=True)
End Sub
End Class End Class