This commit is contained in:
rakcsle
2022-02-08 10:57:53 -07:00
25 changed files with 518 additions and 397 deletions

View File

@@ -117,7 +117,7 @@ Partial Class Acumuladores_RepEntradasUsados
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim workbook As New ExcelFile() 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 worksheet.InsertDataTable(dt, New InsertDataTableOptions() With
{ {
.ColumnHeaders = True, .ColumnHeaders = True,
@@ -129,6 +129,10 @@ Partial Class Acumuladores_RepEntradasUsados
Dim columnCount = worksheet.CalculateMaxUsedColumns() Dim columnCount = worksheet.CalculateMaxUsedColumns()
For i = 0 To columnCount 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)) worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
Next Next

View File

@@ -1504,7 +1504,8 @@ Public Class ClsMovimientos
Optional CveBanco As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveBanco As Integer = -1, Optional CveCuenta As Integer = -1,
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1,
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = MinFecha, Optional FechaAplicadoF As Date = MaxFecha, Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = MinFecha, Optional FechaAplicadoF As Date = MaxFecha,
Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha) As Boolean Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
Optional CveCondicionesPago As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepRecuperacion") DataAdapter("PA_Vta_RepRecuperacion")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -1528,6 +1529,7 @@ Public Class ClsMovimientos
.Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor .Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
.Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString .Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString
.Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString .Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString

View File

@@ -144,13 +144,14 @@ Public Class ClsVentas
End Sub End Sub
#End Region #End Region
Public Function GetVenta(CveVenta As Integer, CveEmpresa As Integer) As Boolean Public Function GetVenta(CveVenta As Integer, CveEmpresa As Integer, Optional VerificaAlmacen As Boolean = True) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasGet") DataAdapter("PA_VentasGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@VerificaAlmacen", SqlDbType.Bit).Value = If(VerificaAlmacen, 1, 0)
End With End With
Try Try
@@ -1664,7 +1665,7 @@ Public Class ClsVentas
Optional TipoDocto As String = "-1", Optional GPO As Integer = -1, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TipoDocto As String = "-1", Optional GPO As Integer = -1, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1,
Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1,
Optional CveClasificacionDetalle As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False, Optional CveClasificacionDetalle As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False,
Optional EsGarantia As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional EsDistribuidor As Integer = -1) As Boolean Optional EsGarantia As Integer = -1, Optional MostrarLitraje As Boolean = False, Optional CveCondicionesPago As Integer = -1, Optional EsDistribuidor As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_GetRepPSDetalle") DataAdapter("PA_Vta_GetRepPSDetalle")
@@ -1696,6 +1697,7 @@ Public Class ClsVentas
.Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle
.Add("@MostrarLitraje", SqlDbType.Bit).Value = MostrarLitraje
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente .Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable .Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
.Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia
@@ -3122,7 +3124,7 @@ Public Class ClsVentas
Else Else
If showalert Then If showalert Then
Alert("No se encontraron cancelaciones pendientes", ModExtensiones.TipoMensaje.MsgError) Alert("No se encontraron cancelaciones pendientes", ModExtensiones.TipoMensaje.MsgAdvertencia)
End If End If
End If End If
Else Else
@@ -5094,7 +5096,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasGarantiasPendienteGet", CommandType.StoredProcedure) DataAdapter("PA_Vta_VentasGarantiasPendienteGet", CommandType.StoredProcedure)

View File

@@ -3920,7 +3920,7 @@ Public Class Timbrado
#Region "Timbra" #Region "Timbra"
If ArchivoGenerado Then If ArchivoGenerado Then
cfdi.TimbrarCfdi(UsuarioServicio, ClaveServicio, UrlServicio, TimbraProduccion) cfdi.TimbrarCfdi(UsuarioServicio, ClaveServicio, TimbraProduccion)
sw.Stop() sw.Stop()
swTiempo.AppendFormat("Timbrado: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds) swTiempo.AppendFormat("Timbrado: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)

View File

@@ -2614,7 +2614,7 @@ Partial Class Bancos_IE
End If End If
End If End If
If Opcion = "DevDinC" Then If Opcion = "DevDinC" Then
CvePlantillaPoliza = 2 CvePlantillaPoliza = 40
End If End If
'Cuando es Egreso sin factura, se registra una compra tipo anticipo 'Cuando es Egreso sin factura, se registra una compra tipo anticipo
@@ -3068,6 +3068,7 @@ Partial Class Bancos_IE
Dim ImporteAplicarMN = 0.0D Dim ImporteAplicarMN = 0.0D
Dim ImporteAplicarME = 0.0D Dim ImporteAplicarME = 0.0D
Dim ReferenciaAplicar = ObjIE.Folio Dim ReferenciaAplicar = ObjIE.Folio
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveSubProyecto).FiltroPrimeroValor("CveSubProyecto").ToEntero
Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}" Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}"
@@ -3398,7 +3399,7 @@ Partial Class Bancos_IE
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=Impo, ImporteME:=0, TipoCambio:=TCDocumento) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=Impo, ImporteME:=0, TipoCambio:=TCDocumento, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
Exit Select Exit Select
End If End If

View File

@@ -1523,7 +1523,7 @@ Partial Class Bancos_PopIEVentas
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If

View File

@@ -929,7 +929,7 @@ Partial Class Bancos_ProveedoresAbonar
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If

Binary file not shown.

View File

@@ -6900,7 +6900,7 @@ Partial Class Compras_Compras
Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacion69}").ToString.ToEntero Dim IdCtaContable69 As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacion69}").ToString.ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaDevolucion, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69, CveClasificacion:=CveClasificacion69) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaDevolucion, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable69, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=DiferenciaDevolucion, ImporteME:=If(tipoCambioActual = 1, 0, DiferenciaDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69, CveClasificacion:=CveClasificacion69) Then
ErrorPrepoliza = True ErrorPrepoliza = True
End If End If
End If End If

View File

@@ -952,7 +952,7 @@ Partial Class PopUpVerFactura
Dim EnvioContacto As String = "" Dim EnvioContacto As String = ""
Dim EnvioDireccion As String = "" Dim EnvioDireccion As String = ""
Dim Guia As String = "" Dim Guia As String = ""
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, False) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.DtResultados.Rows.Count > 0 Then
SerieFolio = ObjVentas.DtResultados.Rows(0)("SerieFolio").ToString SerieFolio = ObjVentas.DtResultados.Rows(0)("SerieFolio").ToString
PedidoContrato = ObjVentas.DtResultados.Rows(0)("PedidoContrato").ToString PedidoContrato = ObjVentas.DtResultados.Rows(0)("PedidoContrato").ToString
@@ -1838,7 +1838,7 @@ Partial Class PopUpVerFactura
TmpDTImpuestosIVAIEPS.Columns.Add("Importe", GetType(Double)) TmpDTImpuestosIVAIEPS.Columns.Add("Importe", GetType(Double))
TmpDTImpuestosIVAIEPS.Columns.Add("Orden", GetType(Integer)) TmpDTImpuestosIVAIEPS.Columns.Add("Orden", GetType(Integer))
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, False) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
Dim dtVentas As DataTable = ObjVentas.DtResultados Dim dtVentas As DataTable = ObjVentas.DtResultados
' se rellenan los campos de la factura ' se rellenan los campos de la factura
@@ -4849,7 +4849,7 @@ Partial Class PopUpVerFactura
Dim drv As DataRow = Nothing Dim drv As DataRow = Nothing
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, False) AndAlso ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
drv = ObjVentas.DtResultados.FiltroPrimero("") drv = ObjVentas.DtResultados.FiltroPrimero("")
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()

View File

@@ -2306,7 +2306,7 @@ Partial Class Inventarios_EntregaAlmacen
' COMIENZA: GARANTIAS ' COMIENZA: GARANTIAS
If Not ErrorMovInv AndAlso TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then 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 Dim DtGarantias As DataTable = Nothing
If ObjAcumuladores.GetGarantiasDetalle(CveVentaSurtir) Then If ObjAcumuladores.GetGarantiasDetalle(CveVentaSurtir) Then
@@ -2314,7 +2314,7 @@ Partial Class Inventarios_EntregaAlmacen
End If End If
If DtGarantias IsNot Nothing AndAlso DtGarantias.Rows.Count > 0 AndAlso CveAlmacenGarantia > 0 Then 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 FolioGarantia = ObjInventario.Folio
For Each RowGarantia As DataRow In DtGarantias.Rows 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") Msg.AppendFormat("<br/><br/>Se agregó una guía de paquetería interna")
End If 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) 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 End If

View File

@@ -4874,10 +4874,9 @@ Partial Class Inventarios_RecepcionAlmacen
Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal() Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal()
Dim Serie As String = RowExcel("Serie").ToString() Dim Serie As String = RowExcel("Serie").ToString()
Dim Lote As String '= RowExcel("Lote").ToString() Dim Lote As String = "" '= RowExcel("Lote").ToString()
Dim FechaCaducidad As Date '= If(RowExcel("FechaCaducidad").ToString = "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate) Dim FechaCaducidad As Date = MinFecha '= If(RowExcel("FechaCaducidad").ToString = "", MinFecha, RowExcel("FechaCaducidad").ToString.ToDate)
Dim Observaciones As String '= If(dt.Columns.Contains("Observaciones"), RowExcel("Observaciones").ToString, "").ToString Dim Observaciones As String = "" '= If(dt.Columns.Contains("Observaciones"), RowExcel("Observaciones").ToString, "").ToString
Dim Valido As Boolean = True Dim Valido As Boolean = True

View File

@@ -240,6 +240,15 @@ Partial Class Inventarios_RecepcionUsados
ViewState("CveRemisionRecibida") = value ViewState("CveRemisionRecibida") = value
End Set End Set
End Property 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 Private Property EsDistribuidor As Boolean
Get Get
Return CBool(IfNull(ViewState("EsDistribuidor"), False, CBool(ViewState("EsDistribuidor")))) 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 Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CargoRemisionDesdeURL = False
CargaInicial() CargaInicial()
CargaRemisionFromURL() CargaRemisionFromURL()
GeneraRNCFromURL() GeneraRNCFromURL()
@@ -431,6 +441,7 @@ Partial Class Inventarios_RecepcionUsados
Dim CveRemision As Integer = IfNull(Request("CveRemision"), "-1").ToString().ToEntero() Dim CveRemision As Integer = IfNull(Request("CveRemision"), "-1").ToString().ToEntero()
If CveRemision > 0 Then If CveRemision > 0 Then
Me.CargoRemisionDesdeURL = True
Me.CveRemisionRecibida = CveRemision Me.CveRemisionRecibida = CveRemision
RecibirRemision() RecibirRemision()
End If End If
@@ -591,14 +602,7 @@ Partial Class Inventarios_RecepcionUsados
DdlMoneda.DataSource = GlobalDTMonedas DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind() DdlMoneda.DataBind()
Dim dtt As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (22)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) CargaAlmacen()
'Llenar el dropdownlist de almacén
DdlAlmacen.DataSource = dtt
'DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
'DdlAlmacen.SelectedValue = "-1"
DdlAlmacen.DataBind()
If IsNothing(Request("CveMovimiento")) Then If IsNothing(Request("CveMovimiento")) Then
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
@@ -607,6 +611,33 @@ Partial Class Inventarios_RecepcionUsados
CargaPS() CargaPS()
End Sub 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() Private Sub CargaPS()
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
Dim lista As New List(Of String) Dim lista As New List(Of String)
@@ -723,6 +754,8 @@ Partial Class Inventarios_RecepcionUsados
ObjFactura = Nothing ObjFactura = Nothing
End If End If
DivRemisionRecibida.Visible = False
If ObjRemisionNC IsNot Nothing Then If ObjRemisionNC IsNot Nothing Then
ObjRemisionNC.Dispose() ObjRemisionNC.Dispose()
ObjRemisionNC = Nothing ObjRemisionNC = Nothing
@@ -753,9 +786,7 @@ Partial Class Inventarios_RecepcionUsados
DivRegistro.Visible = False DivRegistro.Visible = False
DivTipoCambio.Visible = False DivTipoCambio.Visible = False
If Not DdlAlmacen.Items.Contains(New ListItem("Seleccione", "-1")) Then CargaAlmacen()
DdlAlmacen.Items.Add(New ListItem("Seleccione", "-1"))
End If
DdlAlmacen.SelectedValue = "-1" DdlAlmacen.SelectedValue = "-1"
If Not EsConsumoInterno Then If Not EsConsumoInterno Then
@@ -785,6 +816,7 @@ Partial Class Inventarios_RecepcionUsados
'CargaInicial() 'CargaInicial()
UpGenerales.Update()
UpRegistroTipoCambio.Update() UpRegistroTipoCambio.Update()
UPDatos.Update() UPDatos.Update()
End Sub End Sub
@@ -1162,7 +1194,7 @@ Partial Class Inventarios_RecepcionUsados
Guardar(True) Guardar(True)
End Sub 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 If GvM.Rows.Count > 0 Then
Dim Msg As New StringBuilder() Dim Msg As New StringBuilder()
Dim Resp As Modelos.Factura.MMensajeFactura = Nothing Dim Resp As Modelos.Factura.MMensajeFactura = Nothing
@@ -1350,7 +1382,13 @@ Partial Class Inventarios_RecepcionUsados
ObjVentas.Dispose() ObjVentas.Dispose()
If Not ErrorMovInv Then 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 End If
Else Else
@@ -2206,19 +2244,6 @@ Partial Class Inventarios_RecepcionUsados
Private Sub RecibirRemision() Private Sub RecibirRemision()
DtMovimientos.Rows.Clear() 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 If Me.ObjFactura IsNot Nothing Then
Me.ObjFactura.Dispose() Me.ObjFactura.Dispose()
Me.ObjFactura = Nothing Me.ObjFactura = Nothing
@@ -2226,54 +2251,95 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas) Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas)
TxtRemisionRecibida.Text = Me.ObjFactura.SerieFolio If Me.ObjFactura IsNot Nothing Then
DivRemisionRecibida.Visible = True
'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO TxtRemisionRecibida.Text = Me.ObjFactura.SerieFolio
If EsDistribuidor Then DivRemisionRecibida.Visible = True
DivCliente.Visible = True
DdlClientes.SelectedValueExist(CveCliente)
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
If Me.ObjRemisionNC IsNot Nothing Then Dim DtUsados As DataTable = Nothing
Me.ObjRemisionNC.Dispose() Dim CveCliente As Integer = -1
Me.ObjRemisionNC = Nothing
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 End If
If Me.ObjFactura IsNot Nothing Then If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
'CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda) DtUsados = ObjVentas.DtResultados.Copy()
DivTotal.Visible = True 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 End If
Else Else
'DivCliente.Visible = False Alert("No se pudo recibir la remisión", TipoMensaje.MsgAdvertencia)
'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
End If End If
UpGenerales.Update() UpGenerales.Update()
@@ -2801,8 +2867,9 @@ Partial Class Inventarios_RecepcionUsados
If DdlClientes.SelectedValue <> "-1" Then If DdlClientes.SelectedValue <> "-1" Then
CargaAjuste() CargaAjuste()
DivAjuste.Visible = True DivAjuste.Visible = True
DivRecepcionUsados.Visible = False
'Llenar el dropdownlist de almacén 'Llenar el dropdownlist de almacén
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6) CargaAlmacen(TipoAlmacen:=6)
CargarDescuento() CargarDescuento()
LnkAgregarUsado.Visible = False LnkAgregarUsado.Visible = False
UppAcciones.Update() UppAcciones.Update()
@@ -2812,8 +2879,9 @@ Partial Class Inventarios_RecepcionUsados
End If End If
Else Else
DivAjuste.Visible = False DivAjuste.Visible = False
DivRecepcionUsados.Visible = True
'Llenar el dropdownlist de almacén 'Llenar el dropdownlist de almacén
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 22) CargaAlmacen(TipoAlmacen:=22)
LnkAgregarUsado.Visible = True LnkAgregarUsado.Visible = True
UppAcciones.Update() UppAcciones.Update()
End If 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 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 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) Dim params As New List(Of ReportParameter)

View File

@@ -132,7 +132,7 @@
<Columns> <Columns>
<asp:HyperLinkField HeaderText="Fecha" ItemStyle-Width="75px" DataTextField="FechaMovto" ItemStyle-CssClass="Texto" DataNavigateUrlFields="CveMovimiento" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" /> <asp:HyperLinkField HeaderText="Fecha" ItemStyle-Width="75px" DataTextField="FechaMovto" ItemStyle-CssClass="Texto" DataNavigateUrlFields="CveMovimiento" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" />
<asp:BoundField HeaderText="Almacen" DataField="Almacen" /> <asp:BoundField HeaderText="Almacen" DataField="Almacen" />
<asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField="Folio" ItemStyle-CssClass="Texto" DataNavigateUrlFields="CveMovimiento" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" /> <asp:HyperLinkField HeaderText="Folio" ItemStyle-Width="100px" DataTextField="Folio" ItemStyle-CssClass="Texto" DataNavigateUrlFields="CveMovimiento" ItemStyle-HorizontalAlign="Right" DataNavigateUrlFormatString="/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}" />
<asp:BoundField HeaderText="Activo Fijo" DataField="CodigoAF" ItemStyle-HorizontalAlign="Left" Visible="false" /> <asp:BoundField HeaderText="Activo Fijo" DataField="CodigoAF" ItemStyle-HorizontalAlign="Left" Visible="false" />
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" Visible="false" /> <asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" ItemStyle-HorizontalAlign="Left" Visible="false" />
<asp:BoundField HeaderText="Entradas" ItemStyle-Width="75px" DataField="Entradas" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right"/> <asp:BoundField HeaderText="Entradas" ItemStyle-Width="75px" DataField="Entradas" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right"/>

View File

@@ -129,6 +129,8 @@ Partial Class Inventarios_RepExistenciasCostos
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1) DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
DdlAlmacen.DataBind() DdlAlmacen.DataBind()
DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
If Not IsNothing(Request("CveAlmacen")) Then If Not IsNothing(Request("CveAlmacen")) Then
If DdlAlmacen.Items.FindByValue(Request("CveAlmacen").ToString) Is Nothing Then If DdlAlmacen.Items.FindByValue(Request("CveAlmacen").ToString) Is Nothing Then
Dim CveAlmacen = Request("CveAlmacen").ToString Dim CveAlmacen = Request("CveAlmacen").ToString

View File

@@ -644,15 +644,6 @@ Partial Class Inventarios_TraspasoAlmacen
Dim tSerie As String = If(TxtnSerie.Visible, TxtnSerie.Text, "-1") Dim tSerie As String = If(TxtnSerie.Visible, TxtnSerie.Text, "-1")
'If UsuarioActual.CveEmpresa = 140 Then
' Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").ToEntero
' If Not CveSubProyecto.Contiene(11791, 11793, 11993, 11994, 11794, 11797, 11795, 12010, 12011) Then
' tSerie = "-1"
' End If
'End If
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, tSerie, tLote, tCaducidad) Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, tSerie, tLote, tCaducidad)
If Valido Then If Valido Then
@@ -1476,16 +1467,6 @@ Partial Class Inventarios_TraspasoAlmacen
Dim AplicaSerie As Boolean = CBool(drP("AplicaSerie")) Dim AplicaSerie As Boolean = CBool(drP("AplicaSerie"))
''codigo temporal
'If UsuarioActual.CveEmpresa = 140 Then
' Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {DdlAlmacenOrigen.SelectedValue}").ToEntero
' If Not CveSubProyecto.Contiene(11793, 11993, 11794, 11795, 12010, 12011) Then
' AplicaSerie = False
' End If
'End If
ThSerie.Visible = AplicaSerie ThSerie.Visible = AplicaSerie
TdSerie.Visible = AplicaSerie TdSerie.Visible = AplicaSerie
TxtnSerie.Visible = AplicaSerie TxtnSerie.Visible = AplicaSerie

View File

@@ -196,19 +196,22 @@ Partial Class Ventas_CatAutorizacionLimites
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs) Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) 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 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 Importe = gvRow.DataKey("Importe").ToDecimal().RoundSQL(2)
Dim CveCliente = gvRow.DataKey("CveCliente").ToEntero() 'AUTORIZACION DE IMPORTE,
Dim CveVendedor = gvRow.DataKey("CveVendedor").ToEntero() '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 'SI EL LIMITE ES 0, PERMITE AUTORIZAR
If LimiteCredito > 0 Then 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 Dim PorcentajeMaximoAutorizar As Decimal = 0.1
If UsuarioActual.PorcentajeMaximoAutorizacion > 0 Then If UsuarioActual.PorcentajeMaximoAutorizacion > 0 Then

View File

@@ -623,11 +623,9 @@ Partial Class Ventas_ClientesAbonar
If RblTipoPago.SelectedValue = "1" Then If RblTipoPago.SelectedValue = "1" Then
Dim ValFechaDocumento As Boolean = False Dim ValFechaDocumento As Boolean = False
Dim FoliosFechasValFechaDocumento As New StringBuilder Dim FoliosFechasValFechaDocumento As New StringBuilder
FoliosFechasValFechaDocumento.AppendLine("Se seleccionaron facturas con fecha de mes superior al mes del pago: <br/>")
FoliosFechasValFechaDocumento.AppendLine("Se seleccionaron facturas con fecha de mes superior al mes del pago: <br/>")
For Each gvRowVal As GridViewRow In GvCxC.Rows For Each gvRowVal As GridViewRow In GvCxC.Rows
@@ -813,26 +811,12 @@ Partial Class Ventas_ClientesAbonar
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
dtConceptos = ObjMov.DtResultados dtConceptos = ObjMov.DtResultados
End If End If
@@ -2586,7 +2570,7 @@ Partial Class Ventas_ClientesAbonar
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If

View File

@@ -216,14 +216,6 @@
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label title="Tipo Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Tipo Cliente:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoCliente" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Frecuente" Value="1"></asp:ListItem>
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
<div class="row"> <div class="row">
<label class="col-md-1 ">Estatus:</label> <label class="col-md-1 ">Estatus:</label>
@@ -297,6 +289,14 @@
<label title="Clasificación Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Clasif. Cli.:</label> <label title="Clasificación Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Clasif. Cli.:</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList> <asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList>
</div>
<label title="Tipo Cliente" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Tipo Cliente:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTipoCliente" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Frecuente" Value="1"></asp:ListItem>
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
</asp:DropDownList>
</div> </div>
<label title="Proveedor" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Proveedor:</label> <label title="Proveedor" data-toggle="tooltip" data-placement="top" class="col-md-1 ">Proveedor:</label>
<div class="col-md-2"> <div class="col-md-2">
@@ -307,12 +307,6 @@
<asp:DropDownList ID="DdlMarcaPSDes" CssClass="select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Style="width: 100%" Height="22px"></asp:DropDownList> <asp:DropDownList ID="DdlMarcaPSDes" CssClass="select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Style="width: 100%" Height="22px"></asp:DropDownList>
</div> </div>
<label runat="server" id="LblLitraje" title="Mostrar Litraje" data-toggle="tooltip" data-placement="top" class="col-md-1" visible="false">Litraje:</label>
<div runat="server" id="DvLitraje" class="col-md-2" visible="false">
<asp:CheckBox runat="server" ID="ChkLitraje" CssClass="mkcheck" />
</div>
</div> </div>
@@ -338,18 +332,25 @@
</asp:Dropdownlist> </asp:Dropdownlist>
</div> </div>
<label title="Distr" data-toggle="tooltip" class="col-md-1 truncate">Distribuidor:</label> <label title="Distr" data-toggle="tooltip" class="col-md-1 truncate" id="divdistribuidor1" runat="server" visible="false">Distribuidor:</label>
<div class="col-md-2"> <div class="col-md-2" id="divdistribuidor2" runat="server" visible="false">
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me"> <asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Distribuidor" Value="1"></asp:ListItem> <asp:ListItem Text="Distribuidor" Value="1"></asp:ListItem>
<asp:ListItem Text="No Distribuidor" Value="0"></asp:ListItem> <asp:ListItem Text="No Distribuidor" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div runat="server" id="DvLitraje" class="col-md-1" visible="false">
<asp:CheckBox runat="server" ID="ChkLitraje" CssClass="mkcheck" Text ="Litraje:&nbsp;&nbsp;&nbsp;" TextAlign="Left" />
</div>
</div>
<div class="row">
<label class="col-md-1 truncate">Lectura administrativa:</label> <label class="col-md-1 truncate">Lectura administrativa:</label>
<div class="col-md-2"> <div class="col-md-2">
<asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" /> <asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -63,11 +63,12 @@ Partial Class Ventas_RepProductosServicios
SetValues() SetValues()
If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then
LblLitraje.Visible = True
DvLitraje.Visible = True DvLitraje.Visible = True
'garantia 'garantia
divgarantia1.Visible = True divgarantia1.Visible = True
divgarantia2.Visible = True divgarantia2.Visible = True
divdistribuidor1.Visible = True
divdistribuidor2.Visible = True
End If End If
End If End If
@@ -367,11 +368,15 @@ Partial Class Ventas_RepProductosServicios
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim(), "-1") FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim(), "-1")
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim(), "-1") FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim(), "-1")
Dim Liga = String.Format("/Ventas/RepProductosServiciosDetalle.aspx?CveProyecto={0}&CveSubProyecto={1}&CveCategoria={2}&CveClasificacion={3}&CvePS={4}&CveCliente={5}&CveSubProyectoEjecucion={6}&CveVendedor={7}&CveUsuario={8}&CveEstatus={9}&Anio={10}&Mes={11}&AnioMes={12}&Fecha={13}&AnioEjec={14}&MesEjec={15}&AnioMesEjec={16}&FechaEjec={17}&FechaI={18}&FechaF={19}&FechaEI={20}&FechaEF={21}&TipoDocto={22}&Grupo={23}&CveMoneda={24}&TipoCambio={25}&TCEspecifico={26}&CveClienteClasificacion={27}&CveProveedorCompra={28}&CveMarca={29}&CveClasificacionDetalle={30}&TipoCliente={31}&ModalidadContable={32}", Dim Liga = String.Format("/Ventas/RepProductosServiciosDetalle.aspx?CveProyecto={0}&CveSubProyecto={1}&CveCategoria={2}&CveClasificacion={3}&CvePS={4}&CveCliente={5}&CveSubProyectoEjecucion={6}&CveVendedor={7}&CveUsuario={8}&CveEstatus={9}&Anio={10}&Mes={11}&AnioMes={12}&Fecha={13}&AnioEjec={14}&MesEjec={15}&AnioMesEjec={16}&FechaEjec={17}&FechaI={18}&FechaF={19}
e.Row.DBCampo("CveProyecto"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCategoria"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CvePS"), &FechaEI={20}&FechaEF={21}&TipoDocto={22}&Grupo={23}&CveMoneda={24}&TipoCambio={25}&TCEspecifico={26}&CveClienteClasificacion={27}&CveProveedorCompra={28}&CveMarca={29}&CveClasificacionDetalle={30}
e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyectoEjecucion"), e.Row.DBCampo("Vendedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), &TipoCliente={31}&ModalidadContable={32}&EsGarantia={33}&CveCondicionesPago={34}&MostrarLitraje={35}&EsDistribuidor={36}",
e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("AnioEjec"), e.Row.DBCampo("MesEjec"), e.Row.DBCampo("AnioMesEjec"), e.Row.DBCampo("FechaEjec"), e.Row.DBCampo("CveProyecto"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCategoria"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CvePS"),
FechaI, FechaF, FechaIEjec, FechaFEjec, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveGpo"), e.Row.DBCampo("CveMoneda"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveClienteClasificacion"), e.Row.DBCampo("CveProveedorCompra"), cveMarca, CveClasificacionDetalle, If(DdlGrupo.SelectedValue.ToEntero = 23, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), If(Not ChkLecturaAdmin.Checked, 1, 0)) e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyectoEjecucion"), e.Row.DBCampo("Vendedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"),
e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("AnioEjec"), e.Row.DBCampo("MesEjec"), e.Row.DBCampo("AnioMesEjec"), e.Row.DBCampo("FechaEjec"),
FechaI, FechaF, FechaIEjec, FechaFEjec, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveGpo"), e.Row.DBCampo("CveMoneda"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveClienteClasificacion"), e.Row.DBCampo("CveProveedorCompra"), cveMarca,
CveClasificacionDetalle, If(DdlGrupo.SelectedValue.ToEntero = 23, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), If(Not ChkLecturaAdmin.Checked, 1, 0),
e.Row.DBCampo("EsGarantia"), e.Row.DBCampo("CveCondicionesPago"), IIf(e.Row.DBCampo("MostrarLitraje") = "True", 1, 0), e.Row.DBCampo("EsDistribuidor"))
e.Row.FCLiteral("LtlGrupo").Text = String.Format("<a target=""_blank"" Class=""{0}"" href=""{1}"">{2}</a>", Css, Liga, e.Row.DBCampo("Gpo")) e.Row.FCLiteral("LtlGrupo").Text = String.Format("<a target=""_blank"" Class=""{0}"" href=""{1}"">{2}</a>", Css, Liga, e.Row.DBCampo("Gpo"))

View File

@@ -323,7 +323,10 @@
<asp:ListItem Text="Contado" Value="0"></asp:ListItem> <asp:ListItem Text="Contado" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-2" id="divgarantia2" runat="server" visible="false"> <div class="col-md-1 truncate" id="divgarantia1" runat="server" visible="false">
Garantía?:
</div>
<div class="col-md-1" id="divgarantia2" runat="server" visible="false">
<asp:Dropdownlist runat="server" ID="DdlGarantia" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%"> <asp:Dropdownlist runat="server" ID="DdlGarantia" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem> <asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem> <asp:ListItem Text="Si" Value="1"></asp:ListItem>
@@ -331,18 +334,22 @@
</asp:Dropdownlist> </asp:Dropdownlist>
</div> </div>
<label title="Distr" data-toggle="tooltip" class="col-md-1 truncate">Distribuidor:</label> <label title="Distr" data-toggle="tooltip" class="col-md-1 truncate" id="divdistribuidor1" runat="server" visible="false">Distribuidor:</label>
<div class="col-md-2"> <div class="col-md-2" id="divdistribuidor2" runat="server" visible="false">
<asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me"> <asp:DropDownList ID="DdlDistribuidor" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Distribuidor" Value="1"></asp:ListItem> <asp:ListItem Text="Distribuidor" Value="1"></asp:ListItem>
<asp:ListItem Text="No Distribuidor" Value="0"></asp:ListItem> <asp:ListItem Text="No Distribuidor" Value="0"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Lectura administrativa:</label> <div runat="server" id="DvLitraje" class="col-md-1" visible="false">
<div class="col-md-2"> <asp:CheckBox runat="server" ID="ChkLitraje" CssClass="mkcheck" Text ="Litraje:&nbsp;&nbsp;&nbsp;" TextAlign="Left" />
<asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" />
</div> </div>
</div>
<div class="row">
<div class="col-md-2">
<asp:CheckBox ID="ChkLecturaAdmin" runat="server" Checked="false" CssClass="input-sm" Text="Lectura admiva:" TextAlign="Left" />
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -316,6 +316,11 @@ Partial Class Ventas_RepProductosServiciosDetalle
CveMarca = If(Request("CveMarca") IsNot Nothing AndAlso Request("CveMarca").ToEntero() > 0, Request("CveMarca").ToEntero(), -1).ToString.ToEntero CveMarca = If(Request("CveMarca") IsNot Nothing AndAlso Request("CveMarca").ToEntero() > 0, Request("CveMarca").ToEntero(), -1).ToString.ToEntero
CveClasificacionDetalle = If(Request("CveClasificacionDetalle") IsNot Nothing AndAlso Request("CveClasificacionDetalle").ToEntero() > 0, Request("CveClasificacionDetalle").ToEntero(), -1).ToString.ToEntero CveClasificacionDetalle = If(Request("CveClasificacionDetalle") IsNot Nothing AndAlso Request("CveClasificacionDetalle").ToEntero() > 0, Request("CveClasificacionDetalle").ToEntero(), -1).ToString.ToEntero
DdlGarantia.SelectedValueExist(If(Request("EsGarantia") IsNot Nothing AndAlso Request("EsGarantia").ToEntero() > 0, Request("EsGarantia").ToEntero(), -1).ToString)
DdlCondicionesPago.SelectedValueExist(If(Request("CveCondicionesPago") IsNot Nothing AndAlso Request("CveCondicionesPago").ToEntero() > 0, Request("CveCondicionesPago").ToEntero(), -1).ToString)
DdlDistribuidor.SelectedValueExist(If(Request("EsDistribuidor") IsNot Nothing AndAlso Request("EsDistribuidor").ToEntero() > 0, Request("EsDistribuidor").ToEntero(), -1).ToString)
ChkLitraje.Checked = Request("MostrarLitraje") IsNot Nothing AndAlso Request("MostrarLitraje").ToEntero() > 0
TipoCliente = If(Request("TipoCliente") IsNot Nothing, Request("TipoCliente").ToString, "-1").ToString.ToEntero TipoCliente = If(Request("TipoCliente") IsNot Nothing, Request("TipoCliente").ToString, "-1").ToString.ToEntero
DdlTipoCliente.SelectedValueExist(TipoCliente) DdlTipoCliente.SelectedValueExist(TipoCliente)
@@ -325,6 +330,10 @@ Partial Class Ventas_RepProductosServiciosDetalle
txtFechaF.Text = Fecha txtFechaF.Text = Fecha
End If End If
If FechaI <> "-1" Then
txtFechaI.Text = FechaI
End If
If FechaF <> "-1" Then If FechaF <> "-1" Then
txtFechaF.Text = FechaF txtFechaF.Text = FechaF
End If End If
@@ -384,6 +393,14 @@ Partial Class Ventas_RepProductosServiciosDetalle
txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text) txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text)
If UsuarioActual.Empresa.Funcionalidad(531).ToEntero = 1 Then
DvLitraje.Visible = True
'garantia
divgarantia1.Visible = True
divgarantia2.Visible = True
divdistribuidor1.Visible = True
divdistribuidor2.Visible = True
End If
If FechaEjec <> "-1" Then If FechaEjec <> "-1" Then
TxtFechaIEjec.Text = FechaEjec TxtFechaIEjec.Text = FechaEjec
@@ -468,7 +485,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=TipoComprobante, GPO:=DdlGrupo.SelectedValue.ToEntero, CveMoneda:=CveMoneda, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=TipoComprobante, GPO:=DdlGrupo.SelectedValue.ToEntero, CveMoneda:=CveMoneda,
TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveProveedorCompra:=CveProveedorCompra, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveProveedorCompra:=CveProveedorCompra,
CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero(), TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero(), TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero,
ModalidadContable:=Not ChkLecturaAdmin.Checked, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero) Then ModalidadContable:=Not ChkLecturaAdmin.Checked, MostrarLitraje:=ChkLitraje.Checked, EsGarantia:=DdlGarantia.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados
TmpDT = ObjVentas.DtResultados TmpDT = ObjVentas.DtResultados
Else Else

View File

@@ -242,6 +242,14 @@
<ajax:ValidatorCalloutExtender ID="vcoFfvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="vcoFfvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="vcoCvFRegistroIEF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaRegistroIEF" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-1 truncate">Condiciones de Pago</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem>
<asp:ListItem Text="Contado" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -138,7 +138,7 @@ Partial Class Ventas_RepRecuperacion
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1, If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero,
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF) Then EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjMovtos.DtResultados GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados DtDatos = ObjMovtos.DtResultados
Else Else

View File

@@ -3219,7 +3219,7 @@ Partial Class Ventas
If ObjPVenta.DtResultados.Rows.Count > 0 Then If ObjPVenta.DtResultados.Rows.Count > 0 Then
CveCorte = ObjPVenta.CveCorte 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 If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < Now.Date Then
DebeCerrarCorte = True 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." 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 DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero() Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero()
HdnCveVenta.Value = CveVenta.ToString() HdnCveVenta.Value = CveVenta.ToString()
Dim DtUsadosPendientes As DataTable = Nothing
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then Me.EsGarantia = CBool(DbRowVenta("EsGarantia"))
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
RFCReceptorVenta = DbRowVenta("RFCReceptor").ToString() RFCReceptorVenta = DbRowVenta("RFCReceptor").ToString()
'Adjuntar archivo 'Adjuntar archivo
@@ -4284,7 +4276,7 @@ Partial Class Ventas
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
Me.EsGarantia = CBool(DbRowVenta("EsGarantia"))
Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero() Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero()
'CargaEncabezado 'CargaEncabezado
@@ -5198,13 +5190,47 @@ Partial Class Ventas
End If End If
'Si es Empresa de Acumuladores 'Si es Empresa de Acumuladores
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Rem" AndAlso (GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() <> 5) 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 = False
BtnsFacturar.Visible = True
Else Dim DtUsadosPendientes As DataTable = Nothing
BtnsFacturar.Visible = False 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 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) LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
End If End If
@@ -5335,6 +5361,14 @@ Partial Class Ventas
End If End If
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() UpPS.Update()
UpContado.Update() UpContado.Update()
UpEstatus.Update() UpEstatus.Update()
@@ -6713,19 +6747,21 @@ Partial Class Ventas
Else Else
'VERIFICAR RESTRICCIONES DEL CLIENTE 'VERIFICAR RESTRICCIONES DEL CLIENTE
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2" Then If Not UsuarioActual.Empresa.Funcionalidad(702).ToEntero() > 0 Then
Dim Vta As New ClsVentas If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2" Then
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa) Dim Vta As New ClsVentas
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta) Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Vta.Dispose() Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
If Opcion > 0 Then Vta.Dispose()
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) If Opcion > 0 Then
BtnsFacturar.Visible = False Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnGenerarRemision.Visible = False BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
End If
End If End If
End If End If
End If End If
UPPCreditoDisponible.Update() UPPCreditoDisponible.Update()
@@ -11504,7 +11540,7 @@ Partial Class Ventas
DdlTipoComprobante.Enabled = False DdlTipoComprobante.Enabled = False
End If End If
TAB.ActiveTab = TabGenerales Tab.ActiveTab = TabGenerales
TabGenerales.Enabled = True TabGenerales.Enabled = True
Updatetabs.Update() Updatetabs.Update()
UPObservaciones.Update() UPObservaciones.Update()
@@ -11570,7 +11606,7 @@ Partial Class Ventas
ContratoDetalles.Visible = False ContratoDetalles.Visible = False
UPEstimaciones.Update() UPEstimaciones.Update()
TAB.ActiveTab = TabGenerales Tab.ActiveTab = TabGenerales
TabGenerales.Enabled = True TabGenerales.Enabled = True
Updatetabs.Update() Updatetabs.Update()
End If End If
@@ -14861,7 +14897,7 @@ Partial Class Ventas
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
@@ -15342,7 +15378,7 @@ Partial Class Ventas
ErrorConta = True ErrorConta = True
End If 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) Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If End If
@@ -16507,7 +16543,7 @@ Partial Class Ventas
If objcompras.GetCompraDetallealmacen(0, DdlNCFactura.SelectedValue.ToEntero()) Then If objcompras.GetCompraDetallealmacen(0, DdlNCFactura.SelectedValue.ToEntero()) Then
GvInvNC.DataSource = objcompras.DtResultados GvInvNC.DataSource = objcompras.DtResultados
If objcompras.DtResultados.Rows.Count > 0 Then If objcompras.DtResultados.Rows.Count > 0 Then
TAB.ActiveTabIndex = 1 Tab.ActiveTabIndex = 1
Updatetabs.Update() Updatetabs.Update()
End If End If
Else Else
@@ -16787,7 +16823,7 @@ Partial Class Ventas
End If End If
UpParametros.Update() UpParametros.Update()
TAB.ActiveTab = TabGenerales Tab.ActiveTab = TabGenerales
Else Else
Alert("La empresa no contiene un producto asignado a la estimació", TipoMensaje.MsgInformacion) Alert("La empresa no contiene un producto asignado a la estimació", TipoMensaje.MsgInformacion)
End If End If
@@ -23621,7 +23657,7 @@ Partial Class Ventas
DdlContratosModal.Items.Insert(0, New ListItem("Seleccione", "0")) DdlContratosModal.Items.Insert(0, New ListItem("Seleccione", "0"))
UPEstimaciones.Update() UPEstimaciones.Update()
TAB.ActiveTab = TabE Tab.ActiveTab = TabE
TabGenerales.Enabled = False TabGenerales.Enabled = False
Updatetabs.Update() Updatetabs.Update()
@@ -25426,7 +25462,7 @@ Partial Class Ventas
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha) Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion < tFecha Then If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
End If End If
@@ -29911,7 +29947,7 @@ Partial Class Ventas
ContratoDetalles.Visible = False ContratoDetalles.Visible = False
UPEstimaciones.Update() UPEstimaciones.Update()
TAB.ActiveTab = TabGenerales Tab.ActiveTab = TabGenerales
TabGenerales.Enabled = True TabGenerales.Enabled = True
Updatetabs.Update() Updatetabs.Update()
@@ -30472,7 +30508,7 @@ Partial Class Ventas
DdlMonedaModalPedido2.DataBind() DdlMonedaModalPedido2.DataBind()
DdlMonedaModalPedido2.Items.Insert(0, New ListItem("Todas", "-1")) DdlMonedaModalPedido2.Items.Insert(0, New ListItem("Todas", "-1"))
TAB.ActiveTab = TabGenerales Tab.ActiveTab = TabGenerales
TabGenerales.Enabled = True TabGenerales.Enabled = True
Updatetabs.Update() Updatetabs.Update()