This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2021-12-22 17:09:31 -07:00
44 changed files with 4768 additions and 1792 deletions

View File

@@ -590,7 +590,7 @@ End Class
<Serializable>
Public Class CFDICartaPorteAutoTransporte
Public Property PermSCT As String = ""
Public Property PermisoSCT As String = ""
Public Property NumPermisoSCT As String = ""
Public Property NombreSeguroResponsabilidadCivil As String = ""
Public Property PolizaSeguroResponsabilidadCivil As String = ""

View File

@@ -140,6 +140,24 @@ Public Class ClsClasificaciones
Return Retorno
End Function
Public Function GetClasificacion2ProductoServicio(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Clasificacion2ProductoServicioGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar las Clasificaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetClasificacionesComprobaciones(CveEmpresa As Integer, Optional Opcion As Integer = 1, Optional TipoComprobacion As Integer = -1) As Boolean
Dim Retorno As Boolean = False

View File

@@ -1463,7 +1463,7 @@ Public Class ClsClientes
#Region "D I R E C C I O N D E E N V I O "
Public Function DireccionEnvioAdd(CveCliente As Integer, EnvioDireccion As String, EnvioNoExt As String, EnvioNoInt As String, EnvioColonia As String, EnvioCiudad As String, EnvioEstado As String,
EnvioCP As Integer, EnvioContacto As String, CveUsuario As Integer, Estatus As Integer, Optional CveClienteSucursal As Integer = -1, Optional EnvioDepartamento As String = "-1", Optional EnvioTel As String = "-1",
Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1) As Integer
Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1, Optional CveEmpresa As Integer = -1) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Vta_ClientesDireccionesEnvioAdd")
@@ -1488,6 +1488,7 @@ Public Class ClsClientes
.Add("@CveMunicipio", SqlDbType.Int).Value = CveMunicipio
.Add("@CveLocalidad", SqlDbType.Int).Value = CveLocalidad
.Add("@CveColonia", SqlDbType.Int).Value = CveColonia
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveDireccionEnvio", SqlDbType.Int).Direction = ParameterDirection.Output
End With

View File

@@ -6543,6 +6543,47 @@ Public Class ClsContabilidad
Return Retorno
End Function
#Region "F L U C T U A C I O N - C A M B I A R I A"
Public Function UpdateVentaTCValuacion(CveVenta As Integer, TCValuacion As Decimal) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_VentasTCValuacionUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@TCValuacion", SqlDbType.Decimal).Value = TCValuacion
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateCompraTCValuacion(CveCompra As Integer, TCValuacion As Decimal) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_ComprasTCValuacionUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@TCValuacion", SqlDbType.Decimal).Value = TCValuacion
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al actualizar el tipo de cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
#Region "IDisposable Support"
' IDisposable

View File

@@ -1734,7 +1734,7 @@ Public Class ClsGenerales
Return Retorno
End Function
End Function
Public Function GetTipoCambio(CveTipoCambio As Integer, Fecha As Date) As Boolean
Dim Retorno = False
@@ -1754,6 +1754,26 @@ Public Class ClsGenerales
Return Retorno
End Function
Public Function GetTipoCambioUltimaFluctuacion(CveTipoCambio As Integer, Fecha As Date, Optional Top As Integer = 1000) As Boolean
Dim Retorno = False
DataAdapter("PA_Gral_TipoCambioUltimaFluctuacionGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTipoCambio", SqlDbType.Int).Value = CveTipoCambio
.Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@Top", SqlDbType.Int).Value = Top
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el Tipo de Cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetTiposCambio(FechaInicio As Date, FechaFin As Date) As Boolean
Dim Retorno = False
@@ -3617,8 +3637,7 @@ Public Class ClsGenerales
Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0,
Optional CveEntregaAlmacen As Integer = -1,
Optional AplicaCP As Boolean = False) As Integer
Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Gral_TimbreAdd")
@@ -3663,7 +3682,7 @@ Public Class ClsGenerales
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -3770,7 +3789,8 @@ Public Class ClsGenerales
End Function
Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String, Orden As Integer, Estatus As Integer, Distancia As Integer) As Integer
Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String,
FolioReferencia As String, Referencia As String, FechaLimite As Date, Orden As Integer, Estatus As Integer, Distancia As Integer) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Inv_EntregaAlmacenRutaAdd")
@@ -3784,10 +3804,17 @@ Public Class ClsGenerales
.Add("@CveCamion", SqlDbType.Int).Value = CveCamion
.Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
.Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada
.Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
.Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia
.Add("@Estatus", SqlDbType.VarChar).Value = Estatus
.Add("@Distancia", SqlDbType.Int).Value = Distancia
.Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite
.Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -3826,6 +3853,28 @@ Public Class ClsGenerales
Return Retorno
End Function
Public Function AsignaEntregaAlmacenRuta(CveCamion As Integer, CveChofer As Integer, FechaEntrega As Date, CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenRutaAsignar")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCamion", SqlDbType.Int).Value = CveCamion
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
.Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetInvEntregaAlmacenRuta(CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Opcion As Integer, Optional Estatus As Integer = -1) As Boolean
Dim Retorno As Boolean = False

View File

@@ -241,7 +241,7 @@ Public Class ClsMovimientos
Gpo As Integer, CveResponsable As Integer,
TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1) As Boolean
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1, Optional CveMoneda As Integer = -1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -274,7 +274,8 @@ Public Class ClsMovimientos
.Add("@CveCobranzaEstatus", SqlDbType.Int).Value = CveCobranzaEstatus
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
.Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
.Add("@AplicaAnticiposPagados", SqlDbType.Int).Value = AplicaAnticiposPagados
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With
Try

View File

@@ -127,6 +127,47 @@ Public Class ClsPaginas
End Set
End Property
Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As MTipoCambioFluctuacion
Get
If Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
End If
ObjGral.Dispose()
End If
Dim fluctuacion = New MTipoCambioFluctuacion() With {
.TCFluctuacion = 0,
.FechaFluctuacion = MinFecha
}
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
If Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr = DirectCast(Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha = '{0}'", Fecha))
If dr IsNot Nothing Then
fluctuacion.TCFluctuacion = dr("TCFluctuacion").ToString().ToDecimal()
fluctuacion.FechaFluctuacion = dr("FechaFluctuacion").ToString().ToDateTime()
End If
Return fluctuacion
Else
Return fluctuacion
End If
End Get
End Property
<Serializable()>
Public Class MTipoCambioFluctuacion
Public Property TCFluctuacion As Decimal
Public Property FechaFluctuacion As DateTime
End Class
Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambioEuro <= 0 Then
@@ -4947,6 +4988,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Inventarios/CatUnidades.aspx".ToUpper(), 2056)
PaginaDict.Add("/Inventarios/EntregaAlmacenRuta.aspx".ToUpper(), 1320)
PaginaDict.Add("/Inventarios/RepEntregaAlmacenRuta.aspx".ToUpper(), 1319)
PaginaDict.Add("/Inventarios/CartaPorteManual.aspx".ToUpper(), 1321)

View File

@@ -5080,202 +5080,203 @@ Namespace Modelos
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then
'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES
For Each RowMovimiento As DataRow In DtSalidas.Rows
Dim CveConceptoMovimiento As Integer = -1
Dim CveAlmacenMovimiento As Integer = -1
If ObjFactura.TipoDocto <> "Rem" Then
For Each RowMovimiento As DataRow In DtSalidas.Rows
Dim CveConceptoMovimiento As Integer = -1
Dim CveAlmacenMovimiento As Integer = -1
Dim CveMovimientoDevolucion As Integer = 0
Dim Folio As Integer = 0
Dim CveMovimientoDevolucion As Integer = 0
Dim Folio As Integer = 0
Select Case RowMovimiento("CveConcepto").ToString().ToEntero()
Case 3
CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 40
CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 18
CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
''SI TIENE REMISIONES RELACIONADAS
'If DtRemisionesFacturadas.Rows.Count > 0 Then
' Dim RowRemision As DataRow = DtExistencias.FiltroPrimero($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}")
Select Case RowMovimiento("CveConcepto").ToString().ToEntero()
Case 3
CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 40
CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 18
CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
''SI TIENE REMISIONES RELACIONADAS
'If DtRemisionesFacturadas.Rows.Count > 0 Then
' Dim RowRemision As DataRow = DtExistencias.FiltroPrimero($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}")
' Dim CveRemision As Integer = RowRemision("CveRemision").ToString().ToEntero()
' Dim CveRemision As Integer = RowRemision("CveRemision").ToString().ToEntero()
' Dim CancelarRemision As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = CveRemision))
' Dim CancelarRemision As Boolean = (ListaRemisionesCancelar IsNot Nothing) AndAlso (ListaRemisionesCancelar.Any(Function(CveRemisionCancelar) CveRemisionCancelar = CveRemision))
' 'SI LA REMISION SE VA A CANCELAR DEBE REGRESAR AL ALMACEN GENERAL
' If CancelarRemision Then
' CveAlmacenDevolucion = RowRemision("CveAlmacenDevolucion").ToString().ToEntero()
' Else
' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
' End If
' 'SI LA REMISION SE VA A CANCELAR DEBE REGRESAR AL ALMACEN GENERAL
' If CancelarRemision Then
' CveAlmacenDevolucion = RowRemision("CveAlmacenDevolucion").ToString().ToEntero()
' Else
' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
' End If
'Else
' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
'End If
End Select
'Else
' CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
'End If
End Select
'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION
If ObjFactura.SaldoAlmacen <> 0 Then
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1")
Folio = ObjInventario.Folio
'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION
If ObjFactura.SaldoAlmacen <> 0 Then
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1")
Folio = ObjInventario.Folio
If CveMovimientoDevolucion > 0 Then
For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows
If CveMovimientoDevolucion > 0 Then
For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows
Dim FechaCaducidad As Date = MinFecha
If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then
If IsDate(Dr("FechaCaducidad")) Then
FechaCaducidad = Dr("FechaCaducidad").ToString().ToDate()
Dim FechaCaducidad As Date = MinFecha
If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then
If IsDate(Dr("FechaCaducidad")) Then
FechaCaducidad = Dr("FechaCaducidad").ToString().ToDate()
End If
End If
Dim CveVentaDetalleRemision As Integer = -1
If CveConceptoMovimiento = 41 Then
CveVentaDetalleRemision = Dr("CveVentaDetalleRemision").ToString.ToEntero()
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad, CveVentaDetalleRemision:=CveVentaDetalleRemision) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
End If
Next
Else
MensajeError = "Ocurrió un error al agregar el movimiento"
ErrorCancelar = True
End If
'GENERA PREPOLIZA DEL MOVIMIENTO DE DEVOLUCION
If Not ErrorCancelar Then
Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0
If ObjInventario.GetMovimientosDetalle(CveMovimientoDevolucion, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero
Dim IdCtaContable As Integer = 0
If tmpCostos.Rows.Count > 0 Then
Dim Multiplicador As Decimal = -1D
If ObjFactura.TipoDocto = "Dev" Then
Multiplicador = 1D
End If
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = Now
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER)
For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD()
TotalCostoAcumulado += ValorInventario
'CUANDO ES EL ÚLTIMO MOVIMIENTO Y HAY DIFERENCIAS EN LOS IMPORTES
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
End If
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If Not ErrorCancelar Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, Multiplicador * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * ValorInventario, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
ErrorCancelar = True
End If
End If
cont += 1
Next
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, Multiplicador * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * TotalCosto) Then
ErrorCancelar = True
End If
'AUTOCONTA - EL MOVIMIENTO 1 ES EL DE VENTA
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then
AutoConta = False
End If
If AutoConta And Not ErrorCancelar Then
If IdCtaContable > 0 Then
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
End If
Else
Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia)
End If
End If
Else
ErrorCancelar = True
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
End If
End If
End If
End If
Dim CveVentaDetalleRemision As Integer = -1
If CveConceptoMovimiento = 41 Then
CveVentaDetalleRemision = Dr("CveVentaDetalleRemision").ToString.ToEntero()
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad, CveVentaDetalleRemision:=CveVentaDetalleRemision) Then
'AGREGA BITACORA A VENTA
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then
Dim MensajeBitacora = "Devuelta"
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
MensajeError = "Ocurrió un error al agregar la bitacora."
ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
End If
End If
Else
'SI EXISTE UNA DEVOLUCION PREVIAMENTE HECHA UTILIZAR COMO REFERENCIA
If DtDevPrevias IsNot Nothing AndAlso DtDevPrevias.Rows.Count > 0 Then
CveMovimientoDevolucion = DtDevPrevias.FiltroPrimeroValor("CveMovimiento", $"CveConcepto = {CveConceptoMovimiento}").ToEntero()
End If
End If
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
'SI ES DEVOLUCION DEL CLIENTE DEBE REGRESAR A ENTREGA POR ADELANTADO
If Not ErrorCancelar AndAlso CveConceptoMovimiento = 18 AndAlso RevivirRemisiones Then
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimientoDevolucion, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión"
End If
End If
If DtVirtuales IsNot Nothing Then
For Each RowVirtual As DataRow In DtVirtuales.Rows
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
If Not ErrorCancelar AndAlso Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If
Next
Else
MensajeError = "Ocurrió un error al agregar el movimiento"
ErrorCancelar = True
End If
'GENERA PREPOLIZA DEL MOVIMIENTO DE DEVOLUCION
If Not ErrorCancelar Then
Dim DtCostos As DataTable = Nothing
Dim ValorInventario As Decimal = 0
If ObjInventario.GetMovimientosDetalle(CveMovimientoDevolucion, UsuarioActual.CveEmpresa) Then
DtCostos = ObjInventario.DtResultados
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero
Dim IdCtaContable As Integer = 0
If tmpCostos.Rows.Count > 0 Then
Dim Multiplicador As Decimal = -1D
If ObjFactura.TipoDocto = "Dev" Then
Multiplicador = 1D
End If
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = Now
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER)
For Each RowInv As DataRow In tmpCostos.Rows
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundAD()
TotalCostoAcumulado += ValorInventario
'CUANDO ES EL ÚLTIMO MOVIMIENTO Y HAY DIFERENCIAS EN LOS IMPORTES
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
End If
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If Not ErrorCancelar Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, Multiplicador * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * ValorInventario, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
ErrorCancelar = True
End If
End If
cont += 1
Next
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, Multiplicador * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * TotalCosto) Then
ErrorCancelar = True
End If
'AUTOCONTA - EL MOVIMIENTO 1 ES EL DE VENTA
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "Egs", "Dev") Then
AutoConta = False
End If
If AutoConta And Not ErrorCancelar Then
If IdCtaContable > 0 Then
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
End If
Else
Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia)
End If
End If
Else
ErrorCancelar = True
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
End If
End If
End If
If ErrorCancelar Then
Exit For
End If
'AGREGA BITACORA A VENTA
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimientoDevolucion > 0 Then
Dim MensajeBitacora = "Devuelta"
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoDevolucion, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
MensajeError = "Ocurrió un error al agregar la bitacora."
ErrorCancelar = True
End If
End If
Else
'SI EXISTE UNA DEVOLUCION PREVIAMENTE HECHA UTILIZAR COMO REFERENCIA
If DtDevPrevias IsNot Nothing AndAlso DtDevPrevias.Rows.Count > 0 Then
CveMovimientoDevolucion = DtDevPrevias.FiltroPrimeroValor("CveMovimiento", $"CveConcepto = {CveConceptoMovimiento}").ToEntero()
End If
End If
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
'SI ES DEVOLUCION DEL CLIENTE DEBE REGRESAR A ENTREGA POR ADELANTADO
If Not ErrorCancelar AndAlso CveConceptoMovimiento = 18 AndAlso RevivirRemisiones Then
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimientoDevolucion, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión"
End If
End If
If DtVirtuales IsNot Nothing Then
For Each RowVirtual As DataRow In DtVirtuales.Rows
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
If Not ErrorCancelar AndAlso Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If
Next
End If
If ErrorCancelar Then
Exit For
End If
Next
Next
End If
'SI EXISTEN HAY EXISTENCIA EN (ENTREGA POR ADELANTADO) SE TIENE QUE REGRESAR AL ALMACEN ORGINAL (GENERAL,SIN COSTO)
If Not ErrorCancelar AndAlso ListaRemisionesCancelar IsNot Nothing AndAlso ListaRemisionesCancelar.Count > 0 Then
If Not ErrorCancelar AndAlso ObjFactura.TipoDocto <> "Rem" AndAlso ListaRemisionesCancelar IsNot Nothing AndAlso ListaRemisionesCancelar.Count > 0 Then
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then
@@ -5314,6 +5315,40 @@ Namespace Modelos
End If
'CANCELACION DE MOVIMIENTOS DE REMISION
If Not ErrorCancelar AndAlso ObjFactura.TipoDocto = "Rem" AndAlso RealizarDevolucionAlmacen Then
Dim CveAlmacenGeneral As Integer = 0
Dim DtMovRemision As DataTable = Nothing
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero()
Else
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If
End If
'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO)
If Not ErrorCancelar AndAlso DtMovRemision IsNot Nothing AndAlso DtMovRemision.Rows.Count > 0 Then
Dim DtDevMovs = DtMovRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveAlmacen"})
For Each RowDevolucion As DataRow In DtDevMovs.Rows
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
If Not CancelarMovimientosRemision(CveVenta, CveAlmacen, CveAlmacenGeneral, DtMovRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")} AND CvePS > 0"), ObjVentas, ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
Exit For
End If
Next
End If
End If
'VERIFICAR MOVIMIENTOS DE APARTADOS
If Not ErrorCancelar Then
If Not GeneraMovimientosApartados(ObjInventario) Then

View File

@@ -2171,7 +2171,7 @@ Public Class Timbrado
If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then
cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT)
cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT)
cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM)
@@ -3918,8 +3918,8 @@ Public Class Timbrado
ComCartaPorte.FiguraTransporte.CveTransporte = ProfactCartaPorte.c_CveTransporte.Item02
ComCartaPorte.Mercancias.AutotransporteFederal = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederal
If Carta.FiguraTransporte.AutoTransporte.PermSCT <> "" Then
ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermSCT), ProfactCartaPorte.c_TipoPermiso)
If Carta.FiguraTransporte.AutoTransporte.PermisoSCT <> "" Then
ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermisoSCT), ProfactCartaPorte.c_TipoPermiso)
End If
ComCartaPorte.Mercancias.AutotransporteFederal.NumPermisoSCT = Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT
'pendiente RMF

View File

@@ -119,7 +119,8 @@ Public Class Timbres
Dim Distancia As Integer = 1
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetGralTimbre(CveTimbre, "-1", FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then
If ObjGrales.GetGralTimbre(CveTimbre, Obj.TipoDocto, FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then
If ObjGrales.DtResultados.Rows.Count = 1 Then
Dim DtMovimientos As DataTable = Nothing
@@ -136,6 +137,13 @@ Public Class Timbres
Timbre.Comprobante.Serie = Obj.Serie
Timbre.Comprobante.Folio = Obj.Folio.ToString
If drT("FolioFiscalRelacionado").ToString <> "" Then
Timbre.CFDIRelacionados.TipoRelacion = "05"
Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString)
End If
If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then
DtMovimientos = ObjGrales.DtResultados
Else
@@ -154,7 +162,7 @@ Public Class Timbres
If AplicaCP Then
CartaPorte.FiguraTransporte.AutoTransporte.PermSCT = drT("TipoPermisoSCT").ToString '"TPAF01"
CartaPorte.FiguraTransporte.AutoTransporte.PermisoSCT = drT("ClaveTipoPermisoSCT").ToString '"TPAF01"
CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString
CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString
@@ -166,8 +174,6 @@ Public Class Timbres
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
CPCliente = drT("CPCliente").ToString.ToEntero
Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString,
@@ -192,14 +198,14 @@ Public Class Timbres
Dim Ubica As New CFDICartaPorteUbicacion
Ubica.TipoEstacion = ""
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC,
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString,
.FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01",
.NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa,
.NombreRemitenteDestinatario = drT("RemitenteNombre").ToString,
.Domicilio = DomOrigen}
CartaPorte.Ubicaciones.Add(Ubica)
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC,'"CAMJ841219I33",
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString,
.FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"),
.NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa,
.NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString,
.Domicilio = DomDestino,
.DistanciaRecorrida = Distancia}
@@ -303,27 +309,27 @@ Public Class Timbres
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripcion = tPS,
.ValorUnitario = drr("PU").ToString.ToDecimal,
.Importe = drr("TotalImporte").ToString.ToDecimal,
.Descuento = drr("Descuento").ToString.ToDecimal,
.Unidad = drr("UM").ToString,
.ClaveUnidad = drr("SATClaveUM").ToString,
.ClaveProdServ = drr("SATClaveProdServ").ToString,
.Noidentificacion = drr("Noidentificacion").ToString,
.CuentaPredial = drr("CuentaPredial").ToString}
.Descripcion = tPS,
.ValorUnitario = drr("PU").ToString.ToDecimal,
.Importe = drr("TotalImporte").ToString.ToDecimal,
.Descuento = drr("Descuento").ToString.ToDecimal,
.Unidad = drr("UM").ToString,
.ClaveUnidad = drr("SATClaveUM").ToString,
.ClaveProdServ = drr("SATClaveProdServ").ToString,
.Noidentificacion = drr("Noidentificacion").ToString,
.CuentaPredial = ""}
'VERIFICA SUMA SUBTOTALES
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
concepto.Importe = totSubTotal
End If
totSubTotal = totSubTotal - concepto.Importe
'SIEMPRE ESTAMOS AGREGANDO EL IVA
'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
Timbre.Conceptos.Add(concepto)
i += 1
Next
Else
TieneError = True
_MsgError.AppendLine("timbrado son detalle de productos")
End If
End If
@@ -334,7 +340,9 @@ Public Class Timbres
End If
ObjGrales.Dispose()
Else
Timbre = Nothing
_MsgError.AppendLine("Consultar datos de timbrado")
End If
Return Timbre
End Function

View File

@@ -117,11 +117,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Case "sendMailLPM"
context.Response.Write(sendMailLPM(context))
Case "getSATColomias"
getSATColonias(context)
Case "GetFilesDirectory"
getSatColonias(context)
Case "GetFilesDirectory"
GetFilesDirectory(context)
Case "Getetiquetas"
Getetiquetas(context)
Case "cancelarRemision"
cancelarRemision(context)
End Select
Catch ex As Exception
ex.GuardaLog(ex.Message)
@@ -1599,4 +1601,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Return retorno
End Function
#End Region
#Region "C A N C E L A R - R E M I S I O N"
Private Function cancelarRemision(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim CveVenta As Integer = IfNull(context.Request("CveVenta"), "-1").ToString().ToEntero()
If CveVenta > 0 Then
Dim usuario As Usuario = UsuarioActual(context)
If usuario IsNot Nothing AndAlso usuario.CveEmpresa > 0 Then
Dim CveAlmacenDevolucion As Integer = 0
Using ObjInv As New ClsInventarios
If ObjInv.GetInv_Mov(CveVenta, usuario.CveEmpresa) Then
If ObjInv.DtResultados.Rows.Count > 0 Then
CveAlmacenDevolucion = ObjInv.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveConcepto IN (3,40)").ToEntero()
End If
End If
End Using
Dim ObjFacturaCancelacion As New Modelos.Factura(usuario, CveVenta, usuario.CveEmpresa, EsCancelacion:=True)
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
If ObjFacturaCancelacion.TipoDocto = "Rem" Then
Dim respuesta = ObjFacturaCancelacion.CancelarFactura(True, New List(Of Integer))
If respuesta IsNot Nothing Then
retorno = JsonConvert.SerializeObject(respuesta)
End If
End If
End If
End If
If Not String.IsNullOrEmpty(retorno) Then
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
Return retorno
End Function
#End Region
End Class

File diff suppressed because it is too large Load Diff

View File

@@ -2,10 +2,18 @@
Option Strict On
Imports System.Data
Imports System.Globalization
Imports Extensiones
Partial Class Bancos_FluctuacionCambiaria
Inherits ClsPaginas
Public ReadOnly Property FechaUltimoDiaMes() As DateTime
Get
Return New DateTime(DdlAnio.SelectedValue.ToEntero(), DdlMes.SelectedValue.ToEntero(), 1).AddMonths(1).AddDays(-1)
End Get
End Property
#Region "PROPIEDADES"
Private Property LblTotal() As String
Get
@@ -19,7 +27,7 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaFechas()
CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "")
CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "")
@@ -32,6 +40,27 @@ Partial Class Bancos_FluctuacionCambiaria
End Sub
#Region "CARGAS"
Private Sub CargaFechas()
'Año actual
DdlAnio.Items.Add(New ListItem(Now.Year.ToString(), Now.Year.ToString()))
'Año Anterior
DdlAnio.Items.Add(New ListItem(Now.AddYears(-1).Year.ToString(), Now.AddYears(1).Year.ToString()))
For i = 1 To 12
Dim fecha = New DateTime(DdlAnio.SelectedValue.ToEntero(), i, 1)
Dim mes = fecha.ToString("MMMM", CultureInfo.GetCultureInfo("es-MX"))
Dim mesStr = Char.ToUpper(mes(0)) + mes.Substring(1)
DdlMes.Items.Add(New ListItem(mesStr, i.ToString()))
Next
Dim UltimaFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
If UltimaFluctuacion IsNot Nothing Then
DdlMes.SelectedValueExist(UltimaFluctuacion.FechaFluctuacion.Month)
DdlMes.SelectedValueExist(UltimaFluctuacion.FechaFluctuacion.Year)
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaTipoCambio()
@@ -47,36 +76,52 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaTipoCambio()
Dim ObjGenerales As New ClsGenerales
ObjGenerales.GetTipoCambio(-1, TxtFecha.Text.ToDate)
ObjGenerales.GetTipoCambio(-1, FechaUltimoDiaMes)
If ObjGenerales.DtResultados.Rows.Count > 0 Then
LtTipoCambioActual.Text = ObjGenerales.DtResultados.Rows(0)("TipoCambio").ToString
TxtConceptoFluctuacion.Text = "Fluctuación a " & TxtFecha.Text
TxtConceptoFluctuacion.Text = "Fluctuación a " & FechaUltimoDiaMes.ToShortDateString()
End If
ObjGenerales.Dispose()
End Sub
Private Sub CargaUltimaFluctuacion()
Dim Obj As New ClsBancos
If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC")
If dt.Rows.Count > 0 Then
LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", dt.Rows(0)("Fecha").ToString.ToDate.ToShortDateString)
'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual
If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then
TxtFecha.Text = Now.ToShortDateString
Else
TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString()
End If
End If
'Dim Obj As New ClsBancos
'If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC")
' If dt.Rows.Count > 0 Then
' LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", dt.Rows(0)("Fecha").ToString.ToDate.ToShortDateString)
' 'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual
' If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then
' TxtFecha.Text = Now.ToShortDateString
' Else
' TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString()
' End If
' End If
'End If
'Obj.Dispose()
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
If UltimaFluctuacion IsNot Nothing Then
LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", UltimaFluctuacion.FechaFluctuacion.ToShortDateString)
'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual
If UltimaFluctuacion.FechaFluctuacion >= Now.AddMonths(-1).LastDayOfMonth Then
DdlMes.SelectedValueExist(Now.Month)
DdlAnio.SelectedValueExist(Now.Year)
Else
DdlMes.SelectedValueExist(Now.AddMonths(-1).Month)
DdlAnio.SelectedValueExist(Now.AddMonths(-1).Year)
'TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString()
End If
End If
Obj.Dispose()
CargaTipoCambio()
End Sub
Private Sub CargaDatosCompra()
Dim ObjBancos As New ClsBancos
'LblTotalCompras.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 1, UsuarioActual.CveEmpresa) Then
GvCompras.DataSource = ObjBancos.DtResultados
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
@@ -110,7 +155,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosVentas()
Dim ObjBancos As New ClsBancos
LblTotalVentas.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 2, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 2, UsuarioActual.CveEmpresa) Then
GvVentas.DataSource = ObjBancos.DtResultados
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
@@ -142,7 +187,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosCuentas()
Dim ObjBancos As New ClsBancos
LblTotalBancos.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 4, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 4, UsuarioActual.CveEmpresa) Then
Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Dim TotAcumulado As Decimal = 0
@@ -151,7 +196,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0
Dim CveCuentaExtranjera As Integer = Dr("CveCuentaExtranjera").ToString.ToEntero
If CveCuentaExtranjera > 0 Then
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, TxtFecha.Text.ToDate, 2, "-1", UsuarioActual.CveEmpresa, "1") Then
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaExtranjera, MinFecha, FechaUltimoDiaMes, 2, "-1", UsuarioActual.CveEmpresa, "1") Then
If Conta.DtResultados.Rows.Count > 1 Then
Total = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
End If
@@ -162,7 +207,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim SaldoActualContabilidad As Decimal = 0
Dim CveCuentaComplementaria As Integer = Dr("CveCuentaComplementaria").ToString.ToEntero
If CveCuentaComplementaria > 0 Then
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, TxtFecha.Text.ToDate, 2, "-1", UsuarioActual.CveEmpresa, "1") Then
If Conta.GetMovimientosAuxiliaresCatalogo(CveCuentaComplementaria, MinFecha, FechaUltimoDiaMes, 2, "-1", UsuarioActual.CveEmpresa, "1") Then
If Conta.DtResultados.Rows.Count > 1 Then
SaldoActualContabilidad = Conta.DtResultados.Rows(1)("SaldoActual").ToString.ToDecimal
End If
@@ -189,7 +234,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosDeudores()
Dim ObjBancos As New ClsBancos
LblTotalDeudores.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 5, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 5, UsuarioActual.CveEmpresa) Then
GvDeudores.DataSource = ObjBancos.DtResultados
LblTotalDeudores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
@@ -203,7 +248,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosAcreedores()
Dim ObjBancos As New ClsBancos
LblTotalAcreedores.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 6, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 6, UsuarioActual.CveEmpresa) Then
GvAcreedores.DataSource = ObjBancos.DtResultados
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
@@ -217,7 +262,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosFiliales()
Dim ObjBancos As New ClsBancos
LblTotalAcreedores.Text = "0.00"
If ObjBancos.GetFluctuaciones(TxtFecha.Text.ToDate, 7, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then
GvFiliales.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0")
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
@@ -237,15 +282,17 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoCompras.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoCompras.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 55175
Dim IdCtaComplementaria As Integer = 1248
Dim IdCtaComplementaria As Integer = 0
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
@@ -257,19 +304,17 @@ Partial Class Bancos_FluctuacionCambiaria
Total = LblTotal.ToDecimal
If Total > 0 Then
CveConceptoContable = 64
CveCuenta = CveCuentaGanancia
idCta = IdCtaGanancia
TipoMovto = True
Else
CveConceptoContable = 65
CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida
TipoMovto = False
End If
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -279,12 +324,18 @@ Partial Class Bancos_FluctuacionCambiaria
Total = gvr.DataKey("Fluctuacion").ToDecimal
'si es pérdida o ganancia
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 201, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total) Then
ErrorRegistrar = True
Exit For
End If
If Not Conta.UpdateCompraTCValuacion(gvr.DataKey("CveCompra").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
ErrorRegistrar = True
Exit For
End If
Next
If Not ErrorRegistrar Then
@@ -311,16 +362,18 @@ Partial Class Bancos_FluctuacionCambiaria
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 54141
Dim IdCtaComplementaria As Integer = 70
Dim IdCtaComplementaria As Integer = 0
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
''
Total = LblTotalVentas.Text.ToDecimal
If Total > 0 Then
CveConceptoContable = 64
@@ -341,7 +394,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoVentas.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentas.SelectedValue.ToEntero) Then
ErrorRegistrar = True
@@ -353,14 +406,21 @@ Partial Class Bancos_FluctuacionCambiaria
For Each gvr As GridViewRow In GvVentas.Rows
Total = -gvr.DataKey("Fluctuacion").ToDecimal
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
If gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0 Then
CveConconceptoCliente = 226
Else
CveConconceptoCliente = 203
End If
If Not Conta.UpdateVentaTCValuacion(gvr.DataKey("CveVenta").ToEntero, TCValuacion:=TCUltimaFluctuacion) Then
ErrorRegistrar = True
Exit For
End If
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveCuenta:=CveCuentaComplementaria, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
@@ -395,9 +455,9 @@ Partial Class Bancos_FluctuacionCambiaria
Dim CveConceptoContable As Integer = 0
Dim ErrorRegistrar As Boolean = False
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Dim MesTCtexto As String = String.Format("{0} TC:{1}", TxtFecha.Text.ToDate.ToString("MMMM-yyyy"), TCCierreFluctuacion)
Dim MesTCtexto As String = String.Format("{0} TC:{1}", FechaUltimoDiaMes.ToString("MMMM-yyyy"), TCCierreFluctuacion)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveCuentaPerdida = 0 ' 55379
@@ -477,7 +537,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaDD", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoDeudores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaDD", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoDeudores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -494,7 +554,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Total = LblTotalAcreedores.Text.ToDecimal
Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", TxtFecha.Text)
Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", FechaUltimoDiaMes)
Dim CveConconceptoDeudores As Integer = 256
@@ -553,7 +613,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim ObjContPaq As New ClsContPAQi(UsuarioActual.Empresa)
ObjContPaq.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaFilial", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoFiliales.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaFilial", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoFiliales.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
@@ -572,7 +632,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Total = LblTotalAcreedores.Text.ToDecimal
Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", TxtFecha.Text)
Dim ConceptoFluctuacion As String = String.Format("Fluctuación Filiales {0} ", FechaUltimoDiaMes)
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvFiliales.Rows
@@ -646,7 +706,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Conta.IniciaTransacSQL()
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, TxtFecha.Text.ToDate, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer

View File

@@ -637,7 +637,7 @@ Partial Class Bancos_PopIECompras
CveMonedaCompra = dr("CveMoneda").ToString.ToEntero
CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero
SerieFolio = dr("SerieFolio").ToString
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal
TipoCambioOriginal = dr("TipoCambioOriginal").ToString.ToDecimal
NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
@@ -1474,6 +1474,14 @@ Partial Class Bancos_PopIECompras
Dim CveCuentaContabilizacion As Long = 1
Dim CuentasContablesInvalidasSIG As New StringBuilder
Dim FechaPago As Date = TxtFechaDocumento.Text.ToDate()
'VERIFICA SI SE ESTA PAGANDO EN EL MISMO MES DE LA FACTURA
Dim PagoMismoMes As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso (FechaDocumento < FechaPago) AndAlso ((FechaDocumento.Month < FechaPago.Month AndAlso FechaDocumento.Year = FechaPago.Year) OrElse (FechaDocumento.Year < FechaPago.Year)) Then
PagoMismoMes = False
End If
Dim TCUltimaFluctuacion As Decimal = 1
'Tipos de cambio segun metodo de pago
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
tipoCambioPago = 1
@@ -1491,6 +1499,13 @@ Partial Class Bancos_PopIECompras
tipoCambioPago = TxtTipoCambio.Text.ToDecimal
tipoCambioCompra = 1
PorcentajePago = ImportePagado.ToString.ToDecimal / MovimientoPagar.Total
End If
Dim UltimaFluctuacion = GlobalTipoCambioUltimaFluctuacion(TxtFechaDocumento.Text.ToDate)
If UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < TxtFechaDocumento.Text.ToDate Then
TCUltimaFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
Select Case RBLContado.SelectedValue
@@ -1569,17 +1584,17 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
CveIE = rw.DataKey("CveIE").ToString.ToEntero
If CveMonedaCompra <> 1 Then
@@ -1617,17 +1632,17 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
CveIE = rw.DataKey("CveIE").ToString.ToEntero
If CveMonedaCompra <> 1 Then
@@ -1640,14 +1655,14 @@ Partial Class Bancos_PopIECompras
IdCtaContable = CtaProveedor
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=tipoCambioCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza"
End If
If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then
IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
@@ -1664,13 +1679,13 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
@@ -1686,14 +1701,14 @@ Partial Class Bancos_PopIECompras
IdCtaContable = CtaProveedor
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=tipoCambioCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza"
End If
If CveMonedaCompra <> 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then
IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
@@ -1710,13 +1725,13 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
@@ -1731,14 +1746,14 @@ Partial Class Bancos_PopIECompras
IdCtaContable = CtaProveedor
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, 275, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, rw.DataKey("CveVenta").ToEntero, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=tipoCambioCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, TxtObservaciones.Text, 275, ConceptoMovimiento, Fecha, IdCtaContable, -1, -1, rw.DataKey("CveVenta").ToEntero, CveCompra, -1, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza"
End If
If CveMonedaCompra = 2 Then
IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, rw.DataKey("CveVenta").ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, rw.DataKey("CveVenta").ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
@@ -1755,17 +1770,17 @@ Partial Class Bancos_PopIECompras
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ImportePagado.ToString.ToDecimal / tipoCambioPago
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = ImportePagado.ToString.ToDecimal * tipoCambioPago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ImportePagado.ToString.ToDecimal
ImporteMX = ImporteMovimiento * tipoCambioCompra
ImporteMX = ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
TimpocambioGeneral = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
End If
If CveMonedaCompra = 1 Then
@@ -1773,7 +1788,7 @@ Partial Class Bancos_PopIECompras
Else
IdCtaContable = IdCtaContComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioCompra - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompra) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, CveConceptoContableComplementaria, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion) - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)) Then
MsgError = "No se pudo insertar la póliza"
End If
ImporteMX = ImporteMovimiento
@@ -1797,7 +1812,7 @@ Partial Class Bancos_PopIECompras
Funcionalidad = 313
ConceptoContable = 248
ElseIf MovimientoPagar.ConceptoRetIVA = 5 Then
Funcionalidad = 578
Funcionalidad = 577
ConceptoContable = 285
End If
@@ -2557,9 +2572,10 @@ Partial Class Bancos_PopIECompras
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
TimpocambioGeneral = TCImpuestos
Dim tipoCambioCompraValuacion As Decimal = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
If tipoCambioPago < tipoCambioCompra AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en la venta
ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompraValuacion) 'Añadimos la diferencia de ganancia en la venta
ImporteMovimiento -= ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA
ImporteMovimiento += ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA
ImporteMovimiento += ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) - ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR
@@ -2581,9 +2597,10 @@ Partial Class Bancos_PopIECompras
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
Dim tipoCambioCompraValuacion As Decimal = If(PagoMismoMes, tipoCambioCompra, TCUltimaFluctuacion)
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
If tipoCambioPago > tipoCambioCompra AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
ImporteMovimiento = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioCompraValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
ImporteMovimiento -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
ImporteMovimiento += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
ImporteMovimiento += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioCompra) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR

View File

@@ -1513,20 +1513,30 @@ Partial Class Bancos_PopIEVentas
Dim CuentasContablesInvalidasSIG As New StringBuilder
Dim TipoCambioFluctuacion As Decimal = 1
Dim FechaUltimaFluctuacion As Date = MinFecha
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim strFecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & strFecha & "#", "Fecha DESC")
If drr IsNot Nothing Then
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
End If
End If
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim strFecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & strFecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
If CveMoneda = 1 AndAlso CveMonedaVenta = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
tipoCambioPago = 1

View File

@@ -924,20 +924,31 @@ Partial Class Bancos_ProveedoresAbonar
Dim TipoCambioFluctuacion As Decimal = 1
Dim FechaUltimaFluctuacion As Date = MinFecha
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC")
If drr IsNot Nothing Then
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
End If
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
' Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
Dim DttPlantilla As DataTable = Nothing
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
@@ -1055,7 +1066,7 @@ Partial Class Bancos_ProveedoresAbonar
Funcionalidad = 313
ConceptoContable = 248
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
Funcionalidad = 578
Funcionalidad = 577
ConceptoContable = 285
End If

View File

@@ -654,7 +654,7 @@ Partial Class Bancos_RepProgramarRecursos
ObjUsuarios.Dispose()
End Sub
Private Sub EnviaCorreoNotificacion()
If UsuarioActual.CveEmpresa = 13 Then
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
Dim strBody As New StringBuilder
Try

Binary file not shown.

View File

@@ -8626,7 +8626,7 @@ Partial Class Compras_Compras
Dim IndicePrimero As Integer = 0
For Each dRow As DataRow In TmpDT.Rows
If Boolean.Parse(dRow("AplicaIEPS").ToString) Then
If Boolean.Parse(dRow("AplicaIEPS").ToString) And dRow("IEPSPS").ToString.ToDecimal > 0 Then
IndicePrimero = IndiceContador
Exit For
End If

View File

@@ -1437,7 +1437,7 @@ Partial Class PopUpVerFactura
DescargarArchivoPDFTraslado(Archivo, Path)
Else
If Exten = "pdf" Then
Dim ObjTimbres As New Timbres("Rec", cvetimbre, UsuarioActual)
Dim ObjTimbres As New Timbres(Parametros("TIPODOCTO").ToString, cvetimbre, UsuarioActual)
GeneraPDFFactura(ObjTimbres.ObjFactura)
Archivo = New System.IO.FileInfo(Path)

View File

@@ -81,7 +81,7 @@
</div>
<div class="col-md-1 ">Grupo:</div>
<div class=" col-md-2 ">
<asp:DropDownList CssClass=" select2me" Width="80%" ID="DdlGrupo" runat="server">
<asp:DropDownList CssClass=" select2me" ID="DdlGrupo" runat="server" Width="95%">
<asp:ListItem Text="Año" Value="1"></asp:ListItem>
<asp:ListItem Text="Mes" Value="2"></asp:ListItem>
<asp:ListItem Selected="True" Text="Año/Mes" Value="3"></asp:ListItem>

View File

@@ -90,9 +90,22 @@ Partial Class Compras_RepComprasAF
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
DdlClasificacion.DataBind()
DdlClasificacion2.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
Dim ObjClasificacion As New ClsClasificaciones
If ObjClasificacion.GetClasificacion2ProductoServicio(UsuarioActual.CveEmpresa) Then
DdlClasificacion2.DataSource = ObjClasificacion.DtResultados
Else
DdlClasificacion2.DataSource = Nothing
End If
ObjClasificacion.Dispose()
DdlClasificacion2.DataBind()
DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlActivoFijo.DataBind()

View File

@@ -173,10 +173,7 @@
<asp:DropDownList CssClass=" select2me" ID="DdlProveedores" runat="server" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Width="95%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
@@ -194,7 +191,7 @@
<div class="col-md-1">Clasificación 2:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlClasificacion2" runat="server" CssClass=" form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="95%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
@@ -293,6 +290,17 @@
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Clasificación 2
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LblClasificacion2" runat="server" CssClass="ML Truncate" Text='<%# Eval("Clasificacion2") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">

View File

@@ -186,9 +186,24 @@ Partial Class Compras_RepComprasAFDetalle
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
DdlClasificacion.DataBind()
DdlClasificacion2.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
'DdlClasificacion2.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
'DdlClasificacion2.DataBind()
Dim ObjClasificacion As New ClsClasificaciones
If ObjClasificacion.GetClasificacion2ProductoServicio(UsuarioActual.CveEmpresa) Then
DdlClasificacion2.DataSource = ObjClasificacion.DtResultados
Else
DdlClasificacion2.DataSource = Nothing
End If
ObjClasificacion.Dispose()
DdlClasificacion2.DataBind()
DdlClasificacion2.Items.Insert(0, New ListItem("Sin Clasificación", "-2"))
DdlClasificacion2.Items.Insert(0, New ListItem("Totas", "-1"))
DdlClasificacion2.Items.Insert(1, New ListItem("Sin Clasificación", "-2"))
DdlClasificacion2.SelectedValueExist(-1)
DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlActivoFijo.DataBind()

View File

@@ -269,7 +269,17 @@
<asp:ListBox ID="DdlEmpresas" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Empresa" DataValueField="CveEmpresa"></asp:ListBox>
</div>
</div>
<div class="col-md-1 truncate" title="Tipo Cliente:" data-toggle="tooltip" data-placement="top">
Moneda:
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlMoneda" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Pesos" Value="1"></asp:ListItem>
<asp:ListItem Text="Dolares" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -180,7 +180,7 @@ Partial Class Compras_RepCxP
If txtFechaVF.Text = "" Then FechaVF = "-1"
Dim TipoAgrupacion As Integer = IIf(chkAgruparMes.Checked, 1, -1)
Dim TipoDocto As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM)
If Mov.GetCxP(FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, -1, DdlUsuarioResponsable.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlEstatusCompra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero,
If Mov.GetCxP(FechaI, FechaF, DdlProveedor.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero(), DdlUsuarioResponsable.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlEstatusCompra.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=IIf(DdlTipoProveedor.SelectedValue.ToEntero = 3, -1, DdlTipoProveedor.SelectedValue.ToEntero), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero,
TipoDocto:=TipoDocto, TipoAgrupacion:=TipoAgrupacion) Then
GvCxP.DataSource = Mov.DtResultados

View File

@@ -130,7 +130,9 @@
<li>
<asp:LinkButton ID="LbImprimirPresupuesto" Visible="true" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Presupuesto PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LbImprimirPresupuestoExcel" Visible="true" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Presupuesto Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LbImprmirAF" Visible="true" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Activos Fijos PDF</asp:LinkButton>
</li>
@@ -170,6 +172,7 @@
<asp:PostBackTrigger ControlID="LBImprimirInformacionG" />
<asp:PostBackTrigger ControlID="lbImprimirAvance" />
<asp:PostBackTrigger ControlID="LbImprimirPresupuesto" />
<asp:PostBackTrigger ControlID="LbImprimirPresupuestoExcel" />
<asp:PostBackTrigger ControlID="LbImprmirAF" />
<asp:PostBackTrigger ControlID="LbImprmirAFExcel" />
<asp:PostBackTrigger ControlID="LbImprimirPedDev" />

View File

@@ -2754,7 +2754,7 @@ Partial Class Contratos_Default
Private Sub CargaGVGastos()
Dim objContrato As New ClsContratos
If objContrato.GetContratoGastos(CveContrato, UsuarioActual.cveempresa) Then
If objContrato.GetContratoGastos(CveContrato, UsuarioActual.CveEmpresa) Then
DtGastos = objContrato.DtResultados
GvContratosGastos.DataSource = DtGastos
SumaGasto = objContrato.DtResultados.SUM("Importe", "CveContratoGasto IS NULL")
@@ -3835,6 +3835,9 @@ Partial Class Contratos_Default
#Region "I M P R E S I O N D E P R E S U P U E S T O "
Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click
GenerarPDFPPresupuesto()
End Sub
Private Sub lLbImprimirPresupuestoEXCEL_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuestoExcel.Click
GenerarPDFPPresupuesto(Formato:="EXCEL")
End Sub
Private Sub GenerarPDFPPresupuesto(Optional Formato As String = "PDF")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))

View File

@@ -335,9 +335,20 @@
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" title="Tipo Cliente:" data-toggle="tooltip" data-placement="top">
Moneda:
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlMoneda" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Pesos" Value="1"></asp:ListItem>
<asp:ListItem Text="Dolares" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-2">
<asp:CheckBox ID="ChkAnticipos" runat="server" Text="Incluye Anticipos" TextAlign="Left" Visible="false" />
</div>
</div>
</div>

View File

@@ -203,7 +203,7 @@ Partial Class RepCxC
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico,
If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero,
CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=AplicaAnticipos) Then
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=AplicaAnticipos, CveMoneda:=DdlMoneda.SelectedValue.ToEntero()) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados

View File

@@ -52,7 +52,13 @@
<Width>3.00921cm</Width>
</TablixColumn>
<TablixColumn>
<Width>10.82134cm</Width>
<Width>6.3532cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.5cm</Width>
</TablixColumn>
<TablixColumn>
<Width>1.90464cm</Width>
</TablixColumn>
<TablixColumn>
<Width>2.35479cm</Width>
@@ -150,6 +156,86 @@
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="CodigoMaterialPeligroso">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!CodigoMaterialPeligroso.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>CodigoMaterialPeligroso</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Embalaje">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Embalaje.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Embalaje</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="PesoEnKg">
@@ -280,6 +366,86 @@
</CellContents>
</TablixHeader>
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.52062cm</Size>
<CellContents>
<Textbox Name="Textbox37">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Cod. Material Peligroso</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox37</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#4f81bd</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.52062cm</Size>
<CellContents>
<Textbox Name="Textbox40">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Embalaje</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox40</rd:DefaultName>
<Style>
<Border>
<Color>#4f81bd</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#4f81bd</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
</TablixMember>
<TablixMember>
<TablixHeader>
<Size>0.52062cm</Size>
@@ -385,7 +551,7 @@
<Top>6.39415cm</Top>
<Left>0.38395cm</Left>
<Height>1.12062cm</Height>
<Width>19.11271cm</Width>
<Width>19.04921cm</Width>
<Style>
<Border>
<Color>#4f81bd</Color>
@@ -1723,6 +1889,60 @@
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Placa:</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!PlacaVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Año:</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!AnioVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Top>1.13111in</Top>
@@ -1925,52 +2145,13 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Placa:</Value>
<Value />
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!PlacaVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Año:</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!AnioVM.Value</Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Myriad Pro</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
@@ -3520,6 +3701,14 @@
<DataField>PesoEnKg</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CodigoMaterialPeligroso">
<DataField>CodigoMaterialPeligroso</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Embalaje">
<DataField>Embalaje</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DataSet</rd:DataSetName>

View File

@@ -2467,7 +2467,7 @@ Partial Class General_SaldosIniciales
Catalogos.Cell(crow, ccol).Value = "Estado"
For Each row As DataRow In GlobalDTGralEstados("MEX").Rows
crow = crow + 1
Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("Estado"))
Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("NombreEstado"))
Next
colEstado = ccol
rowEstado = crow

View File

@@ -0,0 +1,886 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CartaPorteManual.aspx.vb" Inherits="Inventarios_CartaPorteManual" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.psagregar {
width: 550px;
}
.psagregar > div.comboxes {
display: inline-block;
width: 450px;
}
.psagregar > div.codigo input {
width: 79px;
}
.psagregar > div.codigo {
display: inline-block;
width: 80px;
}
.psagregar > div.codigo > input[type="submit"] {
display: none;
}
.select2anothertable {
position: absolute;
left: 100%;
background-color: white;
/*top: 50px;*/ top: 21px;
/*max-height: 200px;*/ max-height: 229px;
/*background-color: #dcdcdc;*/
overflow: hidden;
}
.select2anothertable > table > tbody > tr > td:nth-of-type(odd) {
background-color: rgba(220, 220, 220, 0.45);
}
.select2anothertable > table > tbody > tr > td {
line-height: 21px;
white-space: nowrap;
}
.select2anothertable > table > tbody > tr.active {
background-color: #5897fb;
}
a#C_Tab_TabR_GvDatosRecepcion_LnkSeccionAlmacenDestino_0 {
display: none;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Carta Porte Manual
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" >
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="LnkAgregarDireccion" data-toggle="tooltip" data-placement="left" title="Agregar Dirección" Text="<i class='fa fa-plus'></i> Agregar Dirección"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabTraspaso" runat="server" HeaderText="Traspaso">
<ContentTemplate>
<div class="row">
<%-- <div class="col-md-8">
<asp:UpdatePanel ID="UpTraspaso" runat="server">
<ContentTemplate>
<div class="portlet light xspadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">TRASPASO ENTRE ALMACENES</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body ">
<div class="row" style="padding-top: 8px;">
<label class="col-md-2">Observaciones:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtObservaciones" CssClass="form-control " TextMode="MultiLine" Rows="3" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="padding-top: 8px;">
</div>
<div id="DivResponsable" runat="server" visible="true">
<div class="row">
<label class="col-md-2">Responsable:</label>
<div class="col-md-2" id="div1" >
<asp:TextBox runat="server" Text="" CssClass="form-control input-sm" ID="TxtResponsable" />
</div>
</div>
</div>
<div id="DivTransitorio2" class="rowpadding" runat="server" visible="false">
<div class="row">
<asp:Label AssociatedControlID="TxtGastoIndirecto" Visible="false" ID="LblGastoIndirecto" runat="server" Text="Gasto Indirecto:" CssClass="col-md-2"></asp:Label>
<div class="col-md-2" id="divGastoIndirecto" visible="false" runat="server">
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtGastoIndirecto" />
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>--%>
<asp:UpdatePanel ID="UpEmitirTransitorio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivEmitirTransitorio" class="col-md-4 " runat="server" visible="true">
<div class="portlet light xspadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">EMISIÓN DE TRASLADO</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body ">
<div class="rowpadding">
<div class="row">
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-3"></asp:Label>
<div class="col-md-9" style="padding-left: 5px;">
<asp:DropDownList runat="server" ID="DdlSubProyecto" CssClass="select2me" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyecto" runat="server" InitialValue="-1" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
</div>
<div class="row">
<label class="col-md-3">Fecha:</label>
<div class="col-md-3" style="padding-left: 5px;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" ValidationGroup="GrpGuardar" Width="100px" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFecha" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" Type="Date" MinimumValue="01/01/2000" MaximumValue="01/01/2000" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no puede ser mayor al dia actual. Por favor verifcar." ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha3" runat="server" HighlightCssClass="vco" TargetControlID="RVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row rowpadding" id="divEmitir" runat="server">
<label class="col-md-3">Emitir:</label>
<div class="col-md-9">
<table>
<tr>
<td>
<asp:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirTimbrado_CheckedChanged" AutoPostBack="true" Enabled="false" />
</td>
<td>
<asp:CheckBox ID="ChkEmitirCartaPorte" Checked="true" runat="server" Text="Carta Porte" Visible="true" Enabled="false" /></td>
</tr>
</table>
</div>
</div>
<div class="row rowpadding">
<label class="col-md-3">Chofer:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" 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="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row rowpadding">
<label class="col-md-3">Unidad:</label>
<div class="col-md-9">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" 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="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row rowpadding">
<%--<label class="col-md-3">F. Salida:</label>
<div class="col-md-9" style="padding-top: 0px;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
<asp:TextBox ID="TxtFechaEntrega" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFechaEntrega" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaEntrega" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaEntrega" PopupButtonID="ImgFechaEntrega" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>--%>
</div>
<div class="row rowpadding" runat="server" id="divFechaLlegada">
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="col-md-8" runat="server" visible="true">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpDirecciones">
<ContentTemplate>
<div class="portlet light xspadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Direcciones</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UpGvDireccionesEnvio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDireccionesEnvio" runat="server" Width="100%" GridLines="None"
DataKeyNames="CveDireccionEnvio,EnvioDireccion,EnvioCP,CveUsuario,Estatus,EnvioNoExt,EnvioNoInt,CvePais,CveEstado,CveMunicipio,CveLocalidad,CveColonia,Tipo"
CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de direcciones de envio">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Tipo
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioTipo" runat="server" CssClass="truncate" Text='<%# Eval("EnvioTipo")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Dirección
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioDireccion" runat="server" CssClass="truncate" Text='<%# Eval("EnvioDireccion")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Estado
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioEstado" runat="server" CssClass="truncate" Text='<%# Eval("EnvioEstado")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Municipio
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioMunicipio" runat="server" CssClass="truncate" Text='<%# Eval("EnvioMunicipio")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Localidad
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioLocalidad" runat="server" CssClass="truncate" Text='<%# Eval("EnvioLocalidad")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Colonia
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioColonia" runat="server" CssClass="truncate" Text='<%# Eval("EnvioColonia")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
C.P.
</HeaderTemplate>
<ItemTemplate>
<div class="truncate" >
<asp:Label ID="LtlEnvioCP" runat="server" CssClass="truncate" Text='<%# Eval("EnvioCP")%>'></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" class="Widthall grides" cellspacing="0">
<thead>
<tr class="Titulos">
<th width="25px">#</th>
<th width="100px">Cantidad</th>
<th width="90px">Unidad</th>
<th width="500px">Producto
</th>
<th width="100px"></th>
<th style="width: 88px" runat="server" id="ThSeccionAlmacen" visible="false">Sección Almacen</th>
<th style="width: 88px" runat="server" id="ThSerie" visible="false">Serie</th>
<th style="width: 88px" runat="server" id="ThLote" visible="false">Lote</th>
<th style="width: 88px" runat="server" id="ThFechaCaducidad" visible="false">Fecha Caducidad</th>
<th width="160px">Comandos</th>
</tr>
</thea>
<tr>
<td></td>
<td align="center">
<asp:TextBox ID="txtCantidad" Width="50px" MaxLength="7" runat="server" TabIndex="1"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbeCant" runat="server" TargetControlID="txtCantidad" FilterType="Custom, Numbers" ValidChars="." />
<asp:RequiredFieldValidator runat="server" ID="RFVCantidad" ControlToValidate="txtCantidad" ValidationGroup="GrpAgregar" 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="VCOCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:RangeValidator ID="RVCantidad" runat="server" ControlToValidate="txtCantidad" 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="GrpAgregar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="RVCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DdlUnidad" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me" Style="width: 85px !important;"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidad" runat="server" ControlToValidate="DdlUnidad" 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="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: left;">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="psagregar">
<div class="comboxes">
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2" DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td >
<%-- <asp:TextBox ID="TxtnObservaciones" CssClass="form-control input-sm" runat="server" Width="100px"></asp:TextBox>--%>
</td>
<td runat="server" id="TdSeccionAlmacen" visible="false">
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
Destino:<asp:DropDownList ID="DdlSeccionAlmacenDestino" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td runat="server" id="TdSerie" visible="false">
<asp:Panel runat="server" DefaultButton="BtnSerieAddNew">
<asp:TextBox ID="TxtnSerie" Visible="false" runat="server" Width="80px"></asp:TextBox>
<asp:Button Text="" ID="BtnSerieAddNew" OnClick="BtnSerieAddNew_Click" Style="display: none" runat="server" />
</asp:Panel>
</td>
<td runat="server" id="TdLote" visible="false">
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td runat="server" id="TdFechaCaducidad" visible="false">
<asp:CheckBox ID="ChkSugiereFechaCaducidad" runat="server" Text="Auto Sugiere" ToolTip="Auto Sugiere Fecha de caducidad" AutoPostBack="true" OnCheckedChanged="ChkSugiereFechaCaducidad_CheckedChanged" />
<asp:TextBox ID="TxtnFechaCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
</td>
<td align="center">
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="Texto" ValidationGroup="GrpAgregar" TabIndex="3" Text="Agregar" />
</td>
</tr>
</table>
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Cantidad") %>' ID="ltlCantidad"></asp:Literal>
<asp:TextBox runat="server" ID="TxtCantidad2" Text='<%# Eval("Cantidad", "{0:###,###,###,##0.##}") %>' Width="50px" Visible="false"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidadF" runat="server" TargetControlID="TxtCantidad2" FilterType="Numbers,custom" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="86px" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="500px" />
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="100px" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="90px" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="90px" />
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="90px" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("SeccionAlmacen") %>' ID="ltlSec"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" CommandName="Delete" CommandArgument='<%# Eval("No")%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el concepto?" data-btn-ok-label="si"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UpNuevoRealizar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="text-align: center;">
<div class="col-md-12">
<asp:Button Text="Realizar Carta Porte" CssClass="btn btn-primary" ValidationGroup="GrpGuardar" ID="BtnGuardar" runat="server" />
<%--<asp:Button Text="Nuevo" CssClass="btn btn-success" ID="BtnNuevo" OnClick="BtnNuevo_Click" runat="server" />--%>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<div style="display: none;">
<asp:Button ID="BtnImprimirTraspaso" runat="server" ClientIDMode="Static" />
<asp:Button ID="BtnImprimirRecepcion" runat="server" ClientIDMode="Static" />
</div>
<%-- <div id="ModalDivMail" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Correo</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpSendMail" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-xs-4">Para:</div>
<div class="col-xs-8">
<asp:TextBox ID="TxtParaMail" runat="server" Width="370px" CssClass="form-control" ClientIDMode="Static"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVParaMail" runat="server" ControlToValidate="TxtParaMail" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Para''</b> es necesario, por favor introdúzcalo." ValidationGroup="GrpEnviarEmail"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEParaMail" runat="server" HighlightCssClass="vco" TargetControlID="RFVParaMail" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<div class="col-xs-4">
Con copia para:<br />
(Separar con: ;)
</div>
<div class="col-xs-8">
<asp:TextBox ID="TxtCC" runat="server" TextMode="MultiLine" Columns="3" Rows="3" CssClass="form-control"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnSendMail" Text="Enviar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" ValidationGroup="GrpEnviarEmail" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>--%>
<div id="divAddDireccionEnvio" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpModalDVDireccionEnvio" 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" id="myModalLabel">Dirección de envío</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyDireccion" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoDireccion" runat="server" Width="100%" CssClass="form-control select2me" CausesValidation="true" AutoPostBack="true"
OnSelectedIndexChanged="DdlTipoDireccion_SelectedIndexChanged" ></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlTipoDireccion" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlTipoDireccion"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio">
</asp:RequiredFieldValidator>
<label for="<%= DdlTipoDireccion.ClientID.ToString()%>">Tipo:</label>
</div>
</div>
<div class="col-md-6">
<label for="<%= TxtFechaLlegada.ClientID.ToString()%>">Fecha:</label>
<div class="col-md-12" style="padding-top: 0px;margin-top:-7px;text-align:left">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
<asp:TextBox ID="TxtFechaLlegada" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFechaEnvio" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtFechaLlegada" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaLlegada" PopupButtonID="ImgFechaEnvio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaLlegada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Envío''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date " ValidationGroup="GrpObligatorio"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RfvTxtFechaLlegada" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtFechaLlegada" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvTxtFechaLlegada" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaLlegada" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<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: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>
<label for="<%= TxtEnvioDireccion.ClientID.ToString()%>">Calle:</label>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtEnvioNoExt" runat="server" CssClass="form-control" MaxLength="15"></asp:TextBox>
<label for="<%= TxtEnvioNoExt.ClientID.ToString()%>">No. Ext. </label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtEnvioNoInt" runat="server" CssClass="form-control" MaxLength="50"></asp:TextBox>
<label for="<%= TxtEnvioNoInt.ClientID.ToString()%>">No. Int.</label>
</div>
</div>
</div>
<div class="row ">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEnvioCP" runat="server" Width="100%" CssClass="form-control" CausesValidation="true" TextMode="Number" onblur="DirclienteValidaCodigoPostal()" onkeypress="if(event.key === 'Enter'){return false;}"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEnvioCP" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código Postal''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtEnvioCP.ClientID.ToString()%>">Código Postal:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClientePais" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlDirClientePais_SelectedIndexChanged" runat="server" DataTextField="Descripcion" DataValueField="CvePais" CssClass="form-control select2me" Width="100%" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClientePais" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClientePais" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pais''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClientePais.ClientID.ToString()%>">Pais:</label>
<i></i>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClienteEstado" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlDirClienteEstado_SelectedIndexChanged" runat="server" DataTextField="NombreEstado" DataValueField="CveEstado" CssClass="form-control select2me" Width="100%" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClienteEstado" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteEstado" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estado''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteEstado.ClientID.ToString()%>">Estado:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClienteMunicipio" AutoPostBack="true" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlDirClienteMunicipio_SelectedIndexChanged" runat="server" DataTextField="Descripcion" DataValueField="CveMunicipio" CssClass="form-control select2me" Width="100%" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClienteMunicipio" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteMunicipio" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Municipio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteMunicipio.ClientID.ToString()%>">Municipio:</label>
<i></i>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList runat="server" ID="DdlDirClienteLocalidad" CssClass="form-control select2me" DataValueField="CveLocalidad" DataTextField="NombreLocalidad" Width="100%" CausesValidation="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlDirClienteLocalidad" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteLocalidad" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Localidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteLocalidad.ClientID.ToString()%>">Localidad:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlDirClienteColonia" runat="server" AppendDataBoundItems="true" DataTextField="NombreAsentamiento" DataValueField="CveColonia" CssClass="form-control select2me" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlDirClienteColonia_SelectedIndexChanged" CausesValidation="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlDirClienteColonia" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlDirClienteColonia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Colonia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlDirClienteColonia.ClientID.ToString()%>">Colonia:</label>
<i></i>
</div>
</div>
<div class="col-md-6" runat="server" id="DvDistancia" visible="false">
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control" MaxLength="50" Width="100%" CausesValidation="true" TextMode="Number" onblur="DirclienteValidaCodigoPostal()" onkeypress="if(event.key === 'Enter'){return false;}"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtDistancia" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDistancia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Distancia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtDistancia.ClientID.ToString()%>">Distancia:</label>
</div>
</div>
</div>
<div style="display: none">
<asp:Button ID="BtnDirClienteValidar" ClientIDMode="Static" runat="server" CssClass="btn btn-primary" OnClick="BtnDirClienteValidar_Click" Text="validar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="BtnAgregarDireccion" runat="server" CssClass="btn btn-success" Text="Agregar" ValidationGroup="GrpObligatorio"></asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript" language="javascript">
function ValidaCantidad(input, valorInicial) {
var ValorActual = input.value;
if (ValorActual > valorInicial) {
//alert("El valor no puede ser mayor a la cantidad inicial: " + valorInicial);
input.value = valorInicial;
}
}
function ImprimirTraslado(clave) {
$get('BtnImprimirTraspaso').click();
}
function Focus() {
$('#TxtCodigoPS').focus()
}
function Focus1() {
$('#TxtCodigoPSRecepcion').focus()
}
function Focus2() {
$('#TxtSeriePSRecepcion').focus()
}
function playsonidito(NomArchivo) {
var URL = /Sonidos/ + NomArchivo
var snd = new Audio(URL);
snd.play();
snd.currentTime = 0;
}
//EXISTENCIAS ALMACEN
$('.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) {
var $this = $(this);
var ind = $this.index();
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
//log($this);
});
var scrollfuncion = function () {
var stop = this.scrollTop;
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
}
function CargaExistenciaAlmacenes(data, params) {
var div = $('<div class="select2anothertable"></div>');
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
var table = $('<table></table>'); div.append(table);
var tbody = $('<tbody></tbody>'); table.append(tbody);
$(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
$(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
var indexd = 0;
data.forEach(function (item) {
if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); }
}
}
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td ' + ((item[key] > 0) ? 'style = "font-weight:bold;"' : '') + '>' + item[key] + '</td>'); tr.append(td); }
}
indexd += 1;
});
}
</script>
</asp:Content>

File diff suppressed because it is too large Load Diff

View File

@@ -666,6 +666,7 @@ Partial Class Inventarios_EntradasSalidas
TxtHoraInicio.SelectedTime = Mov.Fecha
EstatusAlmacenCompra = Mov.EstatusAlmacenCompra
Folio = Mov.Folio
Dim drM As DataRow = DtMov.Rows(0)
If DtMov.Rows(0)("CveConcepto").ToString.ToEntero = 2 Then
@@ -773,13 +774,13 @@ Partial Class Inventarios_EntradasSalidas
CveCompra = Mov.CveCompra
CveConcepto = Mov.CveConcepto
If DtMov.Rows(0)("CveEstatusTimbrado").ToString.ToEntero > 0 Then
If drM("CveEstatusTimbrado").ToString.ToEntero > 0 Then
HplDescargaXml.Visible = True
HplDescargaXml.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "XML", $"Tra-{Folio}", "Tra")))
HplDescargaXml.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "XML", drM("TimbreSerieFolio"), "Tra")))
HplDescargaPdf.Visible = True
HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "PDF", $"Tra-{Folio}", "Tra")))
HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "PDF", drM("TimbreSerieFolio"), "Tra")))
If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
If drM("AplicaCP").ToString = "True" Then
HplCartaPorteTimbre.Visible = True
HplCartaPorteTimbre.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPOTIMBRE&CVEMOV={0}", CveMovimiento)))
Else

View File

@@ -2536,7 +2536,7 @@ Partial Class Inventarios_EntregaAlmacen
ErrorMovInv = True
Else
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
ImporteAlmacen = ObjInventario.DtResultados.SUMD("Total")
ImporteAlmacen = ObjInventario.DtResultados.SUMD("Total").RoundSQL
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero()) Then
@@ -2954,7 +2954,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
Dim ValorMultiplicador = 1
Dim ValorMultiplicador As Decimal = 1
If TipoMovimiento = 1 Then
ValorMultiplicador = 1

View File

@@ -170,7 +170,7 @@
<asp:GridView ID="GvEntregas" runat="server" AutoGenerateColumns="False"
DataKeyNames="SerieFolio,FechaIng,Nombre,CveVenta,CveCliente,NombreComercial,TipoDocto,CorreoNotificacion,CveVendedor,Orden,CveMovimiento,CveDireccionEnvio,CveSubProyectoOrigen"
DataKeyNames="SerieFolio,Nombre,CveVenta,CveCliente,NombreComercial,TipoDocto,CorreoNotificacion,CveVendedor,Orden,CveMovimiento,CveDireccionEnvio,CveSubProyectoOrigen"
EmptyDataText="No se encontraron registros" ToolTip="Listado de entregas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true"
@@ -289,10 +289,53 @@
<ajax:TabPanel ID="TabRecoleccion" runat="server" HeaderText="Recolección">
<ContentTemplate>
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="LnkGeneraRecoleccion" OnClick="LnkGeneraRecoleccion_Click">Recoleccion</asp:LinkButton>
<asp:UpdatePanel ID="UpDatosRecoleccion" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div1" >
<asp:DropDownList ID="DdlChoferRec" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVChoferRec" runat="server" Enabled="false" ControlToValidate="DdlChoferRec" 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="VCEChoferRec" runat="server" HighlightCssClass="vco" TargetControlID="RFVChoferRec" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlChoferRec.ClientID.ToString()%>">Chofer:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div2" >
<asp:DropDownList runat="server" ID="DdlUnidadRec" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" CausesValidation="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVUnidadRec" runat="server" Enabled="false" ControlToValidate="DdlUnidadRec" 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="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEUnidadRec" runat="server" HighlightCssClass="vco" TargetControlID="RFVUnidadRec" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlUnidadRec.ClientID.ToString()%>"> Unidad:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div3" >
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
<asp:TextBox ID="TxtFechaRec" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="ImgFechaEntregaRec" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaRec" runat="server" TargetControlID="TxtFechaRec" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaRec" TargetControlID="TxtFechaRec" PopupButtonID="ImgFechaEntregaRec" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaRec" runat="server" ControlToValidate="TxtFechaRec" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaRec" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaRec" Width="350px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtFechaRec.ClientID.ToString()%>"> F. Entrega:</label>
<i></i>
</div>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright" runat="server" id="Div4" >
<asp:CheckBox ID="ChkEmitirPorteRec" runat="server" Text="Carta Porte" />
<label for="<%= ChkEmitirPorteRec.ClientID.ToString()%>"> Emitir:</label>
<i></i>
</div>
<div class="col-md-1" runat="server" id="Div5">
</div>
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="LnkGeneraRecoleccion" OnClick="LnkGeneraRecoleccion_Click">Recoleccion</asp:LinkButton>
</div>
<div class="row">
<div class="col-md-12">
@@ -314,7 +357,12 @@
<%--<asp:BoundField HeaderText="SerieFolio" DataField="Serie Folio" HeaderStyle-Width="150px" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
<ItemTemplate>
&nbsp;<asp:Literal ID="LblFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:dd/MM/yyyy}") %>'></asp:Literal>
&nbsp;<asp:Literal ID="LblFechaEntrega" runat="server" Text='<%# Eval("FechaEntrega", "{0:dd/MM/yyyy}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
<ItemTemplate>
&nbsp;<asp:Literal ID="LblFolio" runat="server" Text='<%# Eval("FolioReferencia") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente" HeaderStyle-HorizontalAlign="Left">
@@ -441,6 +489,44 @@
<asp:Label runat="server" ID="LblSubProyectoRecoleccion" AssociatedControlID="DdlSubProyectoRecoleccion"></asp:Label>
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<div class="col-md-4">
<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;">
<asp:TextBox ID="TxtFechaLimite" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaLimite" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaLimite" runat="server" TargetControlID="TxtFechaLimite" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaLimite" TargetControlID="TxtFechaLimite" PopupButtonID="ImgFechaLimite" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaLimite" runat="server" ControlToValidate="TxtFechaLimite" 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="VCOFechaLimite" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaLimite" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RFVFechaLimite" 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="VCEFechaLimite" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaLimite" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" ID="Label3" AssociatedControlID="TxtFechaLimite" Text="Fecha Límite"></asp:Label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtFolioReferencia" CssClass="form-control" Width="100%" ></asp:TextBox>
<asp:Label runat="server" ID="Label1" AssociatedControlID="TxtFolioReferencia" Text="Folio"></asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox runat="server" ID="TxtReferencia" CssClass="form-control" Width="100%" ></asp:TextBox>
<asp:Label runat="server" ID="Label2" AssociatedControlID="TxtReferencia" Text="Referencia"></asp:Label>
</div>
</div>
</div>
<div class="row">

View File

@@ -155,7 +155,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
break;
}
DateTime fechallegada = (TxtFechaEntrega.Text + " 23:59").ToDate();
int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), CveDireccionOrigen, CveDireccionDestino, row.DataKey("CveMovimiento").ToEntero(), DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "E",Orden,0,1);
int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), CveDireccionOrigen, CveDireccionDestino, row.DataKey("CveMovimiento").ToEntero(), DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "E", "","", "1900-01-01".ToDate(), Orden,0, 1);
CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero();
if (CveEntregaAlmacen > 0)
@@ -249,13 +249,13 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
{
if (DdlChofer.SelectedValue.ToEntero() <= 0)
if (DdlChoferRec.SelectedValue.ToEntero() <= 0)
{
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
}
if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
if (DdlUnidadRec.SelectedValue.ToEntero() <= 0)
{
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
return;
@@ -284,22 +284,32 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
if (CveEntregaAlmacen > 0)
{
int CveTimbre = ObjGeneral.AddGralTimbre("Rec", row.DataKey("CveSubProyecto").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:CveEntregaAlmacen , AplicaCP: ChkEmitirCartaPorte.Checked);
if (CveTimbre <= 0)
// se actualizan los datos de unidad, chofer, fechas y Carta porte
if (ObjGeneral.AsignaEntregaAlmacenRuta(DdlUnidadRec.SelectedValue.ToEntero(), DdlChoferRec.SelectedValue.ToEntero(), TxtFechaRec.Text.ToDate(), CveEntregaAlmacen, UsuarioActual.CveEmpresa))
{
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. ");
TieneError = true;
break;
int CveTimbre = ObjGeneral.AddGralTimbre("Rec", row.DataKey("CveSubProyecto").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: ChkEmitirPorteRec.Checked);
if (CveTimbre <= 0)
{
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. ");
TieneError = true;
break;
}
else
{
ListaTimbres.Add(CveTimbre);
}
}
else
{
ListaTimbres.Add(CveTimbre);
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al aplicar condiciones de entrega. ");
TieneError = true;
break;
}
}
else
{
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega alamcen. ");
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega almacen. ");
TieneError = true;
break;
}
@@ -405,10 +415,12 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
private void CargaCombos()
{
DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
DdlUnidadCamion.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUnidadCamion.DataBind();
DdlUnidadRec.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
DdlUnidadRec.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUnidadRec.DataBind();
TxtFechaI.Text = DateTime.Now.AddDays(-1).ToShortDateString();
TxtFechaF.Text = DateTime.Now.ToShortDateString();
@@ -416,6 +428,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
DdlChofer.DataSource = get_GlobalDTChoferes(UsuarioActual.CveEmpresa);
DdlChofer.DataBind();
DdlChofer.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlChoferRec.DataSource = get_GlobalDTChoferes(UsuarioActual.CveEmpresa);
DdlChoferRec.DataBind();
DdlChoferRec.Items.Insert(0, new ListItem("Seleccione", "-1"));
TxtFechaEntrega.Text = DateTime.Now.ToShortDateString();
@@ -799,7 +814,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
if( CveEntregaAlmacen == -1)
{
DateTime fechallegada = (TxtFechaEntrega.Text + " 23:59").ToDate();
CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada , "R", 1,0,1);
CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), fechallegada, "R",TxtFolioReferencia.Text, TxtReferencia.Text, TxtFechaLimite.Text.ToDate(), 1,0,1) ;
if (CveEntregaAlmacen > 0)
{
//CveTimbrenuevo = ObjGenerales.AddGralTimbre("Rec", "-1", -1, "-1", TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, -1);

View File

@@ -339,7 +339,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
Timbres ObjTimbres = new Timbres("Tra", cvetimbre, UsuarioActual);
StringBuilder MensajeAlert = new StringBuilder();
MensajeAlert.AppendFormat("Folio: <b>{0}</b> &nbsp;", ObjTimbres.ObjFactura.SerieFolio);
if (ObjTimbres.Timbrar())
if (ObjTimbres.MsgError =="" && ObjTimbres.Timbrar())
{
MensajeAlert.AppendFormat("<a class='texto' style='color:#337ab7' href='/Compras/PopUpVerFactura.aspx?P={0}' target='_blank'>XML &nbsp;<i class='fa fa-file'></i></i></a>&nbsp;&nbsp;", ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CveTimbre={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", cvetimbre, "XML", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)));
Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion);

View File

@@ -204,29 +204,25 @@ Partial Class Inventarios_TraspasoAlmacen
divEmitir.Visible = False
End If
If UsuarioActual.CveEmpresa.Contiene(1, 119, 140, 2) Then
If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
ChkEmitirTimbrado.Checked = True
End If
If UsuarioActual.CveEmpresa.Contiene(1, 2, 119, 140) Then
ChkEmitirCartaPorte.Visible = True
End If
CantidadTotal = 0
CvePS = 0
TipoSeccionAlmacen = 0
CvePS = 0
TipoSeccionAlmacen = 0
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
TxtFecha.Enabled = False
ImgFecha.Visible = False
TxtFecha.Enabled = False
ImgFecha.Visible = False
TxtFechaRecepcion.Enabled = False
ImgFechaRecepcion.Visible = False
TxtFechaRecepcion.Enabled = False
ImgFechaRecepcion.Visible = False
End If
End If
Else
If ChkTransitorio.Checked Then
@@ -731,19 +727,19 @@ Partial Class Inventarios_TraspasoAlmacen
#Region " GUARDAR "
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
If ChkEmitirTimbrado.Checked Then
'If ChkEmitirTimbrado.Checked Then
If DdlChofer.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar un chofer")
Exit Sub
End If
If DdlUnidadCamion.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar una unidad")
Exit Sub
End If
' If DdlChofer.SelectedValue.ToEntero <= 0 Then
' Alert("Debe de seleccionar un chofer")
' Exit Sub
' End If
' If DdlUnidadCamion.SelectedValue.ToEntero <= 0 Then
' Alert("Debe de seleccionar una unidad")
' Exit Sub
' End If
End If
'End If
'VALIDA ALMACEN ORIGEN Y DESTINO
If DdlAlmacenOrigen.SelectedValue = DdlAlmacenDestino.SelectedValue Then
@@ -1154,8 +1150,9 @@ Partial Class Inventarios_TraspasoAlmacen
Dim ObjGral As New ClsGenerales(ObjInventario.IniciaTransacSQL)
Dim CveSubProyectoTimbre As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero
Dim Fechallegada As DateTime = (TxtFechaLlegada.Text & " 23:59:59").ToDateTime
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, TxtFechaLlegada.Text.ToDatetime, "T", 1, 1, 1)
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(CveSubProyectoTimbre, -1, -1, CveMovimientoSalida, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, TxtFechaEntrega.Text.ToDate, Fechallegada, "T", "", "", MinFecha, 1, 1, 1)
If CveEntregaAlmacen > 0 Then
CveTimbre = ObjGral.AddGralTimbre("Tra", CveSubProyectoTimbre, TxtFechaEntrega.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=ChkEmitirCartaPorte.Checked)

View File

@@ -904,7 +904,7 @@ Partial Class RH_CatPersonal
Catalogos.Cell(crow, ccol).Value = "Estado"
For Each row As DataRow In GlobalDTGralEstados("MEX").Rows
crow = crow + 1
Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("Estado"))
Catalogos.Cell(crow, ccol).Value = String.Format("{0}: {1}", row("CveEstado"), row("NombreEstado"))
Next
colEstado = ccol
rowEstado = crow

File diff suppressed because it is too large Load Diff

View File

@@ -800,20 +800,31 @@ Partial Class Ventas_ClientesAbonar
Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False)
Dim TipoCambioFluctuacion As Decimal = 1
Dim FechaUltimaFluctuacion As Date = MinFecha
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
End If
Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
dtConceptos = ObjMov.DtResultados
End If
@@ -2554,24 +2565,35 @@ Partial Class Ventas_ClientesAbonar
Dim CvePrePoliza As Integer = 0
Dim MsgError As String = ""
Dim ObjIE As New ClsBancos
'Dim ObjIE As New ClsBancos
Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaIncobrable.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then
FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
End If
Dim tFecha As Date = TxtFechaIncobrable.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
ObjIE.Dispose()
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaIncobrable.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
'ObjIE.Dispose()
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFechaIncobrable.Text.ToDate, TxtObsSaldarIncobrable.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)

View File

@@ -4388,7 +4388,7 @@ Partial Class Ventas
DdlTipoComprobante.Items.Insert(0, New ListItem("Devolucion", "Dev"))
HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto"))))
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
ViewState("CveDevolucion") = DbRowVenta("CveVentaPadre").ToString().ToEntero()
'ViewState("CveDevolucion") = DbRowVenta("CveVentaPadre").ToString().ToEntero()
Trsaldo.Visible = True
HplSaldoAuxiliar.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
HplPagado.NavigateUrl = String.Format("/Contabilidad/PopUpAuxiliar.aspx?Tipo=CxCClientes&CveCliente={0}&CveVenta={1}&TB_iframe=true&height=550&width=920", DbRowVenta("CveCliente"), DbRowVenta("CveVenta"))
@@ -6286,7 +6286,7 @@ Partial Class Ventas
Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595)
'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then
RBLPago.SelectedValue = "2"
RBLPago.Items(0).Enabled = False
RBLPago_SelectedIndexChanged(Nothing, Nothing)
@@ -14615,20 +14615,31 @@ Partial Class Ventas
Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = Now 'gvr.DataKey("Fecha").ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
Dim tFecha As Date = Now
If drr IsNot Nothing Then
FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
End If
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = Now 'gvr.DataKey("Fecha").ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
tipoCambioPago = 1
tipoCambioVenta = 1
@@ -23944,6 +23955,7 @@ Partial Class Ventas
For Each Dr2 As DataRow In DtContratosSerieDetalle.FiltraParametros($"ConsecId = {Dr("CveContratoDetalle")}").Rows
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, Serie:=Dr2("Serie").ToString(), FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < 1 Then
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato},Serie:{Dr2("Serie").ToString()}")
Return False
End If
@@ -23956,6 +23968,7 @@ Partial Class Ventas
Else
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, factura.CveEmpresa, CveAlmacenExistenciasContrato, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then
GuardaLogAD($"El producto no tiene existencia: CvePS:{CveProducto},CveUnidad:{CveUnidad},Cantidad: {Cantidad},Existencia: {Existencia},CveAlmacen:{CveAlmacenExistenciasContrato}")
Return False
End If
@@ -24728,24 +24741,34 @@ Partial Class Ventas
Dim CvePrePoliza As Integer = 0
Dim MsgError As String = ""
Dim ObjIE As New ClsBancos
'Dim ObjIE As New ClsBancos
Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFechaSaldarVenta.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then
FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
End If
Dim tFecha As Date = TxtFechaSaldarVenta.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If
End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaSaldarVenta.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
ObjIE.Dispose()
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
' ObjIE.Dispose()
Dim IdCtaContable As Integer = IdCtaContClientes
@@ -27728,20 +27751,29 @@ Partial Class Ventas
TipoCambioFactura = TxtTipoCambio.Text.ToDecimal
If DdlMoneda.SelectedValue.ToEntero() > 1 Then
Dim ObjIE As New ClsBancos
If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.Rows.Count > 0 Then
Dim tFecha As Date = TxtFecha.Text.ToDate
Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha > #" & Fecha & "#", "Fecha DESC")
If drr IsNot Nothing Then
TipoCambioFactura = drr("TipoCambio").ToString().ToDecimal
End If
Dim tFecha As Date = TxtFecha.Text.ToDate
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion > tFecha Then
TipoCambioFactura = UltimaFluctuacion.TCFluctuacion
End If
End If
ObjIE.Dispose()
'Dim ObjIE As New ClsBancos
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFecha.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha > #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' TipoCambioFactura = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
'ObjIE.Dispose()
Else
TipoCambioFactura = 1
End If