diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
index 8cbfdf484..11ac0dd96 100644
--- a/Ventas/PVCobranza.aspx.vb
+++ b/Ventas/PVCobranza.aspx.vb
@@ -111,7 +111,13 @@ Partial Class Ventas_PVCobranza
'If UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon))
DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon))
- DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", CveMon))
+
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(195, 197) Then
+ DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(CveMon <= 0, 1, CveMon)))
+ Else
+ DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(CveMon <= 0, 1, CveMon)))
+ End If
+ 'DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", CveMon))
DtCC.Dispose()
@@ -387,16 +393,8 @@ Partial Class Ventas_PVCobranza
End If
If LtlSaldo.Text.ToDecimal() > Pagado Then
- If UsuarioActual.CveEmpresa = 189 Then
- If (LtlSaldo.Text.ToDecimal() - Pagado) > 6 Then
- Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
- Else
- Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
+ Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
+ Exit Sub
End If
Dim PagadoSinEfectivo As Decimal = Pagado - TxtImporteEfectivo.Text.ToDecimal
@@ -486,13 +484,13 @@ Partial Class Ventas_PVCobranza
If CvePrePoliza > 0 Then
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteCredito.Text.ToDecimal > 0 Then
- MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
+ MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
SaldoPendiente -= TxtImporteCredito.Text.ToDecimal
PagoAplicado += TxtImporteCredito.Text.ToDecimal
End If
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteDebito.Text.ToDecimal > 0 Then
- MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
+ MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
SaldoPendiente -= TxtImporteDebito.Text.ToDecimal
PagoAplicado += TxtImporteDebito.Text.ToDecimal
End If
@@ -503,13 +501,13 @@ Partial Class Ventas_PVCobranza
Obs = $"{VentaActual.SerieFolio} - Autorizó: {TxtAutorizo.Text}"
End If
- MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, Obs:=Obs, CveAutorizacion:=TxtClaveAutorizacion.Text.Trim())
+ MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, Obs:=Obs, CveAutorizacion:=TxtClaveAutorizacion.Text.Trim(), CveSubProyecto:=VentaActual.CveSubProyecto)
SaldoPendiente -= TxtImporteCheque.Text.ToDecimal
PagoAplicado += TxtImporteCheque.Text.ToDecimal
End If
If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteTransferencia.Text.ToDecimal > 0 Then
- MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
+ MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
SaldoPendiente -= TxtImporteTransferencia.Text.ToDecimal
PagoAplicado += TxtImporteTransferencia.Text.ToDecimal
End If
@@ -522,18 +520,12 @@ Partial Class Ventas_PVCobranza
TxtCambio.Text = (PagoAplicado - SaldoTotalInicial).FormatoNumero
PagoEfectivo = SaldoPendiente
End If
- MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte)
+ MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
SaldoPendiente -= PagoEfectivo
End If
If SaldoPendiente > 0 Then
- If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
- If SaldoPendiente > 6 Then
- MsgError = "Tiene saldo pendiente por aplicar"
- End If
- Else
- MsgError = "Tiene saldo pendiente por aplicar"
- End If
+ MsgError = "Tiene saldo pendiente por aplicar"
End If
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then
@@ -651,6 +643,7 @@ Partial Class Ventas_PVCobranza
DtPagos.Rows.Add({1, TxtImporteEfectivo.Text.ToDecimal})
End If
+
Dim PagoMaximo = DtPagos.MAX("Importe")
Dim CveFormaPago As Integer = DtPagos.FiltroPrimeroValor("CveFormaPago", $"Importe = {PagoMaximo}").ToEntero()
@@ -745,14 +738,14 @@ Partial Class Ventas_PVCobranza
Return Retorno
End Function
- Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer, Optional Obs As String = "", Optional CveAutorizacion As String = "") As String
+ Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer, Optional Obs As String = "", Optional CveAutorizacion As String = "", Optional CveSubProyecto As Integer = -1) As String
Dim Retorno As String = ""
Dim CveIEPago As Integer = 0
Dim ErrorConta As Boolean
If String.IsNullOrEmpty(Obs) Then
Obs = VentaActual.SerieFolio
End If
- CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion)
+ CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
If CveIEPago > 0 Then
Dim Pago As New VentaPago
Pago.ImportePagoVenta = ImportePago
diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
index 1849a60d6..ba4f8cd91 100644
--- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs
+++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
@@ -531,7 +531,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false, string FolioSustitucion = "", int CveEstatusRefacturacion = 0, int CveMotivoCancelacion = 0)
{
Modelos.Factura.MCancelacionVentaMensaje retorno = null;
- var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion: true);
+ var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion: true, VerificaAlmacen : true);
if (factura.ErrorList.Count > 0) { retorno.HuboError = true; return retorno; }
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index cacee39da..ac3ba2732 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -3734,27 +3734,32 @@ Partial Class Ventas
Private Sub CargaListasPreciosSubProyectos(CvePS As Integer)
If UsuarioActual.CveEmpresa = 189 Then
- DivPrecioLista.Visible = True
+ If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") Then
+ DivPrecioLista.Visible = True
- Using ObjVta As New ClsVentas
- If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePS, UsuarioActual.CveEmpresa) Then
- Dim Dt As DataTable = Nothing
+ Using ObjVta As New ClsVentas
+ If ObjVta.GetPreciosListaSPPermitidos(DdlSubProyectoDatos.SelectedValue.ToEntero(), CvePS, UsuarioActual.CveEmpresa) Then
+ Dim Dt As DataTable = Nothing
+
+ If UsuarioActual.TienePermisoProceso(384) Then
+ Dt = ObjVta.DtResultados.Copy()
+ Else
+ Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
+ End If
+
+ DdlPrecioLista.DataSource = Dt
+ If Dt IsNot Nothing Then
+ DdlPrecioLista.SelectedValueExist(Dt.FiltroPrimeroValor("CvePrecioLista", "Predeterminada = 'True'"))
+ End If
- If UsuarioActual.TienePermisoProceso(384) Then
- Dt = ObjVta.DtResultados.Copy()
- Else
- Dt = ObjVta.DtResultados.FiltraParametros("Restringuida = 'False'")
End If
+ End Using
- DdlPrecioLista.DataSource = Dt
- If Dt IsNot Nothing Then
- DdlPrecioLista.SelectedValueExist(Dt.FiltroPrimeroValor("CvePrecioLista", "Predeterminada = 'True'"))
- End If
+ DdlPrecioLista.DataBind()
+ Else
+ DivPrecioLista.Visible = False
+ End If
- End If
- End Using
-
- DdlPrecioLista.DataBind()
UpPS.Update()
End If
End Sub
@@ -15758,7 +15763,7 @@ Partial Class Ventas
' DrPago("Importe") = DrPago("Importe").ToString().ToDecimal - TxtCambio.Text.ToDecimal
'End If
- CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString().ToEntero(), DrPago("CveTipoMovimiento").ToString().ToEntero(), Fecha, FolioIE.ToString(), String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString().ToDouble, DdlMoneda.SelectedValue.ToEntero(), tipoCambio, DrPago("Observaciones").ToString(), "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString().ToEntero(), Modulo:="Ventas/Guardar")
+ CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString().ToEntero(), DrPago("CveTipoMovimiento").ToString().ToEntero(), Fecha, FolioIE.ToString(), String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString().ToDouble, DdlMoneda.SelectedValue.ToEntero(), tipoCambio, DrPago("Observaciones").ToString(), "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString().ToEntero(), Modulo:="Ventas/Guardar", CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero())
If CveIEPago > 0 Then
importeMovimiento = DrPago("Importe").ToString().ToDecimal * ValorMultiplicador
@@ -17025,7 +17030,7 @@ Partial Class Ventas
End If
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
- If e.Row.DBCampo("Tipo").ToString() = "Ant" AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
+ If e.Row.DBCampo("Tipo").ToString().Contiene("Ant", "IxC") AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ToolTip = "Anticipo Bloqueado"
e.Row.FCLinkButton("LnkSolicitarActivarAnticipo").Visible = True
@@ -17945,19 +17950,28 @@ Partial Class Ventas
DdlPrecioLista.SelectedValueExist(ObjPrecioSugerido.CvePrecioLista)
If UsuarioActual.CveEmpresa = 189 Then
- If DirectCast(DdlPrecioLista.DataSource, DataTable) IsNot Nothing Then
- Dim dt = DirectCast(DdlPrecioLista.DataSource, DataTable)
- If dt IsNot Nothing Then
- If dt.Rows.Count > 0 Then
- 'CHECA SI EL PRECIO SUGERIDO ESTA EN LA LISTA DE PRECIOS PERMITIDAS
- If dt.FiltroPrimeroValor("CvePrecioLista", $"CvePrecioLista = {ObjPrecioSugerido.CvePrecioLista}").ToEntero() <= 0 Then
- If ObjPrecioSugerido.CvePrecioLista = Me.CvePrecioListaCliente Then
- Alert("La lista de precios del cliente no esta permitido en la sucursal actual", TipoMensaje.MsgAdvertencia)
+ If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot", "Ped") Then
+ If DirectCast(DdlPrecioLista.DataSource, DataTable) IsNot Nothing Then
+ Dim dt = DirectCast(DdlPrecioLista.DataSource, DataTable)
+ If dt IsNot Nothing Then
+ If dt.Rows.Count > 0 Then
+ 'CHECA SI EL PRECIO SUGERIDO ESTA EN LA LISTA DE PRECIOS PERMITIDAS
+ If dt.FiltroPrimeroValor("CvePrecioLista", $"CvePrecioLista = {ObjPrecioSugerido.CvePrecioLista}").ToEntero() <= 0 Then
+ If ObjPrecioSugerido.CvePrecioLista = Me.CvePrecioListaCliente Then
+ Alert("La lista de precios del cliente no esta permitido en la sucursal actual", TipoMensaje.MsgAdvertencia)
+ End If
+ ObjPrecioSugerido.CvePrecioLista = -1
+ ObjPrecioSugerido.PrecioSugerido = 0
+ tPrecioSugerido = 0
+ PrecioSugerido = 0
End If
+ Else
ObjPrecioSugerido.CvePrecioLista = -1
ObjPrecioSugerido.PrecioSugerido = 0
tPrecioSugerido = 0
PrecioSugerido = 0
+
+ Alert("No se encontro una lista de precios permitida en la sucursal actual", TipoMensaje.MsgAdvertencia)
End If
Else
ObjPrecioSugerido.CvePrecioLista = -1
@@ -17965,22 +17979,29 @@ Partial Class Ventas
tPrecioSugerido = 0
PrecioSugerido = 0
- Alert("No se encontro una lista de precios permitida en la sucursal actual", TipoMensaje.MsgAdvertencia)
+ Alert("No se encontraron listas de precio disponibles", TipoMensaje.MsgAdvertencia)
End If
- Else
- ObjPrecioSugerido.CvePrecioLista = -1
- ObjPrecioSugerido.PrecioSugerido = 0
- tPrecioSugerido = 0
- PrecioSugerido = 0
- Alert("No se encontraron listas de precio disponibles", TipoMensaje.MsgAdvertencia)
End If
-
End If
+
End If
End If
+ If UsuarioActual.CveEmpresa = 189 Then
+ If DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
+
+ DdlPrecioLista.SelectedValueExistInsert("-1", "Sin lista")
+ Me.CvePrecioLista = -1
+
+ ObjPrecioSugerido.CvePrecioLista = -1
+ ObjPrecioSugerido.PrecioSugerido = 0
+ tPrecioSugerido = 0
+ PrecioSugerido = 0
+ End If
+ End If
+
If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
@@ -17996,6 +18017,7 @@ Partial Class Ventas
HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString()
HdnIVARetAPS.Value = drPS("RetIVA").ToString()
HdnCodigo.Value = drPS("Codigo").ToString()
+
If DdlClasificacion.SelectedIndex = 0 Then
If drPS("CveClasificacion").ToString() IsNot Nothing Then
DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString())
@@ -18028,7 +18050,7 @@ Partial Class Ventas
End If
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ant") Then
AgregarPS()
End If
@@ -18490,6 +18512,18 @@ Partial Class Ventas
TrTipoContable.Visible = True
End If
+ CargaListasPreciosSubProyectos(If(DdlPS.SelectedValue.ToEntero() <= 0, -1, DdlPS.SelectedValue.ToEntero()))
+
+ If DdlTipoComprobante.SelectedValue = "Ant" AndAlso UsuarioActual.CveEmpresa = 189 Then
+ Dim DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506").FiltroPrimero("")
+ If DatarowPS IsNot Nothing Then
+ DdlPS.SelectedValue = DatarowPS("CvePS").ToString()
+ DdlPS.SelectedText = DatarowPS("CodigoPS").ToString()
+
+ DdlPS_SelectedIndexChanged(Nothing, Nothing)
+ End If
+ End If
+
Updatetabs.Update()
UPCondicionesPago.Update()
UpCliente.Update()