Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -117,7 +117,7 @@ Partial Class Acumuladores_RepEntradasUsados
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim workbook As New ExcelFile()
|
||||
|
||||
Dim worksheet = workbook.Worksheets.Add("Sabana de ventas")
|
||||
Dim worksheet = workbook.Worksheets.Add("DATOS")
|
||||
worksheet.InsertDataTable(dt, New InsertDataTableOptions() With
|
||||
{
|
||||
.ColumnHeaders = True,
|
||||
@@ -129,6 +129,10 @@ Partial Class Acumuladores_RepEntradasUsados
|
||||
|
||||
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||
For i = 0 To columnCount
|
||||
'COLUMNA DE FECHA
|
||||
If i = 1 Then
|
||||
worksheet.Columns(i).Style.NumberFormat = "dd/MM/yyyy"
|
||||
End If
|
||||
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||
Next
|
||||
|
||||
|
||||
@@ -1766,7 +1766,7 @@ Public Class ClsVentas
|
||||
End With
|
||||
|
||||
Try
|
||||
Dataset = New DataSet()
|
||||
Dataset = New DataSet()
|
||||
SqlAdapter.Fill(Dataset)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
@@ -3915,48 +3915,48 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetRepComisionesServec(CveVendedor As Integer, FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ReporteComisionesServecGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el Reporte de Comisiones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
Public Function GetRepComisionesServec(CveVendedor As Integer, FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ReporteComisionesServecGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el Reporte de Comisiones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetRepComisionesServecDetalle(CveVendedor As Integer, FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ReporteComisionesServecDetalleGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el Reporte de Comisiones Detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
Public Function GetRepComisionesServecDetalle(CveVendedor As Integer, FechaI As Date, FechaF As Date, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ReporteComisionesServecDetalleGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el Reporte de Comisiones Detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
@@ -4996,19 +4996,19 @@ Public Class ClsVentas
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
Public Function GetVentasNoEnviadas(CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_VentasNoEnviadas")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las ventas no enviadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
Public Function GetVentasNoEnviadas(CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_VentasNoEnviadas")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las ventas no enviadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
#Region "Conciliación emitidas SAT"
|
||||
|
||||
@@ -5096,7 +5096,7 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetVentasGarantiaPendiente(CveVenta As Integer, CveSubProyecto As Integer, Fecha As DateTime, CveEmpresa As Integer, Optional ServicioDomicilio As Boolean = False) As Boolean
|
||||
Public Function GetVentasGarantiaPendiente(CveVenta As Integer, Fecha As DateTime, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Vta_VentasGarantiasPendienteGet", CommandType.StoredProcedure)
|
||||
@@ -5156,24 +5156,24 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddVentaDetalleRNCFacturada(CveVentaDetalleRNC As Integer, CveVentaDetalle As Integer, CantidadFacturada As Decimal) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentaDetalleRNCFacturadaAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVentaDetalleRNC", SqlDbType.Int).Value = CveVentaDetalleRNC
|
||||
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
|
||||
.Add("@CantidadFacturada", SqlDbType.Float).Value = CantidadFacturada
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
OnError("Ocurrió un error al agregar lo facturado de la RNC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
Public Function AddVentaDetalleRNCFacturada(CveVentaDetalleRNC As Integer, CveVentaDetalle As Integer, CantidadFacturada As Decimal) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentaDetalleRNCFacturadaAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVentaDetalleRNC", SqlDbType.Int).Value = CveVentaDetalleRNC
|
||||
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
|
||||
.Add("@CantidadFacturada", SqlDbType.Float).Value = CantidadFacturada
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
OnError("Ocurrió un error al agregar lo facturado de la RNC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function GetRNCRelacionadas(CveVenta As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
@@ -5281,140 +5281,140 @@ Public Class ClsVentas
|
||||
#End Region
|
||||
|
||||
|
||||
Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||
Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@TipoAutorizacion", SqlDbType.Int).Value = TipoAutorizacion
|
||||
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
|
||||
.Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
|
||||
.Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
|
||||
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpdateAutorizacionLimite(CveAutorizacion As Integer, CveCliente As Integer, CveVenta As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionlimitesEstatusUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
Public Function UpdateAutorizacionLimite(CveAutorizacion As Integer, CveCliente As Integer, CveVenta As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionlimitesEstatusUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveAutorizacionLimite(CveAutorizacion As Integer, CveCliente As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
Public Function RemoveAutorizacionLimite(CveAutorizacion As Integer, CveCliente As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_AutorizacionLimitesRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
#Region "C L I E N T E S V E N D E D O R E S S U B P R O Y E C T O S"
|
||||
|
||||
Public Function GetClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ClientesVendedoresSubProyectosGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
Public Function GetClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ClientesVendedoresSubProyectosGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los vendedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener los vendedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function AddClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ClientesVendedoresSubProyectosAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
Public Function AddClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ClientesVendedoresSubProyectosAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ClientesVendedoresSubProyectosRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
Public Function RemoveClientesVendedoresSubProyectos(CveCliente As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_ClientesVendedoresSubProyectosRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el vendedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -2306,7 +2306,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
' COMIENZA: GARANTIAS
|
||||
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then
|
||||
|
||||
Dim CveAlmacenGarantia As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim CveAlmacenGarantia As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim DtGarantias As DataTable = Nothing
|
||||
|
||||
If ObjAcumuladores.GetGarantiasDetalle(CveVentaSurtir) Then
|
||||
@@ -2314,7 +2314,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
If DtGarantias IsNot Nothing AndAlso DtGarantias.Rows.Count > 0 AndAlso CveAlmacenGarantia > 0 Then
|
||||
CveMovimientoGarantia = ObjInventario.AddMovimiento(CveAlmacenGarantia, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, Modulo:="RE/G5")
|
||||
CveMovimientoGarantia = ObjInventario.AddMovimiento(CveAlmacenGarantia, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, Modulo:="EA/G5")
|
||||
FolioGarantia = ObjInventario.Folio
|
||||
|
||||
For Each RowGarantia As DataRow In DtGarantias.Rows
|
||||
@@ -2916,7 +2916,8 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Msg.AppendFormat("<br/><br/>Se agregó una guía de paquetería interna")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDocto = "Rem" Then
|
||||
'SI NO ES GARANTIA MANDA A RECIBIR AL USADO
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDocto = "Rem" AndAlso CveMovimientoGarantia <= 0 Then
|
||||
Msg.AppendFormat("<br/><br/>Recibir Usado: <b><a href=""/Inventarios/RecepcionUsados.aspx?CveRemision={0}"" target=""_blank"" class=""Texto"">Ir a Recepción de Usados</a></b>", CveVentaSurtir)
|
||||
End If
|
||||
|
||||
|
||||
@@ -240,6 +240,15 @@ Partial Class Inventarios_RecepcionUsados
|
||||
ViewState("CveRemisionRecibida") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CargoRemisionDesdeURL As Boolean
|
||||
Get
|
||||
Return CBool(IfNull(ViewState("CargoRemisionDesdeURL"), False, CBool(ViewState("CargoRemisionDesdeURL"))))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("CargoRemisionDesdeURL") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property EsDistribuidor As Boolean
|
||||
Get
|
||||
Return CBool(IfNull(ViewState("EsDistribuidor"), False, CBool(ViewState("EsDistribuidor"))))
|
||||
@@ -348,6 +357,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargoRemisionDesdeURL = False
|
||||
CargaInicial()
|
||||
CargaRemisionFromURL()
|
||||
GeneraRNCFromURL()
|
||||
@@ -431,6 +441,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Dim CveRemision As Integer = IfNull(Request("CveRemision"), "-1").ToString().ToEntero()
|
||||
If CveRemision > 0 Then
|
||||
Me.CargoRemisionDesdeURL = True
|
||||
Me.CveRemisionRecibida = CveRemision
|
||||
RecibirRemision()
|
||||
End If
|
||||
@@ -591,14 +602,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
DdlMoneda.DataSource = GlobalDTMonedas
|
||||
DdlMoneda.DataBind()
|
||||
|
||||
Dim dtt As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
|
||||
|
||||
'Llenar el dropdownlist de almacén
|
||||
DdlAlmacen.DataSource = dtt
|
||||
|
||||
'DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
'DdlAlmacen.SelectedValue = "-1"
|
||||
DdlAlmacen.DataBind()
|
||||
CargaAlmacen()
|
||||
|
||||
If IsNothing(Request("CveMovimiento")) Then
|
||||
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||
@@ -607,6 +611,33 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
CargaPS()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaAlmacen(Optional CveSubProyecto As Integer = -1, Optional TipoAlmacen As Integer = 22)
|
||||
DdlAlmacen.Items.Clear()
|
||||
'Llenar el dropdownlist de almacén
|
||||
Dim dt As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=TipoAlmacen)
|
||||
|
||||
If CveSubProyecto > 0 Then
|
||||
dt = dt.FiltraParametros($"CveSubProyecto = {CveSubProyecto}")
|
||||
End If
|
||||
|
||||
DdlAlmacen.DataSource = dt
|
||||
DdlAlmacen.DataBind()
|
||||
|
||||
If Not DdlAlmacen.Items.Contains(New ListItem("Seleccione", "-1")) Then
|
||||
DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
If CveSubProyecto > 0 Then
|
||||
Dim CveAlmacen As Integer = dt.FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyecto}").ToEntero()
|
||||
If CveAlmacen > 0 Then
|
||||
DdlAlmacen.SelectedValueExist(CveAlmacen)
|
||||
End If
|
||||
End If
|
||||
|
||||
dt.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
Dim ObjAcum As New ClsAcumuladores
|
||||
Dim lista As New List(Of String)
|
||||
@@ -723,6 +754,8 @@ Partial Class Inventarios_RecepcionUsados
|
||||
ObjFactura = Nothing
|
||||
End If
|
||||
|
||||
DivRemisionRecibida.Visible = False
|
||||
|
||||
If ObjRemisionNC IsNot Nothing Then
|
||||
ObjRemisionNC.Dispose()
|
||||
ObjRemisionNC = Nothing
|
||||
@@ -753,9 +786,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
DivRegistro.Visible = False
|
||||
DivTipoCambio.Visible = False
|
||||
|
||||
If Not DdlAlmacen.Items.Contains(New ListItem("Seleccione", "-1")) Then
|
||||
DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
CargaAlmacen()
|
||||
|
||||
DdlAlmacen.SelectedValue = "-1"
|
||||
If Not EsConsumoInterno Then
|
||||
@@ -785,6 +816,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
'CargaInicial()
|
||||
|
||||
UpGenerales.Update()
|
||||
UpRegistroTipoCambio.Update()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
@@ -1162,7 +1194,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Guardar(True)
|
||||
End Sub
|
||||
|
||||
Protected Sub Guardar(Optional GenerarRNC As Boolean = False)
|
||||
Protected Sub Guardar(Optional GenerarRNC As Boolean = False, Optional RecargarPagina As Boolean = False)
|
||||
If GvM.Rows.Count > 0 Then
|
||||
Dim Msg As New StringBuilder()
|
||||
Dim Resp As Modelos.Factura.MMensajeFactura = Nothing
|
||||
@@ -1350,7 +1382,13 @@ Partial Class Inventarios_RecepcionUsados
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||
Dim Liga As String = ""
|
||||
|
||||
If RecargarPagina Then
|
||||
Liga = "document.location.href=""/Inventarios/RecepcionUsados.aspx"";"
|
||||
End If
|
||||
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, JSBtnAceptar:=Liga, ShowCloseButton:=False)
|
||||
End If
|
||||
|
||||
Else
|
||||
@@ -2206,19 +2244,6 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Private Sub RecibirRemision()
|
||||
DtMovimientos.Rows.Clear()
|
||||
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
Dim CveCliente As Integer = -1
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveRemisionRecibida, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
EsDistribuidor = CBool(ObjVentas.DtResultados.Rows(0)("EsDistribuidor").ToString())
|
||||
CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero()
|
||||
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCliente = {0}", CveCliente))
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.SelectedValueExist(CveCliente)
|
||||
End If
|
||||
|
||||
If Me.ObjFactura IsNot Nothing Then
|
||||
Me.ObjFactura.Dispose()
|
||||
Me.ObjFactura = Nothing
|
||||
@@ -2226,54 +2251,95 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas)
|
||||
|
||||
TxtRemisionRecibida.Text = Me.ObjFactura.SerieFolio
|
||||
DivRemisionRecibida.Visible = True
|
||||
If Me.ObjFactura IsNot Nothing Then
|
||||
|
||||
'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO
|
||||
If EsDistribuidor Then
|
||||
DivCliente.Visible = True
|
||||
DdlClientes.SelectedValueExist(CveCliente)
|
||||
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
|
||||
TxtRemisionRecibida.Text = Me.ObjFactura.SerieFolio
|
||||
DivRemisionRecibida.Visible = True
|
||||
|
||||
If Me.ObjRemisionNC IsNot Nothing Then
|
||||
Me.ObjRemisionNC.Dispose()
|
||||
Me.ObjRemisionNC = Nothing
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
Dim CveCliente As Integer = -1
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetVenta(CveRemisionRecibida, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
EsDistribuidor = CBool(ObjVentas.DtResultados.Rows(0)("EsDistribuidor").ToString())
|
||||
CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
If Me.ObjFactura IsNot Nothing Then
|
||||
'CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
|
||||
DivTotal.Visible = True
|
||||
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
||||
DtUsados = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
Dim RecepcionValida As Boolean = True
|
||||
|
||||
If ObjVentas.GetVentasUsados(ObjFactura.CveVenta, ObjFactura.CveSubProyecto, ObjFactura.Fecha, UsuarioActual.CveEmpresa, ServicioDomicilio:=ObjFactura.ServicioDomicilio) Then
|
||||
If ObjVentas.DtResultados.Rows.Count = 0 Then
|
||||
RecepcionValida = False
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If Not RecepcionValida Then
|
||||
Dim Liga As String = ""
|
||||
If CargoRemisionDesdeURL Then
|
||||
Liga = "document.location.href=""/Inventarios/RecepcionUsados.aspx"";"
|
||||
End If
|
||||
|
||||
Alert("La recepción del usado ya se realizó", TipoMensaje.MsgAdvertencia, JSBtnAceptar:=Liga, ShowCloseButton:=False)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If ObjFactura.CveSubProyecto > 0 Then
|
||||
CargaAlmacen(CveSubProyecto:=ObjFactura.CveSubProyecto)
|
||||
End If
|
||||
|
||||
If CveCliente > 0 Then
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCliente = {0}", CveCliente))
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.SelectedValueExist(CveCliente)
|
||||
End If
|
||||
|
||||
'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO
|
||||
If EsDistribuidor Then
|
||||
DivCliente.Visible = True
|
||||
DdlClientes.SelectedValueExist(CveCliente)
|
||||
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
|
||||
|
||||
If Me.ObjRemisionNC IsNot Nothing Then
|
||||
Me.ObjRemisionNC.Dispose()
|
||||
Me.ObjRemisionNC = Nothing
|
||||
End If
|
||||
|
||||
If Me.ObjFactura IsNot Nothing Then
|
||||
'CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
|
||||
DivTotal.Visible = True
|
||||
End If
|
||||
Else
|
||||
'DivCliente.Visible = False
|
||||
'DivFactura.Visible = False
|
||||
End If
|
||||
|
||||
If DtUsados IsNot Nothing Then
|
||||
|
||||
'DivRecepcionApartado.Visible = True
|
||||
|
||||
For Each RowUsado As DataRow In DtUsados.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
|
||||
Dim RowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
|
||||
Dim CveTamaño As Integer = RowPS("CveTamaño").ToString().ToEntero()
|
||||
|
||||
Dim PS As String = RowPS("PS").ToString()
|
||||
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
|
||||
Dim UM As String = RowPS("UnidadMedida").ToString()
|
||||
Dim Cantidad As Double = RowUsado("Cantidad").ToString().ToEntero()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
|
||||
AddNew(CvePS, PS, CveUM, UM, Cantidad, PU, "", "-1", "-1", "-1", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño)
|
||||
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
'DivCliente.Visible = False
|
||||
'DivFactura.Visible = False
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
||||
DtUsados = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If DtUsados IsNot Nothing Then
|
||||
|
||||
'DivRecepcionApartado.Visible = True
|
||||
|
||||
For Each RowUsado As DataRow In DtUsados.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
|
||||
Dim RowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
|
||||
Dim CveTamaño As Integer = RowPS("CveTamaño").ToString().ToEntero()
|
||||
|
||||
Dim PS As String = RowPS("PS").ToString()
|
||||
Dim CveUM As Integer = RowPS("CveUnidadMedida").ToString().ToEntero()
|
||||
Dim UM As String = RowPS("UnidadMedida").ToString()
|
||||
Dim Cantidad As Double = RowUsado("Cantidad").ToString().ToEntero()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
|
||||
AddNew(CvePS, PS, CveUM, UM, Cantidad, PU, "", "-1", "-1", "-1", "", "", DdlAlmacen.SelectedValue.ToEntero, DdlAlmacen.SelectedItem.Text, "", CveTamaño)
|
||||
|
||||
Next
|
||||
Alert("No se pudo recibir la remisión", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
UpGenerales.Update()
|
||||
@@ -2801,8 +2867,9 @@ Partial Class Inventarios_RecepcionUsados
|
||||
If DdlClientes.SelectedValue <> "-1" Then
|
||||
CargaAjuste()
|
||||
DivAjuste.Visible = True
|
||||
DivRecepcionUsados.Visible = False
|
||||
'Llenar el dropdownlist de almacén
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6)
|
||||
CargaAlmacen(TipoAlmacen:=6)
|
||||
CargarDescuento()
|
||||
LnkAgregarUsado.Visible = False
|
||||
UppAcciones.Update()
|
||||
@@ -2812,8 +2879,9 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
Else
|
||||
DivAjuste.Visible = False
|
||||
DivRecepcionUsados.Visible = True
|
||||
'Llenar el dropdownlist de almacén
|
||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 22)
|
||||
CargaAlmacen(TipoAlmacen:=22)
|
||||
LnkAgregarUsado.Visible = True
|
||||
UppAcciones.Update()
|
||||
End If
|
||||
@@ -3384,7 +3452,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}//{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim DtDatos As New DataTable
|
||||
Dim DtDatos As New DataTable
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
|
||||
|
||||
@@ -196,19 +196,22 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
|
||||
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim TipoAutorizacion = gvRow.DataKey("TipoAutorizacion").ToEntero()
|
||||
Dim CveAutorizacion = gvRow.DataKey("CveAutorizacion").ToEntero()
|
||||
Dim CveCliente = gvRow.DataKey("CveCliente").ToEntero()
|
||||
Dim TipoAutorizacion = gvRow.DataKey("TipoAutorizacion").ToEntero()
|
||||
Dim CveVendedor = gvRow.DataKey("CveVendedor").ToEntero()
|
||||
Dim CveEstatusAutorizacion As Integer = 1
|
||||
|
||||
Dim Importe = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
|
||||
Dim CveCliente = gvRow.DataKey("CveCliente").ToEntero()
|
||||
Dim CveVendedor = gvRow.DataKey("CveVendedor").ToEntero()
|
||||
'AUTORIZACION DE IMPORTE,
|
||||
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
|
||||
If TipoAutorizacion = 1 Then
|
||||
|
||||
Dim SaldoCliente = gvRow.DataKey("Saldo").ToDecimal()
|
||||
Dim LimiteCredito = gvRow.DataKey("LimiteCredito").ToDecimal()
|
||||
'SI EL LIMITE ES 0, PERMITE AUTORIZAR
|
||||
If LimiteCredito > 0 Then
|
||||
Dim Importe = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
|
||||
'AUTORIZACION DE IMPORTE,
|
||||
'el cliente limite de 500, y saldo de 501. autorización que puede autorizar no puede ser mayor a 49 ( limite * 1.% - Saldo)
|
||||
If TipoAutorizacion = 1 Then
|
||||
|
||||
Dim SaldoCliente = gvRow.DataKey("Saldo").ToDecimal()
|
||||
Dim PorcentajeMaximoAutorizar As Decimal = 0.1
|
||||
|
||||
If UsuarioActual.PorcentajeMaximoAutorizacion > 0 Then
|
||||
|
||||
@@ -3219,7 +3219,7 @@ Partial Class Ventas
|
||||
|
||||
If ObjPVenta.DtResultados.Rows.Count > 0 Then
|
||||
CveCorte = ObjPVenta.CveCorte
|
||||
Dim FechaICorte = ObjPVenta.FechaInicial.Date'.AddDays(-5)
|
||||
Dim FechaICorte = ObjPVenta.FechaInicial.Date '.AddDays(-5)
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < Now.Date Then
|
||||
DebeCerrarCorte = True
|
||||
LblMotivoBloqueo.Text = $"Existe un corte del día <b>{FechaICorte.ToString("dd/MM/yyyy")}</b>. Favor de cerrarlo para iniciar un nuevo corte."
|
||||
@@ -4254,16 +4254,8 @@ Partial Class Ventas
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero()
|
||||
HdnCveVenta.Value = CveVenta.ToString()
|
||||
Dim DtUsadosPendientes As DataTable = Nothing
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim ObjUsados As New ClsVentas
|
||||
|
||||
If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
||||
DtUsadosPendientes = ObjUsados.DtResultados
|
||||
End If
|
||||
ObjUsados.Dispose()
|
||||
End If
|
||||
Me.EsGarantia = CBool(DbRowVenta("EsGarantia"))
|
||||
|
||||
RFCReceptorVenta = DbRowVenta("RFCReceptor").ToString()
|
||||
'Adjuntar archivo
|
||||
@@ -4284,7 +4276,7 @@ Partial Class Ventas
|
||||
|
||||
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
|
||||
|
||||
Me.EsGarantia = CBool(DbRowVenta("EsGarantia"))
|
||||
|
||||
|
||||
Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero()
|
||||
'CargaEncabezado
|
||||
@@ -5198,13 +5190,47 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'Si es Empresa de Acumuladores
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
'Si ya se surtió y recibió
|
||||
If (DbRowVenta("SaldoAlmacen").ToString().ToDecimal > 0 And (DtUsadosPendientes Is Nothing Or DtUsadosPendientes.Rows.Count = 0)) OrElse (TmpDT.MAX("CveTipoPS") = "1") Then
|
||||
BtnsFacturar.Visible = True
|
||||
Else
|
||||
BtnsFacturar.Visible = False
|
||||
If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Rem" AndAlso (GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() <> 5) Then
|
||||
|
||||
BtnsFacturar.Visible = False
|
||||
|
||||
Dim DtUsadosPendientes As DataTable = Nothing
|
||||
Dim DtGarantiasPendientes As DataTable = Nothing
|
||||
|
||||
Dim ObjUsados As New ClsVentas
|
||||
|
||||
If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
|
||||
DtUsadosPendientes = ObjUsados.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
If ObjUsados.GetVentasGarantiaPendiente(CveVenta, Now, UsuarioActual.CveEmpresa) Then
|
||||
DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then
|
||||
' DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
|
||||
'End If
|
||||
ObjUsados.Dispose()
|
||||
|
||||
'Si ya se surtió y recibió
|
||||
If DbRowVenta("SaldoAlmacen").ToString().ToDecimal > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then
|
||||
BtnsFacturar.Visible = True
|
||||
End If
|
||||
|
||||
'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES
|
||||
If BtnsFacturar.Visible Then
|
||||
If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then
|
||||
BtnsFacturar.Visible = False
|
||||
Alert("Tiene usados pendiente de recibir", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If (EsGarantia AndAlso (DtGarantiasPendientes IsNot Nothing AndAlso DtGarantiasPendientes.Rows.Count > 0)) Then
|
||||
Alert("Tiene garantías pendientes de recibir", TipoMensaje.MsgAdvertencia)
|
||||
BtnsFacturar.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
||||
End If
|
||||
|
||||
@@ -5335,6 +5361,14 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 5 Then
|
||||
BtnsFacturar.Visible = False
|
||||
BtnEmitirImprimir.Visible = False
|
||||
BtnPermisoEditarRemision.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
UpPS.Update()
|
||||
UpContado.Update()
|
||||
UpEstatus.Update()
|
||||
@@ -6713,19 +6747,21 @@ Partial Class Ventas
|
||||
Else
|
||||
|
||||
'VERIFICAR RESTRICCIONES DEL CLIENTE
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2" Then
|
||||
Dim Vta As New ClsVentas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
Vta.Dispose()
|
||||
If Opcion > 0 Then
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
If Not UsuarioActual.Empresa.Funcionalidad(702).ToEntero() > 0 Then
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2" Then
|
||||
Dim Vta As New ClsVentas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
Vta.Dispose()
|
||||
If Opcion > 0 Then
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
UPPCreditoDisponible.Update()
|
||||
@@ -11504,7 +11540,7 @@ Partial Class Ventas
|
||||
DdlTipoComprobante.Enabled = False
|
||||
End If
|
||||
|
||||
TAB.ActiveTab = TabGenerales
|
||||
Tab.ActiveTab = TabGenerales
|
||||
TabGenerales.Enabled = True
|
||||
Updatetabs.Update()
|
||||
UPObservaciones.Update()
|
||||
@@ -11570,7 +11606,7 @@ Partial Class Ventas
|
||||
ContratoDetalles.Visible = False
|
||||
UPEstimaciones.Update()
|
||||
|
||||
TAB.ActiveTab = TabGenerales
|
||||
Tab.ActiveTab = TabGenerales
|
||||
TabGenerales.Enabled = True
|
||||
Updatetabs.Update()
|
||||
End If
|
||||
@@ -15342,7 +15378,7 @@ Partial Class Ventas
|
||||
ErrorConta = True
|
||||
End If
|
||||
|
||||
If Not ErrorConta AndAlso Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
If Not ErrorConta AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrepoliza, UsuarioActual.CveEmpresa) Then
|
||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
@@ -16507,7 +16543,7 @@ Partial Class Ventas
|
||||
If objcompras.GetCompraDetallealmacen(0, DdlNCFactura.SelectedValue.ToEntero()) Then
|
||||
GvInvNC.DataSource = objcompras.DtResultados
|
||||
If objcompras.DtResultados.Rows.Count > 0 Then
|
||||
TAB.ActiveTabIndex = 1
|
||||
Tab.ActiveTabIndex = 1
|
||||
Updatetabs.Update()
|
||||
End If
|
||||
Else
|
||||
@@ -16787,7 +16823,7 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
UpParametros.Update()
|
||||
TAB.ActiveTab = TabGenerales
|
||||
Tab.ActiveTab = TabGenerales
|
||||
Else
|
||||
Alert("La empresa no contiene un producto asignado a la estimació", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
@@ -23621,7 +23657,7 @@ Partial Class Ventas
|
||||
DdlContratosModal.Items.Insert(0, New ListItem("Seleccione", "0"))
|
||||
UPEstimaciones.Update()
|
||||
|
||||
TAB.ActiveTab = TabE
|
||||
Tab.ActiveTab = TabE
|
||||
TabGenerales.Enabled = False
|
||||
Updatetabs.Update()
|
||||
|
||||
@@ -29911,7 +29947,7 @@ Partial Class Ventas
|
||||
ContratoDetalles.Visible = False
|
||||
UPEstimaciones.Update()
|
||||
|
||||
TAB.ActiveTab = TabGenerales
|
||||
Tab.ActiveTab = TabGenerales
|
||||
TabGenerales.Enabled = True
|
||||
Updatetabs.Update()
|
||||
|
||||
@@ -30472,7 +30508,7 @@ Partial Class Ventas
|
||||
DdlMonedaModalPedido2.DataBind()
|
||||
DdlMonedaModalPedido2.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||
|
||||
TAB.ActiveTab = TabGenerales
|
||||
Tab.ActiveTab = TabGenerales
|
||||
TabGenerales.Enabled = True
|
||||
Updatetabs.Update()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user