Correcion en asignacion del vendedor y PU mayor a cero en Egs
This commit is contained in:
@@ -1905,6 +1905,14 @@ Partial Class Ventas
|
||||
ViewState("CveVendedorVenta") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveVendedorCliente As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveVendedorCliente")), -1, ViewState("CveVendedorCliente")).ToString().ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveVendedorCliente") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DiasCredito As Integer
|
||||
Get
|
||||
Return ViewState("DiasCredito").ToString().ToEntero()
|
||||
@@ -2177,6 +2185,7 @@ Partial Class Ventas
|
||||
ViewState("CvePrecioLista") = 0
|
||||
ViewState("CvePrecioListaCliente") = 0
|
||||
Me.CveVendedorVenta = -1
|
||||
Me.CveVendedorCliente = -1
|
||||
Me.EsGarantia = False
|
||||
idCuentaContabilizacion = 1
|
||||
CveEmpresaCRM = 0
|
||||
@@ -4245,13 +4254,13 @@ Partial Class Ventas
|
||||
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero()
|
||||
HdnCveVenta.Value = CveVenta.ToString()
|
||||
Dim DtUsados As DataTable = Nothing
|
||||
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
|
||||
DtUsados = ObjUsados.DtResultados
|
||||
DtUsadosPendientes = ObjUsados.DtResultados
|
||||
End If
|
||||
ObjUsados.Dispose()
|
||||
End If
|
||||
@@ -5191,7 +5200,7 @@ Partial Class Ventas
|
||||
'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 (DtUsados Is Nothing Or DtUsados.Rows.Count = 0)) OrElse (TmpDT.MAX("CveTipoPS") = "1") Then
|
||||
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
|
||||
@@ -6050,6 +6059,7 @@ Partial Class Ventas
|
||||
|
||||
If ObjCliente.DtResultados(0)("CveVendedor").ToString().ToEntero() > 0 Then
|
||||
DdlVendedor.SelectedValueExist(ObjCliente.DtResultados(0)("CveVendedor").ToString().ToEntero())
|
||||
CveVendedorCliente = ObjCliente.DtResultados(0)("CveVendedor").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
'SI EL CLIENTE NO TIENE VENDEDOR SELECCIONAMOS EL DEL USUARIO
|
||||
@@ -17008,7 +17018,12 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Private Sub CargaVendedores()
|
||||
|
||||
Dim CveVendedorActual = DdlVendedor.SelectedValue
|
||||
Dim CveVendedorActual = DdlVendedor.SelectedValue.ToEntero()
|
||||
|
||||
If Not CveVendedorActual > 0 AndAlso Me.CveVendedorCliente > 0 Then
|
||||
DdlVendedor.SelectedValueExist(Me.CveVendedorCliente)
|
||||
CveVendedorActual = Me.CveVendedorCliente
|
||||
End If
|
||||
|
||||
DdlVendedor.Items.Clear()
|
||||
If UsuarioActual.Empresa.Funcionalidad(302) = "1" AndAlso DdlSubProyectoDatos.SelectedValue.ToEntero() > 0 Then
|
||||
@@ -17035,6 +17050,10 @@ Partial Class Ventas
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
|
||||
End If
|
||||
|
||||
If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
|
||||
DdlVendedor.Enabled = False
|
||||
End If
|
||||
|
||||
'TxtCorreoNotificaciones.Text = GlobalDTUsuarios(UsuarioActual.CveUsuario).FiltroPrimeroValor("Correo")
|
||||
End Sub
|
||||
#End Region
|
||||
@@ -26996,10 +27015,10 @@ Partial Class Ventas
|
||||
'verificar autorizaciones
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Egs", CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL ", Orderby:="TipoAutorizacion")
|
||||
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL ", Orderby:="TipoAutorizacion,Importe DESC")
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
Dim ImporteAutorizacion As Decimal = RowAutorizacion("Importe").ToString().ToDecimal()
|
||||
If ImporteAutorizacion > TxtNCImporte.Text.ToDecimal Then
|
||||
If ImporteAutorizacion >= TxtNCImporte.Text.ToDecimal Then
|
||||
Verificacion = True
|
||||
End If
|
||||
End If
|
||||
@@ -27512,7 +27531,7 @@ Partial Class Ventas
|
||||
UltimoRenglonRNC += 1
|
||||
|
||||
'SOLO AGREGA SI LA CANTIDAD ES MAYOR CERO
|
||||
If Cantidad.RoundSQL(6) > 0D Then
|
||||
If Cantidad.RoundSQL(6) > 0D AndAlso ImportePU.RoundSQL(6) > 0 Then
|
||||
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
|
||||
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
|
||||
@@ -27605,7 +27624,7 @@ Partial Class Ventas
|
||||
UltimoRenglonRNC += 1
|
||||
|
||||
'SOLO AGREGA SI LA CANTIDAD ES MAYOR CERO
|
||||
If Cantidad.RoundSQL(6) > 0D Then
|
||||
If Cantidad.RoundSQL(6) > 0D AndAlso ImportePU.RoundSQL(6) > 0 Then
|
||||
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
|
||||
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
|
||||
@@ -27697,7 +27716,7 @@ Partial Class Ventas
|
||||
UltimoRenglonRNC += 1
|
||||
|
||||
'SOLO AGREGA SI LA CANTIDAD ES MAYOR CERO
|
||||
If Cantidad.RoundSQL(6) > 0D Then
|
||||
If Cantidad.RoundSQL(6) > 0D AndAlso ImportePU.RoundSQL(6) > 0 Then
|
||||
AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
|
||||
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
Obs, Cantidad, ImportePU, RowCargo("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowCargo("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
|
||||
@@ -27791,7 +27810,7 @@ Partial Class Ventas
|
||||
UltimoRenglonRNC += 1
|
||||
|
||||
'SOLO AGREGA SI LA CANTIDAD ES MAYOR CERO
|
||||
If Cantidad.RoundSQL(6) > 0D Then
|
||||
If Cantidad.RoundSQL(6) > 0D AndAlso ImportePU.RoundSQL(6) > 0 Then
|
||||
AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
|
||||
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
Obs, Cantidad, ImportePU, RowCargo("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowCargo("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
|
||||
@@ -27879,7 +27898,7 @@ Partial Class Ventas
|
||||
UltimoRenglonRNC += 1
|
||||
|
||||
'SOLO AGREGA SI LA CANTIDAD ES MAYOR CERO
|
||||
If Cantidad.RoundSQL(6) > 0D Then
|
||||
If Cantidad.RoundSQL(6) > 0D AndAlso ImportePU.RoundSQL(6) > 0 Then
|
||||
AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
|
||||
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
|
||||
@@ -27966,7 +27985,7 @@ Partial Class Ventas
|
||||
UltimoRenglonRNC += 1
|
||||
|
||||
'SOLO AGREGA SI LA CANTIDAD ES MAYOR CERO
|
||||
If Cantidad.RoundSQL(6) > 0D Then
|
||||
If Cantidad.RoundSQL(6) > 0D AndAlso ImportePU.RoundSQL(6) > 0 Then
|
||||
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
|
||||
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
Obs, Cantidad, ImportePU, RowRNC("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowRNC("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
|
||||
|
||||
Reference in New Issue
Block a user