-
-
-
+
+
-
@@ -526,7 +523,6 @@
"February": "Febrero",
"March": "Marzo",
"April": "Abril",
- "May": "Mayo",
"June": "Junio",
"July": "Julio",
"August": "Agosto",
@@ -537,7 +533,7 @@
};
- function cargaDiagramaGrant(data, categorias) {
+ function cargaDiagramaGrant(data, categorias, TipoVista) {
am5.ready(function () {
//SI YA HAY GRAFICA, QUITA LA ACTUAL PARA HACER UNA NUEVA
@@ -566,7 +562,7 @@
layout: root.verticalLayout,
paddingLeft: 0
}));
-
+
// Add legend
// https://www.amcharts.com/docs/v5/charts/xy-chart/legend-xy-series/
var legend = chart.children.push(am5.Legend.new(root, {
@@ -650,23 +646,24 @@
chart.set("scrollbarY", scrollbarY);
- /// evento para ajustar el alto del row
- var cellSize = 30;
- chart.events.on("datavalidated", function (ev) {
+
+ series.events.on("datavalidated", function (ev) {
+ let cellSize = 45;
- // Get objects of interest
- var chart = ev.target;
- var categoryAxis = chart.yAxes.getIndex(0);
+ if (TipoVista == 1) {
+ cellSize = 60;
+ }
+ //let series = ev.target;
+ //let chart = series.chart;
+ let xAxis = chart.xAxes.getIndex(0);
// Calculate how we need to adjust chart height
- var adjustHeight = chart.data.length * cellSize - categoryAxis.pixelHeight;
-
- // get current chart height
- var targetHeight = chart.pixelHeight + adjustHeight;
+ let chartHeight = categorias.length * cellSize + xAxis.height() + chart.get("paddingTop", 0) + chart.get("paddingBottom", 0);
// Set it on chart's container
- chart.svgContainer.htmlElement.style.height = targetHeight + "px";
+ chart.root.dom.style.height = chartHeight + "px";
});
+ //root.language.setTranslationAny("May", "Mayo");
// Make stuff animate on load
// https://www.amcharts.com/docs/v5/concepts/animations/
@@ -699,8 +696,13 @@
$('#<%=TxtObservaciones.ClientID%>').val(event.title);
$('#<%=TxtDescripcion.ClientID%>').val(event.title);
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
- $('#<%=TxtFechaSalida.ClientID%>').val(event.start._i);
- $('#<%=TxtFechaRegreso.ClientID%>').val(event.end._i);
+
+ <%--$('#<%=TxtFechaSalida.ClientID%>').val(event.start._i);
+ $('#<%=TxtFechaRegreso.ClientID%>').val(event.end._i);--%>
+
+ $('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start._i));
+ $('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal));
+
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
$('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo);
$('#<%=DdlChofer.ClientID%>').val(event.CvePersonal);
@@ -713,16 +715,40 @@
if (event.NombreComercial !== null) {
- $('#HidModClienteNombre').val('');
+ $('#HidModClienteNombre').val('');
} else {
$('#HidModClienteNombre').val(event.NombreComercial);
- }
+ }
- $('#HidModCveCliente').val(event.CveCliente);
+ $('#HidModCveCliente').val(event.CveCliente);
$('#<%=BtnModal.ClientID%>').click();
}
+
+ function formatearFechaISO(fechaISO) {
+ let fecha = new Date(fechaISO);
+
+ // Formatear la fecha en DD/MM/YYYY
+ let dia = fecha.getDate().toString().padStart(2, '0');
+ let mes = (fecha.getMonth() + 1).toString().padStart(2, '0'); // getMonth() devuelve mes de 0-11
+ let año = fecha.getFullYear();
+
+ // Formatear la hora en formato 12 horas con AM/PM
+ let horas = fecha.getHours();
+ let minutos = fecha.getMinutes().toString().padStart(2, '0');
+ let periodo = 'a. m.';
+ if (horas >= 12) {
+ periodo = 'p. m.';
+ horas = horas > 12 ? horas - 12 : horas; // Convertir hora de formato 24 a 12 horas
+ }
+ if (horas === 0) horas = 12; // Medianoche se muestra como 12 a.m.
+ horas = horas.toString().padStart(2, '0');
+
+ // Combinar la fecha y la hora
+ return `${dia}/${mes}/${año} ${horas}:${minutos}:00 ${periodo}`;
+ }
+
function RadionButtonSelectedValueSet(name, SelectdValue) {
$('input[name="' + name + '"][value="' + SelectdValue + '"]').prop('checked', true);
}
@@ -827,6 +853,8 @@
});
}
+
+
diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb
index 81f09aa7f..bff2a01e6 100644
--- a/Transportes/RepContratosCalendario.aspx.vb
+++ b/Transportes/RepContratosCalendario.aspx.vb
@@ -103,7 +103,7 @@ Partial Class RepContratosCalendario
jsonCategorias.Add(obj)
Next
- RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()});", "A1")
+ RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});", "A1")
UPPGantt.Update()
End If
End Sub
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index e55054346..53090e7fb 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -9619,10 +9619,11 @@
TxtImporte.value = FormatoNumero(ImporteRestante, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + ToDouble(TxtImporte.value), 2);
}else {
- $get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2);
+ $get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2);
+ TxtImporte.value = FormatoNumero(Importe, 2);
}
- if (ToDouble(TxtImporte.value) <= 0) {
+ if (ToDouble(TxtImporte.value.replace(",", "")) <= 0) {
Chk.checked = false;
}
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 9a3383d0a..e387c6444 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2286,6 +2286,15 @@ Partial Class Ventas
End Set
End Property
+ Private Property TieneBloqueoPorCreditoVencimiento As Integer
+ Get
+ Return IfNull(ViewState("TieneBloqueoPorCreditoVencimiento"), "0", ViewState("TieneBloqueoPorCreditoVencimiento")).ToString().ToEntero()
+ End Get
+ Set(value As Integer)
+ ViewState("TieneBloqueoPorCreditoVencimiento") = value
+ End Set
+ End Property
+
Private Property EsNCDevolucionEfectivo As Boolean
Get
Return If(IsNothing(ViewState("EsNCDevolucionEfectivo")), False, CType(ViewState("EsNCDevolucionEfectivo"), Boolean))
@@ -2439,6 +2448,8 @@ Partial Class Ventas
Me.CveVendedorContrato = -1
Me.CveVendedorEmpresaCRM = -1
Me.EsGarantia = False
+ Me.TieneBloqueoPorCreditoVencimiento = 0
+ Me.ClienteEsDistribuidor = False
CveEmpresaCRM = 0
CveAcercamientoCRM = 0
EstatusCliente = False
@@ -5905,7 +5916,7 @@ Partial Class Ventas
End If
'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR
- If TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad") Then
+ If (TmpDT.SUM("CantidadFacturadaRem") < TmpDT.SUM("Cantidad")) AndAlso TieneBloqueoPorCreditoVencimiento = 0 Then
BtnsFacturar.Visible = True
'E119, bloquear la facturación de remisiones que no estén surtidas
@@ -5935,48 +5946,51 @@ Partial Class Ventas
'Si es Empresa de Acumuladores
If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso DbRowVenta("TipoDocto").ToString() = "Rem" AndAlso (GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() <> 5) Then
- BtnsFacturar.Visible = False
-
- Dim DtUsadosPendientes As DataTable = Nothing
- Dim DtGarantiasPendientes As DataTable = Nothing
-
- Dim ObjUsados As New ClsVentas
-
- If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
- DtUsadosPendientes = ObjUsados.DtResultados.Copy()
- End If
-
- If ObjUsados.GetVentasGarantiaPendiente(CveVenta, NowADS(), UsuarioActual.CveEmpresa) Then
- DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
- End If
-
- 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, NowADS(), UsuarioActual.CveEmpresa) Then
- ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
- 'End If
-
- ObjUsados.Dispose()
-
- BtnsFacturar.Visible = True
-
- 'VERIFICA SI YA SE FACTURO COMPLETAMENTE
- If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then
+ If TieneBloqueoPorCreditoVencimiento = 0 Then
BtnsFacturar.Visible = False
- 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)
+ Dim DtUsadosPendientes As DataTable = Nothing
+ Dim DtGarantiasPendientes As DataTable = Nothing
+
+ Dim ObjUsados As New ClsVentas
+
+ If ObjUsados.GetVentasUsados(CveVenta, -1, DbRowVenta("Fecha").ToString().ToDateTime, UsuarioActual.CveEmpresa) Then
+ DtUsadosPendientes = ObjUsados.DtResultados.Copy()
End If
- If (EsGarantia AndAlso (DtGarantiasPendientes IsNot Nothing AndAlso DtGarantiasPendientes.Rows.Count > 0)) Then
- Alert("Tiene garantías pendientes de recibir", TipoMensaje.MsgAdvertencia)
+ If ObjUsados.GetVentasGarantiaPendiente(CveVenta, NowADS(), UsuarioActual.CveEmpresa) Then
+ DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
+ End If
+
+ 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, NowADS(), UsuarioActual.CveEmpresa) Then
+ ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
+ 'End If
+
+ ObjUsados.Dispose()
+
+ BtnsFacturar.Visible = True
+
+ 'VERIFICA SI YA SE FACTURO COMPLETAMENTE
+ If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then
BtnsFacturar.Visible = False
End If
+
+ 'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES
+ If BtnsFacturar.Visible Then
+ If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then
+ BtnsFacturar.Visible = False
+ Alert("Tiene usados pendiente de recibir", TipoMensaje.MsgAdvertencia)
+ End If
+
+ If (EsGarantia AndAlso (DtGarantiasPendientes IsNot Nothing AndAlso DtGarantiasPendientes.Rows.Count > 0)) Then
+ Alert("Tiene garantías pendientes de recibir", TipoMensaje.MsgAdvertencia)
+ BtnsFacturar.Visible = False
+ End If
+ End If
+
+ LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
End If
- LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
End If
'SI ES COMPLEMENTARIA, NO DEBE PERMITIR FACTURAR
@@ -6071,7 +6085,7 @@ Partial Class Ventas
CargaPS(-1, DdlPS)
'Verifico si tiene la funcionalidad (135)
- If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
+ If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso TieneBloqueoPorCreditoVencimiento = 0 Then
Select Case UsuarioActual.Empresa.Funcionalidad(135)
Case "1" ' POR SUPERVISOR
@@ -6182,14 +6196,13 @@ Partial Class Ventas
End Function
Private Sub VerificarBtnFacturarCotizacion(CveVendedor As Integer, Optional MostrarGenerarRemision As Boolean = True)
- If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then
+ If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TieneBloqueoPorCreditoVencimiento = 0 Then
If UsuarioActual.TienePermisoProceso(199) Then
BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True)
Else
BtnGenerarRemision.Visible = False
End If
-
If UsuarioActual.TienePermisoProceso(60) Then BtnsFacturar.Visible = True 'puede facturar
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.TienePermisoProceso(60) Then
@@ -7590,7 +7603,7 @@ Partial Class Ventas
If Not EsCreaApartirDe AndAlso (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then
DdlTipoComprobante.SelectedValueExist("Cot")
Else
- If UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then
+ If UsuarioActual.Empresa.Funcionalidad(595) = "1" Then
DdlTipoComprobante.SelectedValueExistInsert("PA", "Autorización")
DdlTipoComprobante.SelectedValue = "PA"
@@ -7611,9 +7624,19 @@ Partial Class Ventas
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
End If
+ Dim Bloqueo As Boolean = False
+
+ If Not DdlTipoComprobante.SelectedValue.Contiene("PA") AndAlso UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then
+ Bloqueo = True
+ End If
+
+ 'SI EL CLIENTE ES DISTRIBUIDOR Y TIENE FACTURAS VENCIDAS, DEBE BLOQUEAR
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
+ Bloqueo = True
+ End If
'SI ES AUTORIZACION DEBE PERMITIR GENERARLA
- If (Not DdlTipoComprobante.SelectedValue.Contiene("PA")) AndAlso UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then
+ If Bloqueo Then
BtnEmitirImprimir.Visible = False
BtnsFacturar.Visible = False
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
@@ -7621,6 +7644,11 @@ Partial Class Ventas
LnkPedido2SinFacturar.Visible = False
LnkCotizaciones.Visible = False
LnkOCs.Visible = False
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ TieneBloqueoPorCreditoVencimiento = 1
+ End If
+
End If
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
@@ -7645,6 +7673,7 @@ Partial Class Ventas
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Autorizacion > 0 Then
BtnsFacturar.Visible = True
+ TieneBloqueoPorCreditoVencimiento = 0
End If
End If
@@ -7688,6 +7717,7 @@ Partial Class Ventas
'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
If Autorizacion > 0 Then
BtnsFacturar.Visible = True
+ TieneBloqueoPorCreditoVencimiento = 0
End If
End If
@@ -7758,6 +7788,10 @@ Partial Class Ventas
BtnsFacturar.Visible = False
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
End If
End If
End If
@@ -7773,45 +7807,62 @@ Partial Class Ventas
End If
ObjVentas.Dispose()
Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO
- 'RMF. codigo temporal para pruebas
- If Alertas AndAlso UsuarioActual.CveEmpresa = 140 Then
+ 'VERIFICAR CANDADOS DE VENTA
+ If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:
{0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion > 0 Then
- LnkSolicitarCredito.Visible = True
+ BtnsFacturar.Visible = False
+ 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
End If
+ End If
+
+ If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
+ RBLPago.SelectedValue = "2"
+ RBLPago.Items(0).Enabled = False
+ RBLPago_SelectedIndexChanged(Nothing, Nothing)
+ UPCondicionesPago.Update()
Else
- 'VERIFICAR CANDADOS DE VENTA
- If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 Then
- Dim Vta As New ClsVentas
- Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
- Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:
{0}", Vta.SerieVenta)
- Vta.Dispose()
- If Opcion > 0 Then
- BtnsFacturar.Visible = False
- BtnGenerarRemision.Visible = False
- Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
+ 'este codigo no es temporal
+ If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ LnkSolicitarCredito.Visible = True
+ DdlTipoAutorizacion.SelectedValueExist("1")
+
+ If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then
+ Dim Autorizacion As Integer = 0
+
+ Dim ObjVentas As New ClsVentas
+ If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then
+ Dim RowAutorizacion As DataRow = Nothing
+ 'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
+ If TieneDiasVencidos Then
+ RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
+ Else
+ RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC")
+ End If
+
+ If RowAutorizacion IsNot Nothing Then
+ Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero()
+ End If
+ End If
+ ObjVentas.Dispose()
+
+ 'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO
+ If Autorizacion <= 0 Then
+ BtnEmitirImprimir.Visible = False
+ TieneBloqueoPorCreditoVencimiento = 1
+ End If
+
End If
End If
-
- If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
- RBLPago.SelectedValue = "2"
- RBLPago.Items(0).Enabled = False
- RBLPago_SelectedIndexChanged(Nothing, Nothing)
- UPCondicionesPago.Update()
- Else
- 'este codigo no es temporal
- If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
- If UsuarioActual.CveEmpresa = 140 Then
- LnkSolicitarCredito.Visible = True
- DdlTipoAutorizacion.SelectedValueExist("1")
- End If
- End If
-
-
End If
End Select
@@ -7822,13 +7873,32 @@ Partial Class Ventas
'VERIFICAR RESTRICCIONES DEL CLIENTE
If Not UsuarioActual.Empresa.Funcionalidad(702).ToEntero() > 0 Then
- If (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 AndAlso RBLPago.SelectedValue = "2") Then
- Dim Valida As Boolean = True
- If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (Me.CveCliente = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() OrElse Me.PermiteCredito) Then
- Valida = False
+
+ Dim ValidaRemision As Boolean = False
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ ValidaRemision = True
+ End If
+
+ Dim ValidaCondicionesCredito As Boolean = False
+
+ 'SI ES UNA VENTA EXISTENTE
+ If CveVenta > 0 Then
+ If (DdlTipoComprobante.SelectedValue = "Cot") AndAlso RBLPago.SelectedValue = "2" Then
+ ValidaCondicionesCredito = True
End If
- If Valida Then
+ If (ValidaRemision AndAlso DdlTipoComprobante.SelectedValue = "Rem") AndAlso RBLPago.SelectedValue = "1" Then
+ ValidaCondicionesCredito = True
+ End If
+ End If
+
+ If ValidaCondicionesCredito Then
+ Dim ValidaCliente As Boolean = True
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso (Me.CveCliente = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() OrElse Me.PermiteCredito) Then
+ ValidaCliente = False
+ End If
+
+ If ValidaCliente Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:
{0}", Vta.SerieVenta)
@@ -7858,6 +7928,10 @@ Partial Class Ventas
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
+ TieneBloqueoPorCreditoVencimiento = 1
+ End If
End If
Else
@@ -7865,6 +7939,10 @@ Partial Class Ventas
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
+ TieneBloqueoPorCreditoVencimiento = 1
+ End If
End If
End If
End If
@@ -17932,7 +18010,7 @@ Partial Class Ventas
TrAlmacenOrigen.Visible = False
If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
- Alert("Se ocupa una autorización.", TipoMensaje.MsgAdvertencia)
+ Alert("Se requiere una autorización.", TipoMensaje.MsgAdvertencia)
TrDireccion.Visible = False
TrCiudad.Visible = False
TrRFC.Visible = False
@@ -18327,14 +18405,14 @@ Partial Class Ventas
If Not CveEmpresaCRM > 0 Then
'SI ES UNA REMISION EXISTENTE, NO MOSTRAR LOS BOTONES
If Not (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
- BtnCrearApartirDe.Enabled = EstatusCliente
- BtnEmitirImprimir.Visible = EstatusCliente
+ BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
+ BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
TrVistaPrevia.Visible = EstatusCliente
End If
Else
If TipoDoctoConsulta.Contiene("Ing", "Egs", "Ant", "Dev") Then
- BtnCrearApartirDe.Enabled = EstatusCliente
- BtnEmitirImprimir.Visible = EstatusCliente
+ BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
+ BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
TrVistaPrevia.Visible = EstatusCliente
Else
BtnCrearApartirDe.Enabled = True
@@ -23383,8 +23461,11 @@ Partial Class Ventas
' DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
'End If
- DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
-
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0}", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
+ Else
+ DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
+ End If
DtCC.Dispose()
DdlCuentaEfectivo.DataBind()