Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -2021,7 +2021,7 @@ Public Class ClsClientes
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateEstatusPedido(CveVenta As Integer, CveEstatusFactura As Integer, Dias As Integer, CveUsuario As Integer) As Boolean
|
||||
Public Function UpdateEstatusPedido(CveVenta As Integer, CveEstatusFactura As Integer, Dias As Integer, CveUsuario As Integer, Optional CveRemision As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ClienteVentasPedidoEstatusUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -2029,6 +2029,7 @@ Public Class ClsClientes
|
||||
.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura
|
||||
.Add("@Dias", SqlDbType.Int).Value = Dias
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveRemision", SqlDbType.Int).Value = CveRemision
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -2037,28 +2038,28 @@ Public Class ClsClientes
|
||||
OnError("Ocurrió un error al actualizar el pedido del cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
'Public Function UpdateFechaPedido(CveVenta As Integer, DiasCredito As Integer) As Boolean
|
||||
' Dim Retorno As Boolean = False
|
||||
' DataAdapter("PA_Vta_ClienteVentasPedidoFechaUpdate")
|
||||
' With SqlAdapter.SelectCommand.Parameters
|
||||
' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
' .Add("@DiasCredito", SqlDbType.Int).Value = DiasCredito
|
||||
' End With
|
||||
' Try
|
||||
' SqlAdapter.Fill(Data)
|
||||
' Retorno = True
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al actualizar la fecha del pedido del cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
' End Try
|
||||
' Return Retorno
|
||||
'End Function
|
||||
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
'Public Function UpdateFechaPedido(CveVenta As Integer, DiasCredito As Integer) As Boolean
|
||||
' Dim Retorno As Boolean = False
|
||||
' DataAdapter("PA_Vta_ClienteVentasPedidoFechaUpdate")
|
||||
' With SqlAdapter.SelectCommand.Parameters
|
||||
' .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
' .Add("@DiasCredito", SqlDbType.Int).Value = DiasCredito
|
||||
' End With
|
||||
' Try
|
||||
' SqlAdapter.Fill(Data)
|
||||
' Retorno = True
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al actualizar la fecha del pedido del cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
' End Try
|
||||
' Return Retorno
|
||||
'End Function
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "A P L I C A C I O N"
|
||||
Public Function AddClienteApp(Cliente As MCliente) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -68,6 +68,11 @@ Public Class ClsContabilidad
|
||||
Public Property ValorPolizaDescuadre As Integer
|
||||
Public Property MensajePolizaDescuadre As String
|
||||
Public Property ValorDiferencia As String
|
||||
|
||||
Public Property SeUnifico As Boolean = False
|
||||
Public Property YaEstabaUnifida As Boolean = False
|
||||
Public Property EstaContabilizada As Boolean = False
|
||||
|
||||
#End Region
|
||||
|
||||
Public Function IniciaTransacSQL() As SqlTransaction
|
||||
@@ -756,16 +761,30 @@ Public Class ClsContabilidad
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
SeUnifico = False
|
||||
YaEstabaUnifida = False
|
||||
EstaContabilizada = False
|
||||
|
||||
DataAdapter("PA_Conta_PrePolizaUnificacion")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
|
||||
.Add("@CvePrePolizaVieja", SqlDbType.Int).Value = CvePrePolizaVieja
|
||||
.Add("@SeUnifico", SqlDbType.Bit).Direction = ParameterDirection.Output
|
||||
.Add("@YaEstabaUnifida", SqlDbType.Bit).Direction = ParameterDirection.Output
|
||||
.Add("@EstaContabilizada", SqlDbType.Bit).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
SeUnifico = Boolean.Parse(SqlAdapter.SelectCommand.Parameters("@SeUnifico").Value.ToString)
|
||||
YaEstabaUnifida = Boolean.Parse(SqlAdapter.SelectCommand.Parameters("@YaEstabaUnifida").Value.ToString)
|
||||
EstaContabilizada = Boolean.Parse(SqlAdapter.SelectCommand.Parameters("@EstaContabilizada").Value.ToString)
|
||||
|
||||
Retorno = True
|
||||
|
||||
Catch ex1 As SqlException
|
||||
OnError("Ocurrió un error al actualizar la Poliza Original", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
Catch ex As Exception
|
||||
@@ -773,6 +792,7 @@ Public Class ClsContabilidad
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function PrePolizaSimplificacion(CvePrePoliza As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
@@ -1308,7 +1308,11 @@ Public Class ClsInventarios
|
||||
If Ex1.Message.Contains("50019") Then
|
||||
Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
If Ex1.Message.Contains("50021") Then
|
||||
Me.OnError(" El producto ingresado previamente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -1480,7 +1484,9 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Public Function GetKardexAlmacenHorizontal(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer, IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0, Optional Orden As Integer = -1, Optional Marcas As String = "-1") As Boolean
|
||||
Public Function GetKardexAlmacenHorizontal(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer,
|
||||
IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0,
|
||||
Optional Orden As Integer = -1, Optional Marcas As String = "-1", Optional IncluyeProyectado As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_KardexAlmacenHorizontalGet")
|
||||
@@ -1500,6 +1506,7 @@ Public Class ClsInventarios
|
||||
.Add("@ExistenciasCondicion", SqlDbType.Int).Value = CondicionExistencias
|
||||
.Add("@Orden", SqlDbType.Int).Value = Orden
|
||||
.Add("@Marcas", SqlDbType.VarChar).Value = Marcas
|
||||
.Add("@IncluyeProyectado", SqlDbType.TinyInt).Value = IncluyeProyectado
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -1355,13 +1355,15 @@ Public Class ClsProductosServicios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemovePSAlias(CvePS As Integer, PSAlias As String) As Boolean
|
||||
Public Function RemovePSAlias(CvePS As Integer, PSAlias As String, CveUsuarioModifico As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Gral_ProductosServiciosAliasRemove")
|
||||
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@PSAlias", SqlDbType.VarChar).Value = PSAlias
|
||||
SqlAdapter.SelectCommand.Parameters.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
|
||||
@@ -1285,6 +1285,8 @@ Public Class ClsVentas
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@EstatusDevolucion", SqlDbType.TinyInt).Value = EstatusDevolucion
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
'.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
'.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -3332,7 +3332,7 @@ Namespace Modelos
|
||||
|
||||
'SI ES FACTURACION DE UNA REMISION CANCELAMOS, TRASPASAMOS SALDOS Y AGREGAMOS EVENTO A LA BITACORA
|
||||
'NO DEBE ENTRAR SI SE ESTA CANCELANDO UNA FACTURA
|
||||
If ValorMultiplicador <> -1 AndAlso (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0 Then
|
||||
If ValorMultiplicador <> -1 AndAlso ((DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0) Then
|
||||
|
||||
If Not ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then
|
||||
ErrorPrepoliza = True
|
||||
@@ -7503,20 +7503,48 @@ Namespace Modelos
|
||||
HttpContext.Current.Application("GlobalDTSeccionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTAlmacen(CveEmpresa As Integer) As DataTable
|
||||
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable
|
||||
Get
|
||||
If CveEmpresa <> -1 Then
|
||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
||||
GlobalDTAlmacen = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
GlobalDTAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable)
|
||||
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
|
||||
'sino existe, recarga los datos
|
||||
If HttpContext.Current.Application(AppNombre) Is Nothing Then
|
||||
Dim ObjUsr As New ClsInventarios
|
||||
If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
|
||||
ObjUsr.Dispose()
|
||||
End If
|
||||
|
||||
Dim Str As New StringBuilder
|
||||
Str.Append("1=1 AND ")
|
||||
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
|
||||
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
|
||||
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
|
||||
If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
|
||||
|
||||
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
|
||||
GlobalDTAlmacen = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
HttpContext.Current.Application("GlobalDTAlmacen") = value
|
||||
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
|
||||
HttpContext.Current.Application(AppNombre) = value
|
||||
End Set
|
||||
'Get
|
||||
|
||||
' Dim Str As New StringBuilder
|
||||
' Str.Append("1=1 AND ")
|
||||
' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
|
||||
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
|
||||
' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
|
||||
' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
|
||||
|
||||
' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
|
||||
' GlobalDTAlmacen = Dv.ToTable
|
||||
' Dv.Dispose()
|
||||
|
||||
'End Get
|
||||
'Set(value As DataTable)
|
||||
' Application("GlobalDTAlmacen") = value
|
||||
'End Set
|
||||
End Property
|
||||
Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable
|
||||
Get
|
||||
|
||||
@@ -509,7 +509,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
'End If
|
||||
'ObjClientes.Dispose()
|
||||
|
||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros(String.Format("NombreComercial like '%{0}%' OR Nombre like '%{0}%' ", Name))
|
||||
End If
|
||||
@@ -557,7 +557,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
' DtRetorno = ObjProveedores.DtResultados
|
||||
'End If
|
||||
'ObjProveedores.Dispose()
|
||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
|
||||
End If
|
||||
|
||||
@@ -5385,6 +5385,7 @@ Partial Class Compras_Compras
|
||||
'P R E P O L I Z A S
|
||||
|
||||
Dim CveConceptoAfectacion As Integer = 5 'Proveedores
|
||||
Dim CveConceptoOriginal As Integer
|
||||
If CveTipoConcepto = 2 Then CveConceptoAfectacion = 305 'cuando es acreedor
|
||||
If CveMoneda <> 1 Then
|
||||
Select Case CveConceptoAfectacion
|
||||
@@ -5782,7 +5783,7 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim CveSubProyectoInsertar As Integer = -1
|
||||
|
||||
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
|
||||
Dim ConceptoContable As Integer = Row("CveConcepto").ToString.ToEntero
|
||||
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
Dim importeMovimiento As Decimal = 0
|
||||
Dim IdCtaContable As Integer = 0
|
||||
@@ -5792,7 +5793,7 @@ Partial Class Compras_Compras
|
||||
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1)
|
||||
Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation
|
||||
Dim PorcentajeImpuesto As Decimal = 0
|
||||
|
||||
CveConceptoOriginal = ConceptoContable
|
||||
|
||||
Select Case ConceptoContable
|
||||
|
||||
@@ -7186,7 +7187,7 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = importeMovimiento.Abs.RoundSQL()
|
||||
importeMN = importeMovimiento
|
||||
If importeMovimiento <> 0 Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -7632,8 +7633,8 @@ Partial Class Compras_Compras
|
||||
If ErrorPrepoliza Then
|
||||
Exit For
|
||||
End If
|
||||
', 305, 306, 311
|
||||
If importeMovimiento <> 0 Or (ConceptoContable.Contiene(5) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac", "Ant")) Or (ConceptoContable.Contiene(18) AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not GuardoConcepto18) Then
|
||||
'5, 305, 306, 311
|
||||
If importeMovimiento <> 0 Or (CveConceptoOriginal = 5 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac", "Ant")) Or (ConceptoContable.Contiene(18) AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not GuardoConcepto18) Then
|
||||
'Conta ContPAQ
|
||||
If IdCtaContable = 0 Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
@@ -9341,7 +9342,11 @@ Partial Class Compras_Compras
|
||||
ErrorMovtosCxP = 1
|
||||
Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError)
|
||||
End If
|
||||
CvePrePolizaNueva = CvePrepolizaPadre 'para que se unifique siempre la prepolizanueva
|
||||
|
||||
If ObjConta.SeUnifico Then
|
||||
CvePrePolizaNueva = CvePrepolizaPadre 'para que se unifique siempre la prepolizanueva
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'Simplificacion de PrePolizas
|
||||
@@ -15490,11 +15495,11 @@ Partial Class Compras_Compras
|
||||
'If DdlOCVinculaInv.SelectedValue.ToEntero = 237 And Not CveFlete > 0 Then Alert("Necesita vincular un flete si selecciona Factura de Flete", TipoMensaje.MsgAdvertencia) : Exit Sub
|
||||
'If DdlOCVinculaInv.SelectedValue.ToEntero = 240 And Not CveImportacion > 0 Then Alert("Necesita vincular una Importación si selecciona Factura de Importación", TipoMensaje.MsgAdvertencia) : Exit Sub
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 And DdlTipoComprobante.SelectedValue = "Fac" Then
|
||||
If Not VerificarProductosCompraConOC() Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
'If UsuarioActual.CveEmpresa = 119 And DdlTipoComprobante.SelectedValue = "Fac" Then
|
||||
' If Not VerificarProductosCompraConOC() Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
'End If
|
||||
|
||||
Dim SubTotalGV = 0.0D
|
||||
Dim Amortizacion As Decimal = TmpDT.SUMD("Total")
|
||||
|
||||
@@ -1281,10 +1281,10 @@ Partial Class PopUpVerFactura
|
||||
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||
CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero()
|
||||
If CveConcepto.Contiene(3, 26) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
|
||||
If CveConcepto.Contiene(2, 3, 26, 27) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
|
||||
CveConceptoMovtoRelacionado = 37
|
||||
ElseIf CveConcepto = 37 Then
|
||||
ElseIf CveConcepto.Contiene(36, 37) Then
|
||||
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
|
||||
CveConceptoMovtoRelacionado = 3
|
||||
End If
|
||||
@@ -1413,7 +1413,7 @@ Partial Class PopUpVerFactura
|
||||
ImprimirPDF("Empresas/Grales/Formatos/Inicial.rdlc", DtMovimientos, params, String.Format("Inventario Inicial - {0}", Folio), RDSName:="DsInventarios")
|
||||
End If
|
||||
|
||||
Case 2, 32, 33 ' E N T R A D A S
|
||||
Case 2, 32, 33, 36 ' E N T R A D A S
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
@@ -1501,7 +1501,39 @@ Partial Class PopUpVerFactura
|
||||
End If
|
||||
|
||||
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Entradas.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio), RDSName:="DsInventarios")
|
||||
ElseIf UsuarioActual.CveEmpresa = 140 Then
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
Dim concepto As String = ""
|
||||
If CveConcepto.Contiene(2, 32, 33) Then
|
||||
concepto = "ENTRADA DE ALMACÉN"
|
||||
ElseIf CveConcepto.Contiene(36) Then
|
||||
concepto = "ENTRADA VIRTUAL"
|
||||
End If
|
||||
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("Concepto", concepto))
|
||||
params.Add(New ReportParameter("Almacen", Almacen))
|
||||
params.Add(New ReportParameter("Fecha", Fecha))
|
||||
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
|
||||
params.Add(New ReportParameter("Folio", Folio))
|
||||
params.Add(New ReportParameter("FacturadoA", NombreCliente))
|
||||
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, "")))
|
||||
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
|
||||
params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), "")))
|
||||
params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), "")))
|
||||
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
|
||||
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
|
||||
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
|
||||
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
|
||||
|
||||
ImprimirPDF(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
|
||||
Else
|
||||
|
||||
params.Add(New ReportParameter("TipoDocumento", String.Format("Compras {0}", Almacen)))
|
||||
params.Add(New ReportParameter("Fecha", If(CveCompra > 0, dr("Fecha").ToString.ToDate.ToShortDateString, "")))
|
||||
params.Add(New ReportParameter("Folio", Folio.ToString))
|
||||
@@ -2255,7 +2287,9 @@ Partial Class PopUpVerFactura
|
||||
|
||||
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
|
||||
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -434,6 +434,9 @@
|
||||
</TablixMember>
|
||||
<TablixMember>
|
||||
<Group Name="Details" />
|
||||
<TablixMembers>
|
||||
<TablixMember />
|
||||
</TablixMembers>
|
||||
</TablixMember>
|
||||
</TablixMembers>
|
||||
</TablixRowHierarchy>
|
||||
@@ -465,8 +468,8 @@
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox2</rd:DefaultName>
|
||||
<Top>1.39318cm</Top>
|
||||
<Left>0.25984cm</Left>
|
||||
<Top>1.99643cm</Top>
|
||||
<Left>0.22809cm</Left>
|
||||
<Height>0.6cm</Height>
|
||||
<Width>11.36782cm</Width>
|
||||
<ZIndex>1</ZIndex>
|
||||
@@ -480,8 +483,40 @@
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<Textbox Name="Textbox28">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>= "Total: " & FormatNumber(Sum(Fields!Cantidad.Value, "DsInventarios"),0)</Value>
|
||||
<Style>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox28</rd:DefaultName>
|
||||
<Top>1.33674cm</Top>
|
||||
<Left>0.22985cm</Left>
|
||||
<Height>0.6cm</Height>
|
||||
<Width>2.5cm</Width>
|
||||
<ZIndex>2</ZIndex>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</ReportItems>
|
||||
<Height>0.82291in</Height>
|
||||
<Height>1.05208in</Height>
|
||||
<Style />
|
||||
</Body>
|
||||
<Width>8.1198in</Width>
|
||||
|
||||
@@ -217,7 +217,7 @@ Partial Class Inventarios_CatAlmacenes
|
||||
GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing
|
||||
'Dim ObjAlmacen As New ClsInventarios
|
||||
'If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then
|
||||
' GlobalDTAlmacen(-1) = ObjAlmacen.DtResultados
|
||||
' Application("GlobalDTAlmacen") = ObjAlmacen.DtResultados
|
||||
'End If
|
||||
'ObjAlmacen.Dispose()
|
||||
End Sub
|
||||
|
||||
@@ -1519,7 +1519,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, obs, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
|
||||
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, DdlConcepto.SelectedValue.ToEntero, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor)
|
||||
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, DdlConcepto.SelectedValue.ToEntero, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor, Modulo:="ES/1")
|
||||
|
||||
|
||||
If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then
|
||||
@@ -1961,7 +1961,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Dim ObjInv As New ClsInventarios
|
||||
|
||||
If CveMovimiento <= 0 Then
|
||||
CveMovimiento = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, DdlConcepto.SelectedValue.ToEntero, 1, TxtFecha.Text.ToDate, TxtFolio.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
|
||||
CveMovimiento = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, DdlConcepto.SelectedValue.ToEntero, 1, TxtFecha.Text.ToDate, TxtFolio.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="ES/CS1")
|
||||
End If
|
||||
|
||||
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=SerieLote)
|
||||
@@ -3837,7 +3837,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
'MOVIMIENTO DE ENTRADA
|
||||
If DtMovimientosEntradaInvFisico.Rows.Count > 0 Then
|
||||
Dim FolioEntrada As Integer = ObjInventario.GetFolioSiguiente(32, UsuarioActual.CveEmpresa)
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 32, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtIFDescripcion.Text.Trim)
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 32, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtIFDescripcion.Text.Trim, Modulo:="ES/AJ1")
|
||||
Else
|
||||
CveMovimientoEntrada = -1
|
||||
End If
|
||||
@@ -3845,7 +3845,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
'MOVIMIENTO DE SALIDA
|
||||
If DtMovimientosSalidaInvFisico.Rows.Count > 0 Then
|
||||
Dim FolioSalida As Integer = ObjInventario.GetFolioSiguiente(34, UsuarioActual.CveEmpresa)
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 34, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoEntrada, Observaciones:=TxtIFDescripcion.Text.Trim)
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 34, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoEntrada, Observaciones:=TxtIFDescripcion.Text.Trim, Modulo:="ES/AJ2")
|
||||
|
||||
End If
|
||||
|
||||
@@ -4132,19 +4132,21 @@ Partial Class Inventarios_EntradasSalidas
|
||||
End Sub
|
||||
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||
Dim dt As New DataTable
|
||||
Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||
'Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||
Dim ErrorArchivo = False
|
||||
Dim n As Integer = 0
|
||||
Try
|
||||
Select Case Tipo
|
||||
Case "EXCEL"
|
||||
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
Conexion.Open()
|
||||
Dim cmd = Conexion.CreateCommand()
|
||||
cmd.CommandType = CommandType.Text
|
||||
cmd.CommandText = "Select * FROM [Hoja1$]"
|
||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
DataAdapter.Fill(dt)
|
||||
dt = ReadExcelFile(Ruta + FileName, True)
|
||||
dt = dt.FiltraParametros("Cantidad <> '' ")
|
||||
'Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
'Conexion.Open()
|
||||
'Dim cmd = Conexion.CreateCommand()
|
||||
'cmd.CommandType = CommandType.Text
|
||||
'cmd.CommandText = "Select * FROM [Hoja1$]"
|
||||
'Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
'DataAdapter.Fill(dt)
|
||||
Case Else
|
||||
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
@@ -4153,7 +4155,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
ErrorArchivo = True
|
||||
OnError("Ocurrio un Error al leer el archivo <br/>" & ex.Message, ex)
|
||||
End Try
|
||||
Conexion.Close()
|
||||
' Conexion.Close()
|
||||
If Not ErrorArchivo Then
|
||||
If Not dt.Columns(0).ColumnName = "Cantidad" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Cantidad'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
@@ -4299,7 +4301,12 @@ Partial Class Inventarios_EntradasSalidas
|
||||
Dim StrReturn As String = String.Empty
|
||||
Dim CvePS As Integer = 0
|
||||
Dim Condicion As String = String.Format("{0} = '{1}'", Opt, Valor)
|
||||
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Condicion).ToString.ToEntero
|
||||
If Opt = "Codigo" Then
|
||||
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Valor).FiltroPrimeroValor("CvePS", "").ToString.ToEntero
|
||||
Else
|
||||
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Condicion).ToString.ToEntero
|
||||
End If
|
||||
|
||||
If CvePS > 0 Then
|
||||
StrReturn = "True|" & CvePS.ToString
|
||||
Else
|
||||
|
||||
@@ -41,12 +41,13 @@ Partial Class Inventarios_Kardex
|
||||
If Request("FechaI") IsNot Nothing AndAlso Request("FechaI") <> "-1" Then TxtFechaI.Text = Request("FechaI").ToString
|
||||
If Request("FechaF") IsNot Nothing AndAlso Request("FechaF") <> "-1" Then TxtFechaF.Text = Request("FechaF").ToString
|
||||
|
||||
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
||||
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
'If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
||||
'ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
|
||||
If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then
|
||||
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty)
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
CargaPermisos()
|
||||
@@ -257,7 +258,14 @@ Partial Class Inventarios_Kardex
|
||||
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
||||
Dim CveAlmacen As Integer = -1
|
||||
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
|
||||
If CvePS > 0 Then ddlProducto2.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "")
|
||||
If CvePS > 0 Then
|
||||
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||
If dr IsNot Nothing Then
|
||||
ddlProducto2.SelectedText = dr("PSCodigo").ToString
|
||||
ddlProducto2.SelectedValue = CvePS.ToString
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim CveTiposAlmacen = ""
|
||||
For Each item As ListItem In CBLTiposAlmacen.Items
|
||||
|
||||
@@ -134,7 +134,7 @@ Partial Class Inventarios_KardexAlmacen
|
||||
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
|
||||
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
|
||||
|
||||
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas) Then
|
||||
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=0) Then
|
||||
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
|
||||
dt = ObjMovimientos.DtResultados
|
||||
Dim ListaBorrar As New List(Of DataColumn)
|
||||
|
||||
@@ -2882,6 +2882,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 140 AndAlso TipoMovimiento = 3 Then
|
||||
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 2, UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'AGREGA BITACORA TEMPORAL
|
||||
If DtBitacora IsNot Nothing AndAlso DtBitacora.Rows.Count > 0 Then
|
||||
ErrorMovInv = GuardaBitacoraTemporal(ObjBitacora, CveMovimiento)
|
||||
|
||||
@@ -2077,6 +2077,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Me.ObjRemisionNC.TipoDocumento = "Remisión"
|
||||
'NUM 1- CARGO 2- BONIFICACION
|
||||
Me.ObjRemisionNC.Num1 = 1
|
||||
'NUM 0- USADO 1- AJUSTE/GARANTIA
|
||||
Me.ObjRemisionNC.Num2 = RblUsadosAjuste.SelectedValue.ToEntero()
|
||||
Me.ObjRemisionNC.Alfa1 = ""
|
||||
Me.ObjRemisionNC.Alfa2 = ""
|
||||
Me.ObjRemisionNC.Alfa3 = ""
|
||||
@@ -2093,8 +2095,6 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Me.ObjRemisionNC.SetCliente()
|
||||
Me.ObjRemisionNC.CveAlmacen = -1
|
||||
|
||||
|
||||
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
@@ -2133,6 +2133,9 @@ Partial Class Inventarios_RecepcionUsados
|
||||
'DETALLES
|
||||
Me.ObjRemisionNC.DtDetalle = CreaDTDetalleRNC()
|
||||
|
||||
'GUARDAR AJUSTES
|
||||
Me.ObjRemisionNC.DtAjustes = TmpDTAjustes
|
||||
|
||||
'VALIDA PROMOCIONES Y EXISTENCIAS
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then
|
||||
@@ -2517,37 +2520,6 @@ Partial Class Inventarios_RecepcionUsados
|
||||
TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDTAjustes.Columns.Add("PUFactura", GetType(Double))
|
||||
End Sub
|
||||
Private Sub CargaAjusteDetalle()
|
||||
Dim Dr As DataRow = Nothing
|
||||
IndexAjuste = 0
|
||||
For Each Dr2 As DataRow In TmpDTAjustes.Rows
|
||||
If Dr2("ConsecutivoVenta").ToString.ToEntero = ConsecutivoVenta Then
|
||||
Dr = Dr2
|
||||
Exit For
|
||||
End If
|
||||
IndexAjuste += 1
|
||||
Next
|
||||
If Dr IsNot Nothing Then
|
||||
IndexAjuste = TmpDTAjustes.Rows.IndexOf(Dr)
|
||||
DdlFolioGarantia.SelectedValueExist(Dr("CveFolioGarantia").ToString)
|
||||
TxtConsecutivoAjuste.Text = Dr("Consecutivo").ToString
|
||||
TxtCodEnsamble.Text = Dr("CodigoEnsamble").ToString
|
||||
DdlTipoUso.SelectedValueExist(Dr("CveTipoUso").ToString)
|
||||
TxtCodLinea.Text = Dr("CodigoLinea").ToString
|
||||
TxtCodInspeccion.Text = Dr("CodigoInspeccion").ToString
|
||||
TxtMesesUso.Text = Dr("Meses").ToString
|
||||
DdlTipoDefecto.SelectedValueExist(Dr("CveTipoDefecto").ToString)
|
||||
TxtPorcentajeAjuste.Text = Dr("PorcentajeAjuste").ToString
|
||||
TxtPoliza.Text = Dr("NumPoliza").ToString
|
||||
TxtImporteAjuste.Text = Dr("Importe").ToString
|
||||
'DdlFacturas.SelectedValueExist(Dr("CveVenta").ToString)
|
||||
CargaPSAjuste()
|
||||
DdlPSAjuste.SelectedValue = (Dr("CvePS").ToString)
|
||||
TxtFechaAjuste.Text = Dr("FechaAjuste").ToString.ToDate.ToShortDateString
|
||||
txtPrecio.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(2)
|
||||
txtPrecio.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaPSAjuste()
|
||||
DdlPSAjuste.setEsWebService(True)
|
||||
End Sub
|
||||
@@ -2561,7 +2533,14 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
|
||||
|
||||
If drPS IsNot Nothing Then
|
||||
PrecioSugerido = drPS("Precio").ToString.ToDecimal
|
||||
Dim CvePrecioListaPS As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=DdlClientes.SelectedValue.ToEntero).FiltroPrimeroValor("CvePrecioLista").ToEntero()
|
||||
If CvePrecioListaPS > 0 Then
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
|
||||
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
End If
|
||||
Dim PS As String = drPS("PS").ToString
|
||||
CveMarca = drPS("CveMarca").ToString.ToEntero
|
||||
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
|
||||
@@ -2637,11 +2616,71 @@ Partial Class Inventarios_RecepcionUsados
|
||||
If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then
|
||||
Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo")
|
||||
TxtConsecutivoAjuste.Text = (resultado.ToEntero + 1).ToString
|
||||
UpAjuste.Update()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
|
||||
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
|
||||
|
||||
If Not FolioGarantia.Valido Then
|
||||
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function ValidaFolioGarantia(CvePS As Integer, CveFolioGarantia As Integer) As MFolioGarantiaMensaje
|
||||
Dim Retorno As New MFolioGarantiaMensaje
|
||||
|
||||
Dim Valido As Boolean = False
|
||||
Dim TipoFolio As String = ""
|
||||
Dim ListaClasificacionesPermitidas As New List(Of Integer)
|
||||
|
||||
Dim ObjAcumuladores As New ClsAcumuladores
|
||||
If ObjAcumuladores.FoliosGarantiaGet(CveFolioGarantia, UsuarioActual.CveEmpresa, Area:=-1) AndAlso ObjAcumuladores.DtResultados.Rows.Count > 0 Then
|
||||
Dim Row As DataRow = ObjAcumuladores.DtResultados.Rows(0)
|
||||
TipoFolio = Row("tipoFolio").ToString().ToUpper()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
|
||||
Dim CveClasificacionPS As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion").ToEntero()
|
||||
Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString()
|
||||
Select Case TipoFolio
|
||||
Case "GENERAL"
|
||||
'20520 ACUM. AUTOMOTRIZ
|
||||
'20522 ACUM. ESPECIALES
|
||||
'20513 ACUM. ESTANDAR
|
||||
'20521 ACUM. PESADO
|
||||
'20512 ACUM. PREMIUM
|
||||
'20514 ACUM. VALUE
|
||||
'20229 Acumulador
|
||||
ListaClasificacionesPermitidas.Add(20520) 'ACUM. AUTOMOTRIZ
|
||||
ListaClasificacionesPermitidas.Add(20522) 'ACUM. ESPECIALES
|
||||
ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR
|
||||
ListaClasificacionesPermitidas.Add(20521) 'ACUM. PESADO
|
||||
ListaClasificacionesPermitidas.Add(20512) 'ACUM. PREMIUM
|
||||
ListaClasificacionesPermitidas.Add(20514) 'ACUM. VALUE
|
||||
ListaClasificacionesPermitidas.Add(20229) 'Acumulador
|
||||
Case "OPTIMA"
|
||||
'20511 ACUM. OPTIMA
|
||||
ListaClasificacionesPermitidas.Add(20511) 'ACUM. OPTIMA
|
||||
Case "MOTOBATERIA"
|
||||
'20517 MOTOBATERIAS
|
||||
ListaClasificacionesPermitidas.Add(20517) 'MOTOBATERIAS
|
||||
End Select
|
||||
|
||||
If ListaClasificacionesPermitidas.Contains(CveClasificacionPS) Then
|
||||
Valido = True
|
||||
End If
|
||||
|
||||
Retorno.CvePS = CvePS
|
||||
Retorno.CveFolioGarantia = CveFolioGarantia
|
||||
Retorno.CveClasificacionPS = CveClasificacionPS
|
||||
Retorno.ClasificacionPS = ClasificacionPS
|
||||
Retorno.TipoFolio = TipoFolio
|
||||
Retorno.Valido = Valido
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Protected Sub CargaTipoDeUso()
|
||||
DdlTipoUso.Items.Clear()
|
||||
DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
||||
@@ -2720,7 +2759,45 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
UpAjuste.Update()
|
||||
End Sub
|
||||
Private Sub GuardaAjuste()
|
||||
|
||||
Dim CargoAnterior As Double = 0
|
||||
Dim CargoActual As Double = 0
|
||||
|
||||
Dim Row As DataRow = Nothing
|
||||
Row = TmpDTAjustes.NewRow
|
||||
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
||||
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
||||
Row("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero
|
||||
Row("CodigoEnsamble") = TxtCodEnsamble.Text
|
||||
Row("CodigoLinea") = TxtCodLinea.Text
|
||||
Row("CodigoInspeccion") = TxtCodInspeccion.Text
|
||||
Row("Consecutivo") = TxtConsecutivoAjuste.Text
|
||||
Row("FechaAjuste") = TxtFechaAjuste.Text.ToDate
|
||||
Row("Meses") = TxtMesesUso.Text.ToEntero
|
||||
Row("PorcentajeAjuste") = TxtPorcentajeAjuste.Text.ToDouble
|
||||
Row("NumPoliza") = TxtPoliza.Text
|
||||
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
||||
Row("ConsecutivoVenta") = TxtConsecutivoAjuste.Text.ToEntero()
|
||||
Row("CvePS") = DdlPSAjuste.SelectedValue
|
||||
Row("PS") = DdlPSAjuste.SelectedText
|
||||
Row("CveVenta") = -1
|
||||
Row("PUFactura") = TxtPUFactura.Text.ToDouble
|
||||
Row("Cantidad") = 1
|
||||
Dim CveUM As Integer = -1
|
||||
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).Rows(0)
|
||||
If Dr IsNot Nothing Then
|
||||
CveUM = Dr("CveUnidadMedida").ToString.ToEntero
|
||||
CargoAnterior = Dr("Cargo").ToString.ToDouble
|
||||
End If
|
||||
End If
|
||||
Row("CveUM") = CveUM
|
||||
Row("CveVentaDetalle") = -1
|
||||
TmpDTAjustes.Rows.Add(Row)
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
|
||||
CalculaMesesUso()
|
||||
End Sub
|
||||
@@ -2750,6 +2827,14 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Protected Sub BtnAgregarProductoAjuste_Click(sender As Object, e As EventArgs)
|
||||
Dim CvePS As Integer = DdlPSAjuste.SelectedValue.ToEntero
|
||||
|
||||
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(CvePS, DdlFolioGarantia.SelectedValue.ToEntero())
|
||||
|
||||
If Not FolioGarantia.Valido Then
|
||||
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
Dim CveTamaño As Integer = -1
|
||||
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
|
||||
@@ -2774,6 +2859,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjPS.Dispose()
|
||||
|
||||
GuardaAjuste()
|
||||
End Sub
|
||||
|
||||
Protected Sub CargarDescuento()
|
||||
@@ -2790,4 +2877,14 @@ Partial Class Inventarios_RecepcionUsados
|
||||
InicializaClientes(ChkClientesTodos.Checked)
|
||||
End Sub
|
||||
|
||||
Partial Class MFolioGarantiaMensaje
|
||||
Public Property CvePS As Integer
|
||||
Public Property CveClasificacionPS As Integer
|
||||
Public Property ClasificacionPS As String
|
||||
Public Property CveFolioGarantia As Integer
|
||||
Public Property TipoFolio As String
|
||||
|
||||
Public Property Valido As Boolean
|
||||
End Class
|
||||
|
||||
End Class
|
||||
|
||||
@@ -146,8 +146,8 @@
|
||||
|
||||
<div id="DivTransitorio" style="display: none;">
|
||||
<div class="row">
|
||||
|
||||
<asp:Label AssociatedControlID="TxtResponsable" ID="LblResponsable" runat="server" Text="Responsable:" CssClass="col-md-2"></asp:Label>
|
||||
|
||||
<asp:Label AssociatedControlID="TxtResponsable" ID="LblResponsable" runat="server" Text="Responsable:" CssClass="col-md-2"></asp:Label>
|
||||
<asp:Panel CssClass="col-md-2" ID="divResponsable" runat="server">
|
||||
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtResponsable" />
|
||||
</asp:Panel>
|
||||
@@ -156,8 +156,8 @@
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label AssociatedControlID="ChkEmitirTimbrado" runat="server" Text="Emitir Timbrado:" ID="LblEmitirTimbrado" CssClass="col-md-2 " Visible="false"></asp:Label>
|
||||
<asp:Panel id="DivEmitirTimbrado" runat="server" Visible="false" class="col-md-2">
|
||||
<asp:Label AssociatedControlID="ChkEmitirTimbrado" runat="server" Text="Emitir Timbrado:" ID="LblEmitirTimbrado" CssClass="col-md-2 " Visible="false"></asp:Label>
|
||||
<asp:Panel ID="DivEmitirTimbrado" runat="server" Visible="false" class="col-md-2">
|
||||
<asp:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " />
|
||||
</asp:Panel>
|
||||
|
||||
@@ -166,9 +166,9 @@
|
||||
|
||||
<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: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>
|
||||
<label class="col-md-2">Chofer:</label>
|
||||
@@ -194,7 +194,7 @@
|
||||
<div class="row">
|
||||
<label class="col-md-1">Unidad:</label>
|
||||
<div class="col-md-1 ">
|
||||
<asp:HyperLink runat="server" ID="HplNuevaUnidad" CssClass ="btn btn-sm btn-primary" NavigateUrl="#" data-toggle="modal" data-target="#DivAgregarNuevoCamion"><i class='fa fa-plus'></i></asp:HyperLink>
|
||||
<asp:HyperLink runat="server" ID="HplNuevaUnidad" CssClass="btn btn-sm btn-primary" NavigateUrl="#" data-toggle="modal" data-target="#DivAgregarNuevoCamion"><i class='fa fa-plus'></i></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="Placa"></asp:DropDownList>
|
||||
@@ -391,7 +391,7 @@
|
||||
|
||||
<th width="160px">Comandos</th>
|
||||
</tr>
|
||||
</thea>
|
||||
</thea>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td align="center">
|
||||
@@ -621,7 +621,6 @@
|
||||
</div>
|
||||
<br />
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UPDivCodigoSeriePSRecepcion" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" runat="server" id="DivCodigoSeriePSRecepcion" visible="false">
|
||||
@@ -647,46 +646,47 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatosRecepcion" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerie,CveMovimientoDetalle,PU,CveAlmacenSalida,CveMovimientoSalida,Serie,Lote,FechaCaducidad,Cantidad, GastoIndirectoSalida, Importe,Codigo" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
<%--<HeaderTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:UpdatePanel runat="server" ID="UpDatosRecepcion" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerie,CveMovimientoDetalle,PU,CveAlmacenSalida,CveMovimientoSalida,Serie,Lote,FechaCaducidad,Cantidad, GastoIndirectoSalida, Importe,Codigo" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
<%--<HeaderTemplate>
|
||||
<input type="checkbox" id="ChkAll" onclick="CheckAll();" />
|
||||
</HeaderTemplate>--%>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" Checked="true" runat="server"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="15%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<br />
|
||||
<br />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" Checked="true" runat="server"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="15%" />
|
||||
<asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="15%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<br />
|
||||
<br />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
@@ -859,7 +859,13 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If TipoAlmacenOrigen = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
||||
End If
|
||||
|
||||
|
||||
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
FolioVirtualSalida = ObjInventario.Folio
|
||||
@@ -883,42 +889,51 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
||||
|
||||
Dim TipoMovimientoEntrada As Integer = 27
|
||||
If Not ChkTransitorio.Checked Then TipoMovimientoEntrada = 27 Else TipoMovimientoEntrada = 9
|
||||
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
|
||||
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
|
||||
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
|
||||
FolioEntrada = ObjInventario.Folio
|
||||
If CveMovimientoEntrada <= 0 Then
|
||||
TextoError = "Ocurrió un error al generar el movimiento de entrada"
|
||||
ErrorMovInv = True
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Dim Cont As Integer = 0
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
End If
|
||||
Cont += 1
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
'AGREGAMOS LA ENTRADA
|
||||
If Not ChkTransitorio.Checked Then 'SI NO ES TRANSITORIO SE HACE LA RECEPCION DE INMEDIATO
|
||||
If Not ErrorMovInv Then
|
||||
Dim TipoMovimientoEntrada = 27
|
||||
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
||||
|
||||
'Dim TipoAlmacenEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {AlmacenEntrada}").ToEntero()
|
||||
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
|
||||
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
|
||||
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
|
||||
FolioEntrada = ObjInventario.Folio
|
||||
If CveMovimientoEntrada <= 0 Then
|
||||
TextoError = "Ocurrió un error al generar el movimiento de entrada"
|
||||
ErrorMovInv = True
|
||||
Else
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
Dim Cont As Integer = 0
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||
Exit For
|
||||
End If
|
||||
Cont += 1
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
'VIRTUAL ENTRADA
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||
'SI EL ALMACEN DESTINO ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If TipoAlmacenDestino = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
|
||||
End If
|
||||
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/S3")
|
||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S3")
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
@@ -984,7 +999,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If Not ErrorMovInv Then
|
||||
Dim Concepto As String = TxtObservaciones.Text
|
||||
If Concepto = "" Then Concepto = "Traspaso"
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen2", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
@@ -995,7 +1010,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
@@ -1021,12 +1036,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
|
||||
MensajeAlert.AppendFormat("<br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioSalida, CveMovimientoSalida)
|
||||
MensajeAlert.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
|
||||
If CveMovimientoVirtualSalida > 0 Then MensajeAlert.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> <a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Salida Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualSalida)), CveMovimientoVirtualSalida, FolioVirtualSalida)
|
||||
If CveMovimientoVirtualSalida > 0 Then MensajeAlert.AppendFormat("<br/>Folio Virtual: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a></b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Salida Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualSalida)), CveMovimientoVirtualSalida, FolioVirtualSalida)
|
||||
|
||||
If Not ChkTransitorio.Checked Then
|
||||
MensajeAlert.AppendFormat("<br/><br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioEntrada, CveMovimientoEntrada)
|
||||
MensajeAlert.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
|
||||
If CveMovimientoVirtualEntrada > 0 Then MensajeAlert.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> <a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
|
||||
If CveMovimientoVirtualEntrada > 0 Then MensajeAlert.AppendFormat("<br/>Folio Virtual: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a></b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
|
||||
|
||||
End If
|
||||
|
||||
@@ -1666,7 +1681,15 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim CveTipoAlmacenOrigen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveTipoAlmacen").ToEntero()
|
||||
|
||||
'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If CveTipoAlmacenOrigen = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
End If
|
||||
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
|
||||
@@ -1733,7 +1756,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim Mensaje As StringBuilder = New StringBuilder
|
||||
Mensaje.AppendFormat("Se realizo correctamente la cancelación. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoEntrada)
|
||||
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()'
|
||||
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> <a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
|
||||
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/>Folio Virtual: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a></b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
|
||||
|
||||
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
@@ -1794,11 +1817,16 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
|
||||
|
||||
Dim CveAlmacenEntrada As Integer = GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero
|
||||
Dim CveAlmacenSalida As Integer = GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero
|
||||
|
||||
Dim TipoAlmacenDestino As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenEntrada}").ToEntero()
|
||||
|
||||
'AGREGAMOS LA SALIDA
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11")
|
||||
|
||||
'AGREGAMOS LA ENTRADA
|
||||
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1")
|
||||
Folio = ObjInventario.Folio
|
||||
|
||||
@@ -1831,11 +1859,18 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Exit For
|
||||
End If
|
||||
Dim PrecioEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, gvr.DataKey("PU").ToString.ToDecimal)
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
End If
|
||||
'MOV, Alm, Transito
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||
Exit For
|
||||
End If
|
||||
|
||||
ElseIf cantidadDisponibleValidacion < 0 Then
|
||||
TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString)
|
||||
ErrorMovInv = True
|
||||
@@ -1846,7 +1881,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim Concepto As String = TxtObservacionesRecepcion.Text
|
||||
If Concepto = "" Then Concepto = "Recepción Traspaso"
|
||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||
@@ -1870,7 +1905,12 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenRecepcion.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
If TipoAlmacenDestino = 27 Then
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Else
|
||||
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
End If
|
||||
|
||||
If CveAlmacenVirtual > 0 Then
|
||||
|
||||
@@ -1878,7 +1918,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
FolioVirtualEntrada = ObjInventario.Folio
|
||||
Dim dtvirtual As DataTable = Nothing
|
||||
|
||||
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
dtvirtual = ObjInventario.DtResultados
|
||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||
@@ -1974,7 +2014,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
||||
Dim Mensaje As StringBuilder = New StringBuilder
|
||||
Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida)
|
||||
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) 'onclick='ImprimirTraslado()'
|
||||
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/>Virtual<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
|
||||
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/><br/>Folio Virtual <b> <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> </b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
|
||||
|
||||
|
||||
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
@@ -321,7 +321,7 @@ Partial Class Sistemas_PopUpAddUsuario
|
||||
If Row.DataKey("CveProcesoAcceso") <> "" Then
|
||||
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
|
||||
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkD").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkD").Checked = False Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked) Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -329,7 +329,7 @@ Partial Class Sistemas_PopUpAddUsuario
|
||||
Else
|
||||
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
|
||||
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkP").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkP").Checked = False Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked) Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -340,7 +340,7 @@ Partial Class Sistemas_PopUpAddUsuario
|
||||
If Row.DataKey("CveProcesoAcceso") <> "" Then
|
||||
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
|
||||
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -348,7 +348,7 @@ Partial Class Sistemas_PopUpAddUsuario
|
||||
Else
|
||||
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
|
||||
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkPermitir").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -490,7 +490,7 @@ Partial Class Sistemas_PopUpAddUsuario
|
||||
If Row.DataKey("CveProcesoAcceso") <> "" Then
|
||||
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
|
||||
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkD").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkD").Checked = False Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked) Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -498,7 +498,7 @@ Partial Class Sistemas_PopUpAddUsuario
|
||||
Else
|
||||
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
|
||||
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkP").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkP").Checked = False Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked) Then
|
||||
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
BIN
TareasProgramadas/FormatosThalamus/FormatoAlmacenes.xlsx
Normal file
BIN
TareasProgramadas/FormatosThalamus/FormatoAlmacenes.xlsx
Normal file
Binary file not shown.
BIN
TareasProgramadas/FormatosThalamus/FormatoClientes.xlsx
Normal file
BIN
TareasProgramadas/FormatosThalamus/FormatoClientes.xlsx
Normal file
Binary file not shown.
BIN
TareasProgramadas/FormatosThalamus/FormatoProductos.xlsx
Normal file
BIN
TareasProgramadas/FormatosThalamus/FormatoProductos.xlsx
Normal file
Binary file not shown.
BIN
TareasProgramadas/FormatosThalamus/FormatoVentas.xlsx
Normal file
BIN
TareasProgramadas/FormatosThalamus/FormatoVentas.xlsx
Normal file
Binary file not shown.
@@ -10,7 +10,8 @@ using System.Web.Services.Protocols;
|
||||
using GemBox.Spreadsheet;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using ClosedXML;
|
||||
|
||||
public class TareasJam : IHttpHandler
|
||||
{
|
||||
@@ -63,6 +64,13 @@ public class TareasJam : IHttpHandler
|
||||
string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
||||
string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
||||
|
||||
|
||||
string FormatoVentas = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoVentas.xlsx";
|
||||
string FormatoClientes = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoClientes.xlsx";
|
||||
string FormatoAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoAlmacenes.xlsx";
|
||||
string FormatoProductos = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoProductos.xlsx";
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (File.Exists(RutaProductos))
|
||||
@@ -91,14 +99,14 @@ public class TareasJam : IHttpHandler
|
||||
}
|
||||
|
||||
|
||||
string FTPServer = "ftp://127.0.0.1/";
|
||||
string TFPUsr = "Toor";
|
||||
string FTPPass = "agj-3500";
|
||||
//string FTPServer = "ftp://127.0.0.1/";
|
||||
//string TFPUsr = "Toor";
|
||||
//string FTPPass = "agj-3500";
|
||||
|
||||
|
||||
//string FTPServer = "ftp://us2.hostedftp.com";
|
||||
//string TFPUsr = "agrojam";
|
||||
//string FTPPass = "A12345678";
|
||||
string FTPServer = "ftp://us2.hostedftp.com";
|
||||
string TFPUsr = "agrojam";
|
||||
string FTPPass = "A12345678";
|
||||
|
||||
bool ErrorProceso = false;
|
||||
|
||||
@@ -158,7 +166,7 @@ public class TareasJam : IHttpHandler
|
||||
try
|
||||
{
|
||||
|
||||
DTProductos.Columns[0].ColumnName = "Código Producto Interno ";
|
||||
DTProductos.Columns[0].ColumnName = "Código Producto Interno";
|
||||
DTProductos.Columns[1].ColumnName = "Nombre del Producto";
|
||||
DTProductos.Columns[2].ColumnName = "Presentación";
|
||||
DTProductos.AcceptChanges();
|
||||
@@ -196,9 +204,6 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DataTable dtCloned = DTVentas.Clone();
|
||||
dtCloned.Columns[3].DataType = typeof(string);
|
||||
|
||||
@@ -210,7 +215,7 @@ public class TareasJam : IHttpHandler
|
||||
DTVentas = dtCloned;
|
||||
foreach (DataRow dRow in DTVentas.Rows)
|
||||
{
|
||||
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");//.ToDate().ToString("yyyy/MM/dd").ToDate();
|
||||
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");
|
||||
dRow[3] = tmpDate;
|
||||
}
|
||||
|
||||
@@ -228,106 +233,98 @@ public class TareasJam : IHttpHandler
|
||||
DTAlmacenes = dtCloned;
|
||||
foreach (DataRow dRow in DTAlmacenes.Rows)
|
||||
{
|
||||
//DateTime tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd").ToDate();
|
||||
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");
|
||||
dRow[3] = tmpDate;
|
||||
}
|
||||
DTAlmacenes.AcceptChanges();
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
SBLog.AppendLine("<b>Error al renombrar columnas</b>");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!ErrorProceso)
|
||||
{
|
||||
|
||||
int contador = 0;
|
||||
|
||||
SpreadsheetInfo.SetLicense(Extensiones.ModExtensiones.SerialGemBoxSpreadsheet());
|
||||
//////////////////////////////////////////////////////////////
|
||||
int count = 2;
|
||||
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
|
||||
var wsVentas = wbVentas.Worksheet(1);
|
||||
|
||||
var workbookAlmacenes = new ExcelFile();
|
||||
var worksheetAlmacenes = workbookAlmacenes.Worksheets.Add("Almacenes");
|
||||
worksheetAlmacenes.InsertDataTable(DTAlmacenes, new InsertDataTableOptions()
|
||||
foreach (DataRow DRow in DTVentas.Rows)
|
||||
{
|
||||
ColumnHeaders = true,
|
||||
StartRow = 0
|
||||
});
|
||||
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
|
||||
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
|
||||
wsVentas.Cell(count, 4).Value = "'" + DRow["Sale Date"].ToString();
|
||||
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
|
||||
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
|
||||
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
|
||||
count++;
|
||||
}
|
||||
wbVentas.SaveAs(RutaVentas);
|
||||
|
||||
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
|
||||
var wsAlmacenes = wbAlmacenes.Worksheet(1);
|
||||
|
||||
count = 2;
|
||||
|
||||
foreach (DataRow DRow in DTAlmacenes.Rows)
|
||||
{
|
||||
|
||||
//contador++;
|
||||
//var cell = worksheetAlmacenes.Cells[contador, 3];
|
||||
//cell.Style.WrapText = true;
|
||||
|
||||
|
||||
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
|
||||
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
|
||||
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
|
||||
wsAlmacenes.Cell(count, 4).Value = "'" + DRow["Stock Date"].ToString();
|
||||
count++;
|
||||
}
|
||||
//worksheetAlmacenes.Columns[3].Style.NumberFormat = "yyyy/MM/dd";
|
||||
workbookAlmacenes.Save(RutaAlmacenes);
|
||||
wbAlmacenes.SaveAs(RutaAlmacenes);
|
||||
|
||||
var workbookProductos = new ExcelFile();
|
||||
var worksheetProductos = workbookProductos.Worksheets.Add("Productos");
|
||||
worksheetProductos.InsertDataTable(DTProductos, new InsertDataTableOptions()
|
||||
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
||||
var wsClientes = wbAClientes.Worksheet(1);
|
||||
|
||||
count = 2;
|
||||
|
||||
foreach (DataRow DRow in DTClientes.Rows)
|
||||
{
|
||||
ColumnHeaders = true,
|
||||
StartRow = 0
|
||||
});
|
||||
workbookProductos.Save(RutaProductos);
|
||||
|
||||
var workbookVentas = new ExcelFile();
|
||||
var worksheetVentas = workbookVentas.Worksheets.Add("Ventas");
|
||||
worksheetVentas.InsertDataTable(DTVentas, new InsertDataTableOptions()
|
||||
{
|
||||
ColumnHeaders = true,
|
||||
StartRow = 0
|
||||
});
|
||||
|
||||
|
||||
contador = 0;
|
||||
foreach (DataRow DRow in DTVentas.Rows)
|
||||
{
|
||||
|
||||
//var value = DateTime.Now;
|
||||
contador++;
|
||||
|
||||
var cell = worksheetVentas.Cells[contador, 3];
|
||||
cell.Style.WrapText = false;
|
||||
cell.Style.IsTextVertical = false;
|
||||
cell.Style.Font.Italic = false;
|
||||
|
||||
//cell.Style.NumberFormat = "h:mm AM/PM"; // "yyyy-MM-dd";
|
||||
//cell.SetValue(value);
|
||||
|
||||
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||
wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString();
|
||||
wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString();
|
||||
wsClientes.Cell(count, 4).Value = DRow["email"].ToString();
|
||||
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
|
||||
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
|
||||
wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
|
||||
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
|
||||
wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
|
||||
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
||||
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
||||
wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString();
|
||||
wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString();
|
||||
wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString();
|
||||
|
||||
count++;
|
||||
}
|
||||
wbAClientes.SaveAs(RutaClientes);
|
||||
|
||||
//worksheetVentas.Columns[3].Style.NumberFormat = "yyyy/MM/dd";
|
||||
var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos);
|
||||
var wsProductos = wbProductos.Worksheet(1);
|
||||
|
||||
workbookVentas.Save(RutaVentas);
|
||||
count = 2;
|
||||
|
||||
|
||||
var workbookClientes = new ExcelFile();
|
||||
var worksheetClientes = workbookClientes.Worksheets.Add("Clientes");
|
||||
worksheetClientes.InsertDataTable(DTClientes, new InsertDataTableOptions()
|
||||
foreach (DataRow DRow in DTProductos.Rows)
|
||||
{
|
||||
ColumnHeaders = true,
|
||||
StartRow = 0
|
||||
});
|
||||
workbookClientes.Save(RutaClientes);
|
||||
|
||||
|
||||
|
||||
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
|
||||
wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString();
|
||||
wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString();
|
||||
|
||||
count++;
|
||||
}
|
||||
wbProductos.SaveAs(RutaProductos);
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
var FInfoProductos = new FileInfo(RutaProductos);
|
||||
var FInfoVentas = new FileInfo(RutaVentas);
|
||||
@@ -363,21 +360,22 @@ public class TareasJam : IHttpHandler
|
||||
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||
if (CargaVentas)
|
||||
{
|
||||
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||
}
|
||||
}
|
||||
|
||||
if (CargaVentas)
|
||||
{
|
||||
SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>");
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>");
|
||||
}
|
||||
|
||||
if (CargaProductos & CargaVentas)
|
||||
{
|
||||
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||
if (CargaClientes)
|
||||
{
|
||||
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||
@@ -387,12 +385,13 @@ public class TareasJam : IHttpHandler
|
||||
if (CargaClientes)
|
||||
{
|
||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>");
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error carga</td></tr>");
|
||||
}
|
||||
|
||||
if (CargaProductos & CargaVentas& CargaClientes )
|
||||
if (CargaProductos & CargaVentas & CargaClientes)
|
||||
{
|
||||
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
||||
if (CargaClientes)
|
||||
@@ -404,7 +403,8 @@ public class TareasJam : IHttpHandler
|
||||
if (CargaAlmacenes)
|
||||
{
|
||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>");
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error carga</td></tr>");
|
||||
}
|
||||
@@ -431,8 +431,6 @@ public class TareasJam : IHttpHandler
|
||||
string Cuerpo = Respuesta ? $"<b>Correcto</b><br>Tarea de carga de archios Corteva realizada correctamente<br> {SBLog.ToString()}" : $"<b>Error</b><br> Error tarea de carga de archios Corteva<br> {SBLog.ToString()}" ;
|
||||
|
||||
|
||||
|
||||
|
||||
MandaCorreo(Cuerpo, Respuesta, RutaProductos, RutaVentas, RutaClientes, RutaAlmacenes);
|
||||
|
||||
return Respuesta;
|
||||
@@ -457,14 +455,7 @@ public class TareasJam : IHttpHandler
|
||||
Ventas.Ruta = RutaVentas;
|
||||
Clientes.Ruta = RutaClientes;
|
||||
Almacenes.Ruta = RutaAlmacenes;
|
||||
|
||||
//FileInfo FIp = new FileInfo(RutaProductos);
|
||||
//FileInfo FIv = new FileInfo(RutaVentas);
|
||||
//FileInfo FIc = new FileInfo(RutaClientes);
|
||||
//FileInfo FIa = new FileInfo(RutaAlmacenes);
|
||||
|
||||
|
||||
|
||||
|
||||
ListaArchivos.Add(Productos);
|
||||
ListaArchivos.Add(Ventas);
|
||||
ListaArchivos.Add(Clientes);
|
||||
@@ -472,8 +463,8 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
|
||||
ClsSisMail Correo = new ClsSisMail();
|
||||
// string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
||||
string Para = "oscar.irigoyen@adssistemas.mx";
|
||||
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
||||
//string Para = "oscar.irigoyen@adssistemas.mx";
|
||||
string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}";
|
||||
|
||||
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);
|
||||
@@ -488,7 +479,7 @@ public class TareasJam : IHttpHandler
|
||||
private bool CargarArchivos(FileInfo FInfo, string FTPServer, string FTPUsr, string FTPPass )
|
||||
{
|
||||
bool Respuesta;
|
||||
//var FInfo = new FileInfo(RutaArchivo);
|
||||
|
||||
if (FInfo.Exists)
|
||||
{
|
||||
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");
|
||||
|
||||
@@ -772,8 +772,8 @@ Partial Class Clientes
|
||||
UpAccionesCRM.Update()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(309) Then
|
||||
DeshabilitarDatosClienteCajas()
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(309) Then
|
||||
DeshabilitarDatosClienteCajas()
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -845,8 +845,8 @@ Partial Class Clientes
|
||||
If Request("CveEmpresaCRM") IsNot Nothing AndAlso IsNumeric(Request("CveEmpresaCRM")) AndAlso Request("CveEmpresaCRM").ToEntero > 0 Then
|
||||
ViewState("CveEmpresaCRM") = Request("CveEmpresaCRM")
|
||||
CargaDatosCRM()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then ' Funcionalidad Es Distribuidor
|
||||
DivEsDistribuidor.Visible = True
|
||||
DivCargoUsado.Visible = True
|
||||
@@ -912,33 +912,33 @@ Partial Class Clientes
|
||||
End Function
|
||||
Private Function PermiteEliminar() As Boolean
|
||||
Return UsuarioActual.TienePermisoProceso(194)
|
||||
End Function
|
||||
|
||||
Private Sub DeshabilitarDatosClienteCajas()
|
||||
DdlSubProyecto.Enabled = False
|
||||
DdlPrecioLista.Enabled = False
|
||||
DdlClasificacion.Enabled = False
|
||||
DdlVendedor.Enabled = False
|
||||
DdlCorporativo.Enabled = False
|
||||
ChkRequiereOC.Enabled = False
|
||||
ChkEsDistribuidor.Enabled = False
|
||||
DdlTipoCliente.Enabled = False
|
||||
TxtCorreoEntregaCompras.Enabled = False
|
||||
TxtCorreoEntregaAlmacen.Enabled = False
|
||||
ChkCargoUsado.Enabled = False
|
||||
ChkBonificacionUsado.Enabled = False
|
||||
End Sub
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub DeshabilitarDatosClienteCajas()
|
||||
DdlSubProyecto.Enabled = False
|
||||
DdlPrecioLista.Enabled = False
|
||||
DdlClasificacion.Enabled = False
|
||||
DdlVendedor.Enabled = False
|
||||
DdlCorporativo.Enabled = False
|
||||
ChkRequiereOC.Enabled = False
|
||||
ChkEsDistribuidor.Enabled = False
|
||||
DdlTipoCliente.Enabled = False
|
||||
TxtCorreoEntregaCompras.Enabled = False
|
||||
TxtCorreoEntregaAlmacen.Enabled = False
|
||||
ChkCargoUsado.Enabled = False
|
||||
ChkBonificacionUsado.Enabled = False
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region "C A R G A S"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Private Sub CreaDtPago()
|
||||
DtPagos = New DataTable
|
||||
DtPagos.Columns.Add("CveTipoMovimiento", GetType(String))
|
||||
@@ -1120,9 +1120,9 @@ Partial Class Clientes
|
||||
|
||||
Select Case HdnCuenta.Value
|
||||
Case "1"
|
||||
CargaDdlCuentasContables(DdlCtaContableClientes, UsuarioActual.Empresa.Funcionalidad(246).ToEntero)
|
||||
CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).ToEntero
|
||||
Case "2"
|
||||
CargaDdlCuentasContables(DdlCtaContableAnticipos, UsuarioActual.Empresa.Funcionalidad(237).ToEntero)
|
||||
CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).ToEntero
|
||||
Case "3"
|
||||
CargaDdlCuentasContables(DdlCtaContableRetIVA, -1)
|
||||
Case "4"
|
||||
@@ -1130,13 +1130,13 @@ Partial Class Clientes
|
||||
Case "5"
|
||||
CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1)
|
||||
Case "6"
|
||||
CargaDdlCuentasContables(DdlCtaContableCompClientes, UsuarioActual.Empresa.Funcionalidad(248).ToEntero)
|
||||
CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).ToEntero
|
||||
Case "7"
|
||||
CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1)
|
||||
Case "8"
|
||||
CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, UsuarioActual.Empresa.Funcionalidad(247).ToEntero)
|
||||
CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).ToEntero
|
||||
Case "9"
|
||||
CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, UsuarioActual.Empresa.Funcionalidad(542).ToEntero)
|
||||
CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).ToEntero
|
||||
End Select
|
||||
UpFiscalContable.Update()
|
||||
|
||||
@@ -1223,14 +1223,14 @@ Partial Class Clientes
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub CargaSubProyectoss()
|
||||
|
||||
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Private Sub CargaSubProyectoss()
|
||||
|
||||
'DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub CargaMetodosPago()
|
||||
DdlMetodoPago.DataSource = GlobalDTMetodosPago.FiltraParametros("Estatus = 'Activo'", "ClaveSAT") '.FiltraParametros("CveMetodoPago > 0 ")
|
||||
@@ -1926,14 +1926,14 @@ Partial Class Clientes
|
||||
GvDireccionesEnvio.DataSource = ObjClientes.DtResultados
|
||||
End If
|
||||
ObjClientes.Dispose()
|
||||
GvDireccionesEnvio.DataBind()
|
||||
|
||||
If TxtRFC.Text = "XAXX010101000" Then
|
||||
If GvDireccionesEnvio.HeaderRow IsNot Nothing AndAlso GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal") IsNot Nothing Then GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente"
|
||||
LtlNombreSucursal.Text = "Cliente"
|
||||
LtlNombreSucursalTitulo.Text = "Cliente"
|
||||
LtlTituloSurcusalCliente.Text = "Datos del cliente"
|
||||
LtlGvSucursalesCliente.Text = "Clientes"
|
||||
GvDireccionesEnvio.DataBind()
|
||||
|
||||
If TxtRFC.Text = "XAXX010101000" Then
|
||||
If GvDireccionesEnvio.HeaderRow IsNot Nothing AndAlso GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal") IsNot Nothing Then GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente"
|
||||
LtlNombreSucursal.Text = "Cliente"
|
||||
LtlNombreSucursalTitulo.Text = "Cliente"
|
||||
LtlTituloSurcusalCliente.Text = "Datos del cliente"
|
||||
LtlGvSucursalesCliente.Text = "Clientes"
|
||||
End If
|
||||
UpAgregarSucursal.Update()
|
||||
UpDatos.Update()
|
||||
@@ -2758,7 +2758,7 @@ Partial Class Clientes
|
||||
'HLRemision.HRef = $"/Ventas/Ventas.aspx?CveRemision={e.Row.DBCampo("CveVenta")}"
|
||||
|
||||
Dim Liga As String = String.Format("< a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta"))
|
||||
HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto"))
|
||||
HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();return false;}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto"))
|
||||
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DBCampo("CveVenta"), e.Row.DBCampo("Folio"))
|
||||
|
||||
UpSendMail.Update()
|
||||
@@ -9082,7 +9082,14 @@ Partial Class Clientes
|
||||
e.Row.FCCheckBox("ChkBonificacion").Visible = False
|
||||
Else
|
||||
e.Row.FCCheckBox("ChkBonificacion").Checked = False
|
||||
e.Row.FCCheckBox("ChkBonificacion").Visible = True
|
||||
'VERIFICA SI ES USADO O AJUSTE/GARANTIA
|
||||
'SI ES USADO
|
||||
If e.Row.DBCampo("EsUsadoAjuste") = "0" Then
|
||||
e.Row.FCCheckBox("ChkBonificacion").Visible = True
|
||||
'SI ES AJUSTE/GARANTIA
|
||||
ElseIf e.Row.DBCampo("EsUsadoAjuste") = "1" Then
|
||||
e.Row.FCCheckBox("ChkBonificacion").Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -10196,18 +10203,18 @@ Partial Class Clientes
|
||||
GvPagosNoBancarios.DataBind()
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
Protected Sub TxtCodigo_TextChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If CveCliente <= 0 AndAlso UsuarioActual.CveEmpresa = 140 Then
|
||||
DdlTipoCliente.SelectedValueExist("1")
|
||||
ChkEsDistribuidor.Checked = True
|
||||
ChkCargoUsado.Checked = True
|
||||
ChkBonificacionUsado.Checked = True
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
Protected Sub TxtCodigo_TextChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If CveCliente <= 0 AndAlso UsuarioActual.CveEmpresa = 140 Then
|
||||
DdlTipoCliente.SelectedValueExist("1")
|
||||
ChkEsDistribuidor.Checked = True
|
||||
ChkCargoUsado.Checked = True
|
||||
ChkBonificacionUsado.Checked = True
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
@@ -4671,6 +4671,15 @@ Partial Class PV
|
||||
RegistraScript("$('#DivAddVenta').modal({backdrop: 'static', keyboard: false});", "EdicionVenta")
|
||||
End Sub
|
||||
Protected Sub LnkAgregarPS_Click(sender As Object, e As EventArgs)
|
||||
If ChkAjuste.Checked Then
|
||||
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
|
||||
|
||||
If Not FolioGarantia.Valido Then
|
||||
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
If AgregarPS() Then
|
||||
If ChkAjuste.Checked Then GuardaAjuste()
|
||||
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
|
||||
@@ -6511,6 +6520,12 @@ Partial Class PV
|
||||
UpAjuste.Update()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
|
||||
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
|
||||
|
||||
If Not FolioGarantia.Valido Then
|
||||
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -6991,4 +7006,68 @@ Partial Class PV
|
||||
ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function ValidaFolioGarantia(CvePS As Integer, CveFolioGarantia As Integer) As MFolioGarantiaMensaje
|
||||
Dim Retorno As New MFolioGarantiaMensaje
|
||||
|
||||
Dim Valido As Boolean = False
|
||||
Dim TipoFolio As String = ""
|
||||
Dim ListaClasificacionesPermitidas As New List(Of Integer)
|
||||
|
||||
Dim ObjAcumuladores As New ClsAcumuladores
|
||||
If ObjAcumuladores.FoliosGarantiaGet(CveFolioGarantia, UsuarioActual.CveEmpresa, Area:=-1) AndAlso ObjAcumuladores.DtResultados.Rows.Count > 0 Then
|
||||
Dim Row As DataRow = ObjAcumuladores.DtResultados.Rows(0)
|
||||
TipoFolio = Row("tipoFolio").ToString().ToUpper()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
|
||||
Dim CveClasificacionPS As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion").ToEntero()
|
||||
Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString()
|
||||
Select Case TipoFolio
|
||||
Case "GENERAL"
|
||||
'20520 ACUM. AUTOMOTRIZ
|
||||
'20522 ACUM. ESPECIALES
|
||||
'20513 ACUM. ESTANDAR
|
||||
'20521 ACUM. PESADO
|
||||
'20512 ACUM. PREMIUM
|
||||
'20514 ACUM. VALUE
|
||||
'20229 Acumulador
|
||||
ListaClasificacionesPermitidas.Add(20520) 'ACUM. AUTOMOTRIZ
|
||||
ListaClasificacionesPermitidas.Add(20522) 'ACUM. ESPECIALES
|
||||
ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR
|
||||
ListaClasificacionesPermitidas.Add(20521) 'ACUM. PESADO
|
||||
ListaClasificacionesPermitidas.Add(20512) 'ACUM. PREMIUM
|
||||
ListaClasificacionesPermitidas.Add(20514) 'ACUM. VALUE
|
||||
ListaClasificacionesPermitidas.Add(20229) 'Acumulador
|
||||
Case "OPTIMA"
|
||||
'20511 ACUM. OPTIMA
|
||||
ListaClasificacionesPermitidas.Add(20511) 'ACUM. OPTIMA
|
||||
Case "MOTOBATERIA"
|
||||
'20517 MOTOBATERIAS
|
||||
ListaClasificacionesPermitidas.Add(20517) 'MOTOBATERIAS
|
||||
End Select
|
||||
|
||||
If ListaClasificacionesPermitidas.Contains(CveClasificacionPS) Then
|
||||
Valido = True
|
||||
End If
|
||||
|
||||
Retorno.CvePS = CvePS
|
||||
Retorno.CveFolioGarantia = CveFolioGarantia
|
||||
Retorno.CveClasificacionPS = CveClasificacionPS
|
||||
Retorno.ClasificacionPS = ClasificacionPS
|
||||
Retorno.TipoFolio = TipoFolio
|
||||
Retorno.Valido = Valido
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Partial Class MFolioGarantiaMensaje
|
||||
Public Property CvePS As Integer
|
||||
Public Property CveClasificacionPS As Integer
|
||||
Public Property ClasificacionPS As String
|
||||
Public Property CveFolioGarantia As Integer
|
||||
Public Property TipoFolio As String
|
||||
|
||||
Public Property Valido As Boolean
|
||||
End Class
|
||||
End Class
|
||||
|
||||
@@ -6235,8 +6235,8 @@
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlVentaUsado" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="100%" CssClass="select2me" OnSelectedIndexChanged="DdlVentaUsado_SelectedIndexChanged"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<%-- <asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6293,14 +6293,14 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" />
|
||||
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row" id="DivSMU" runat="server" visible="false">
|
||||
<div class="col-md-12">
|
||||
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
|
||||
<tr align="right">
|
||||
|
||||
@@ -2160,6 +2160,7 @@ Partial Class Ventas
|
||||
'Carga Venta
|
||||
If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero() > 0 Then
|
||||
ViewState("CveVenta") = Request("CveVenta")
|
||||
|
||||
If CargaVenta() Then
|
||||
|
||||
'DdlSucursal.Enabled = False
|
||||
@@ -2694,7 +2695,7 @@ Partial Class Ventas
|
||||
TrPedido.Visible = False
|
||||
' TrKilometrajeTxt.Visible = True
|
||||
End If
|
||||
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveVenta)
|
||||
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""></i> Tarea</a>", CveVenta)
|
||||
|
||||
End If
|
||||
|
||||
@@ -5415,7 +5416,7 @@ Partial Class Ventas
|
||||
|
||||
DdlVentaUsado.DataBind()
|
||||
|
||||
DdlVentaUsado.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlVentaUsado.Items.Insert(0, New ListItem("No Aplica", "-1"))
|
||||
|
||||
UpModalRemisionesNC.Update()
|
||||
End If
|
||||
@@ -10190,7 +10191,7 @@ Partial Class Ventas
|
||||
|
||||
'PedidoA'
|
||||
If ObjVentas.CveVenta > 0 And CvePedidoA > 0 And DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
|
||||
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario) Then
|
||||
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario, CveRemision:=factura.CveVenta) Then
|
||||
ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA")
|
||||
End If
|
||||
End If
|
||||
@@ -21693,18 +21694,18 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SALIDA GENERAL
|
||||
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7")
|
||||
If CveMovimientoEntradaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
|
||||
CveMovimientoSalidaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7")
|
||||
If CveMovimientoSalidaGeneral > 0 Then
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaGeneral, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'GENERAR PREPOLIZA
|
||||
If Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoEntradaGeneral, CveAlmacenOrigenContrato) Then
|
||||
If Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoSalidaGeneral, CveAlmacenOrigenContrato) Then
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
@@ -23016,7 +23017,9 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
|
||||
If DeshabilitarAplicarNotaDeCredito(LblRFC.Text) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
AplicaNCMasiva = False
|
||||
AplicaNC = False
|
||||
@@ -23116,13 +23119,19 @@ Partial Class Ventas
|
||||
GvRemisionesNCBon.DataBind()
|
||||
|
||||
If CveVentaUsado > 0 Then
|
||||
DivSMU.Visible = True
|
||||
Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa)
|
||||
LtlSMU.Text = String.Format("{0:N2}", FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal())
|
||||
Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
|
||||
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
|
||||
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
|
||||
Else
|
||||
LtlSMU.Text = String.Format("{0:N2}", 0)
|
||||
DivSMU.Visible = False
|
||||
HdnSaldoMaximoUsados.Value = "0"
|
||||
LtlSMU.Text = "0"
|
||||
End If
|
||||
|
||||
UpModalRemisionesNC.Update()
|
||||
UpDescNC.Update()
|
||||
End Sub
|
||||
Private Sub CargaDescRNC()
|
||||
Dim DtNC As DataTable = Nothing
|
||||
@@ -23318,8 +23327,8 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Protected Sub GvRemisionesNC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNC.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaTotalRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaCantidadRNCMasivo({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -27284,14 +27293,15 @@ Partial Class Ventas
|
||||
ObjVentas.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub DeshabilitarAplicarNotaDeCredito(RFC As String)
|
||||
|
||||
Private Function DeshabilitarAplicarNotaDeCredito(RFC As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
If UsuarioActual.CveEmpresa = 119 AndAlso RFC.Contiene("XAXX010101000", "XEXX010101000") Then
|
||||
LBNotaCredito.Visible = False
|
||||
UpnTools.Update()
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region "Auxiliar"
|
||||
Private Sub CargarSaldoAuxiliar(CveCliente As Integer)
|
||||
|
||||
Reference in New Issue
Block a user