Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -2866,6 +2866,8 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("PSAlterno", GetType(String))
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
TmpDT.Columns.Add("UltimoCosto", GetType(Decimal))
|
||||
TmpDT.Columns("UltimoCosto").DefaultValue = 0D
|
||||
|
||||
GvPS.DataSource = ObjVentas.DtResultados
|
||||
GvPS.DataBind()
|
||||
@@ -2887,6 +2889,8 @@ Partial Class Ventas
|
||||
TmpDT = ObjCGame.DtResultados
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
TmpDT.Columns.Add("UltimoCosto", GetType(Decimal))
|
||||
TmpDT.Columns("UltimoCosto").DefaultValue = 0D
|
||||
If Not TmpDT.Columns.Contains("NumeroParte") Then TmpDT.Columns.Add("NumeroParte", GetType(String))
|
||||
|
||||
GvPS.DataBind()
|
||||
@@ -2935,6 +2939,9 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("NumeroParte", GetType(String))
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
TmpDT.Columns.Add("UltimoCosto", GetType(Decimal))
|
||||
TmpDT.Columns("UltimoCosto").DefaultValue = 0D
|
||||
|
||||
GvPS.DataSource = ObjVentas.DtResultados
|
||||
GvPS.DataBind()
|
||||
|
||||
@@ -8112,6 +8119,8 @@ Partial Class Ventas
|
||||
If CreditoDispo < 0 Then
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
Alert("El límite de crédito se ha excedido", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
@@ -8126,9 +8135,7 @@ Partial Class Ventas
|
||||
BtnGenerarRemision.Visible = False
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -8432,6 +8439,12 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
'SI ES COTIZACION, PERMITIR CREAR UN DOCUMENTO NUEVO TIPO "PA"
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(595) = "1" AndAlso TieneBloqueoPorCreditoVencimiento = 1 Then
|
||||
BtnGeneraAutorizacion.Visible = True
|
||||
UpFacturar.Update()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -9283,6 +9296,9 @@ Partial Class Ventas
|
||||
If DrPS IsNot Nothing Then
|
||||
gvr.FCTextBox("TxtPrecio").Enabled = CBool(DrPS("PrecioLibre"))
|
||||
End If
|
||||
|
||||
'PONER LA CLASIFICACION EN TODAS, PARA NO FILTRAR POR CLASIFICACION
|
||||
gvr.FCDropDownList("DdlClasificacion").SelectedValueExist("-1")
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(253) Then gvr.FCTextBox("TxtPrecio").Enabled = True
|
||||
@@ -10381,7 +10397,6 @@ Partial Class Ventas
|
||||
PU = dr("PU").ToString().ToDecimal * If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.ToDecimal)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(602) = "UC" Then 'validación sobre el último costo
|
||||
|
||||
If ObjInventarios.GetUltimoCosto(UsuarioActual.CveEmpresa, dr("CvePS").ToString().ToEntero()) Then
|
||||
Dim drps As DataRow = ObjInventarios.DtResultados.FiltroPrimero("")
|
||||
If drps IsNot Nothing Then
|
||||
@@ -10391,6 +10406,7 @@ Partial Class Ventas
|
||||
Else
|
||||
Costo = ObjInventarios.GetCostoPS(dr("CvePS").ToString().ToEntero(), dr("Cantidad").ToString().ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
|
||||
End If
|
||||
|
||||
Dim PrecioMinimo As Decimal = 0
|
||||
'RMF. condicion temporal, para reubicación, precio mínimo
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
@@ -13781,13 +13797,7 @@ Partial Class Ventas
|
||||
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
|
||||
Timbre.Comprobante.Folio = Obj.Folio.ToString()
|
||||
Timbre.Comprobante.Serie = Obj.Serie
|
||||
|
||||
If Me.CveVenta = 4381091 Then
|
||||
Timbre.Comprobante.Fecha = Obj.Fecha
|
||||
Else
|
||||
Timbre.Comprobante.Fecha = Obj.FechaCP
|
||||
End If
|
||||
|
||||
Timbre.Comprobante.Fecha = Obj.FechaCP
|
||||
|
||||
Timbre.Comprobante.CondicionesdePago = If(UsuarioActual.CveEmpresa.Contiene(15, 76, 198), "No Aplica", Obj.FormaPago)
|
||||
Timbre.Comprobante.MetodoPago = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {Obj.CveMetodoPago}") ' Obj.ClaveMetodoPagoSAT
|
||||
@@ -13890,7 +13900,8 @@ Partial Class Ventas
|
||||
If Obj.TipoDocto.Contiene("Egs", "Dev") OrElse (NuevaFactura = 1) Then
|
||||
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
|
||||
Timbre.CFDIRelacionados.UUID.Clear()
|
||||
For Each Dr As DataRow In DtVentasNC.Rows
|
||||
'QUITAR LAS QUE ESTEN CANCELADAS
|
||||
For Each Dr As DataRow In DtVentasNC.FiltraParametros("CveEstatusFactura <> 5").Rows
|
||||
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
|
||||
Next
|
||||
Else
|
||||
@@ -21690,6 +21701,9 @@ Partial Class Ventas
|
||||
|
||||
TmpDT.Columns.Add("Costo", GetType(Decimal))
|
||||
TmpDT.Columns("Costo").DefaultValue = 0D
|
||||
|
||||
TmpDT.Columns.Add("UltimoCosto", GetType(Decimal))
|
||||
TmpDT.Columns("UltimoCosto").DefaultValue = 0D
|
||||
End Sub
|
||||
Private Sub CreaDTmpC()
|
||||
DTmpC = New DataTable
|
||||
@@ -22094,6 +22108,20 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'SI ES FACTURACION DE COTIZACION Y REQUIERE AUTORIZACION, SOLO DEBE PERMITIR ESTA
|
||||
If UsuarioActual.Empresa.Funcionalidad(595) = "1" AndAlso Request("CveCotizacion") IsNot Nothing AndAlso Request("CveCotizacion").ToString().ToEntero() > 0 AndAlso TieneBloqueoPorAutorizacion = 1 Then
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Egs"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Cot"))
|
||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Dev"))
|
||||
|
||||
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
|
||||
DdlTipoComprobante.SelectedValue = "PA"
|
||||
|
||||
BtnCrearApartirDe.Visible = False
|
||||
UpFacturar.Update()
|
||||
End If
|
||||
|
||||
|
||||
'[IPP]: FALTA CONFIGURAR Y DAR PERMISO A TODOS LOS QUE TENGAN ACCESO A VENTAS
|
||||
''Puede remisionar
|
||||
@@ -24729,6 +24757,19 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'si es de FNC contado. bloquear edición si está pagada o en proceso de cobro
|
||||
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
|
||||
Using ObjVta As New ClsVentas
|
||||
If ObjVta.GetVenta(Me.CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
Dim DbRowVenta As DataRow = ObjVta.DtResultados.FiltroPrimero("")
|
||||
If DbRowVenta IsNot Nothing AndAlso (DbRowVenta("CveCobranzaEstatus").ToString = "1" OrElse DbRowVenta("Saldo").ToString.ToDecimal = 0) Then
|
||||
Alert("No se puede actualizar la información de la remisión porque esta en proceso de cobro. Para aplicar cambios se debera de liberar desde el módulo de 'cobro por caja'.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
Dim OcurrioError As Boolean = False
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
@@ -30703,7 +30744,7 @@ Partial Class Ventas
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then
|
||||
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
|
||||
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 1", "Moneda,Fecha,Folio")
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
|
||||
@@ -30807,7 +30848,7 @@ Partial Class Ventas
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1) Then
|
||||
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
|
||||
DtNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 1", "Moneda,Fecha,Folio")
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
|
||||
@@ -33135,7 +33176,7 @@ Partial Class Ventas
|
||||
Next
|
||||
|
||||
If Not Selecciono Then
|
||||
Alert("Tiene que seleccionar al menos un concepto y este dege tener una cantidad mayor a 0. Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
Alert("Tiene que seleccionar al menos un concepto y este debe tener una cantidad mayor a 0. Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -35976,7 +36017,7 @@ Partial Class Ventas
|
||||
#Region "GENERAR AUTORIZACIÓN"
|
||||
|
||||
Protected Sub BtnGeneraAutorizacion_Click(sender As Object, e As EventArgs)
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ped") Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ped", "Cot") Then
|
||||
EmitirDocumentoNuevo("PA")
|
||||
End If
|
||||
End Sub
|
||||
@@ -36670,10 +36711,15 @@ Partial Class Ventas
|
||||
Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
|
||||
|
||||
Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
|
||||
Dim Saldo As Decimal = GvRow.DataKey("Saldo").ToDecimal()
|
||||
|
||||
'AJUSTAR SALDO SI EL TOTAL ES MAYOR
|
||||
If TotalRNCDetalle > Saldo Then
|
||||
TotalRNCDetalle = Saldo
|
||||
End If
|
||||
|
||||
TotalRNC += TotalRNCDetalle
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user