VyA identificar logística, si ocupa 1 ó 2 operadores, campo nuevo nchoferes 1 o 2

This commit is contained in:
rakcsle
2024-07-29 11:33:09 -07:00
parent 729e47a1f4
commit 12d31c5e3c
9 changed files with 235 additions and 94 deletions

View File

@@ -64,6 +64,7 @@ Public Class CalendarEvent
Public Property CveMoneda As Integer Public Property CveMoneda As Integer
Public Property Moneda As String Public Property Moneda As String
Public Property NumChoferes As Integer = 1
End Class End Class

View File

@@ -193,6 +193,7 @@ Public Class ClsContratos
Public Property CvePartida As Integer Public Property CvePartida As Integer
Public Property CveDestino As Integer Public Property CveDestino As Integer
Public Property CveMasivo As Integer Public Property CveMasivo As Integer
Public Property NumChoferes As Integer = 1
#End Region #End Region
#Region " C O N T R A T O S " #Region " C O N T R A T O S "
@@ -319,6 +320,7 @@ Public Class ClsContratos
Me.CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero Me.CvePartida = Data.Rows(0)("CvePartida").ToString.ToEntero
Me.CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero Me.CveDestino = Data.Rows(0)("CveDestino").ToString.ToEntero
Me.CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero Me.CveMasivo = Data.Rows(0)("CveMasivo").ToString.ToEntero
Me.NumChoferes = Data.Rows(0)("NumChoferes").ToString.ToEntero
End If End If
Retorno = True Retorno = True
@@ -423,7 +425,8 @@ Public Class ClsContratos
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = -1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1, Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = -1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1, Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False, Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional FacturacionCicilica As Boolean = False, Optional FacturacionCiclicaAutomatico As Boolean = False,
Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing, Optional CantidadPasajeros As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = Nothing) As Boolean Optional DiaMesFacturacion As Integer = 1, Optional CvePeriodo As Integer = -1, Optional ObservacionesGenerales As String = "", Optional CveTipoAF As Integer = Nothing, Optional CveChofer As Integer = Nothing, Optional CveChofer2 As Integer = Nothing, Optional CveAF As Integer = Nothing,
Optional CantidadPasajeros As Integer = Nothing, Optional CvePartida As Integer = Nothing, Optional CveDestino As Integer = Nothing, Optional CveMasivo As Integer = -1, Optional NumChoferes As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Con_ContratosUpdate") DataAdapter("PA_Con_ContratosUpdate")
@@ -487,6 +490,7 @@ Public Class ClsContratos
.Add("@CvePartida", SqlDbType.Int).Value = CvePartida .Add("@CvePartida", SqlDbType.Int).Value = CvePartida
.Add("@CveDestino", SqlDbType.Int).Value = CveDestino .Add("@CveDestino", SqlDbType.Int).Value = CveDestino
.Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo .Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo
.Add("@NumChoferes", SqlDbType.Int).Value = NumChoferes
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -684,7 +688,7 @@ Public Class ClsContratos
Return Retorno Return Retorno
End Function End Function
Public Function GetContratosValUnidadesAgendadas(CveAF As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveEmpresa As Integer, CveContrato As Integer) As Boolean Public Function GetContratosValUnidadesAgendadas(CveAF As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveEmpresa As Integer, CveContrato As Integer, Optional Opcion As Integer = 1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Con_ContratosValUnidadesAgendadasGet") DataAdapter("PA_Con_ContratosValUnidadesAgendadasGet")
@@ -694,6 +698,7 @@ Public Class ClsContratos
.Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal .Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato .Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@Opcion", SqlDbType.Int).Value = Opcion
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -7881,7 +7881,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("TipoOC", If(ObjOC.Tipo = "OC", "Orden de Compra", "Requisición"))) params.Add(New ReportParameter("TipoOC", If(ObjOC.Tipo = "OC", "Orden de Compra", "Requisición")))
params.Add(New ReportParameter("UsoCFDI", ObjOC.UsoCFDI)) params.Add(New ReportParameter("UsoCFDI", ObjOC.UsoCFDI))
If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa = 197) Then If UsuarioActual.CveEmpresa.Contiene(72, 80, 172) Or (UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.CveEmpresa.Contiene(197, 189)) Then
params.Add(New ReportParameter("FolioAdicional", dtOC(0)("FolioAdicional").ToString)) params.Add(New ReportParameter("FolioAdicional", dtOC(0)("FolioAdicional").ToString))
params.Add(New ReportParameter("Vendedor", dtOC(0)("Vendedor").ToString)) params.Add(New ReportParameter("Vendedor", dtOC(0)("Vendedor").ToString))
params.Add(New ReportParameter("Observacion", dtOC(0)("PrioridadObservacion").ToString)) params.Add(New ReportParameter("Observacion", dtOC(0)("PrioridadObservacion").ToString))

View File

@@ -3401,6 +3401,7 @@ Public Class ClsVentas
.Add("@EsFilial", SqlDbType.Int).Value = EsFilial .Add("@EsFilial", SqlDbType.Int).Value = EsFilial
End With End With
Try Try
SqlAdapter.SelectCommand.CommandTimeout = 0
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
Retorno = True Retorno = True
Catch ex As Exception Catch ex As Exception

View File

@@ -552,13 +552,20 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveTipoAF = dr("CveTipoAF").ToString.ToEntero cevent.CveTipoAF = dr("CveTipoAF").ToString.ToEntero
cevent.backgroundColor = dr("BackgroundColor").ToString
cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString
cevent.NumeroContrato = dr("NumeroContrato").ToString cevent.NumeroContrato = dr("NumeroContrato").ToString
cevent.Observaciones = dr("Observaciones").ToString cevent.Observaciones = dr("Observaciones").ToString
cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
cevent.CveMoneda = dr("CveMoneda").ToString.ToEntero cevent.CveMoneda = dr("CveMoneda").ToString.ToEntero
cevent.Moneda = dr("Moneda").ToString cevent.Moneda = dr("Moneda").ToString
cevent.NumChoferes = dr("NumChoferes").ToString.ToEntero
If dr("CveChofer").ToString.ToEntero <= 0 Or (dr("CveChofer2").ToString.ToEntero <= 0 And cevent.NumChoferes = 2) Or dr("CveAF").ToString.ToEntero <= 0 Then
cevent.backgroundColor = "#bc9b1b"
End If
If Not cevent.recurrenciatipo > 0 Then If Not cevent.recurrenciatipo > 0 Then

View File

@@ -446,10 +446,10 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 11 --%> <%-- 11 --%>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false" ItemStyle-Width="60px">
<HeaderTemplate>% Desc.</HeaderTemplate> <HeaderTemplate>% Desc.</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtDescuento" Width="40px" runat="server" Style="text-align: right;" MaxLength="6"></asp:TextBox> <asp:TextBox ID="TxtDescuento" Width="60px" runat="server" Style="text-align: right;" MaxLength="15"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuento" ValidChars="1234567890+." FilterType="Custom" /> <ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtDescuento" ValidChars="1234567890+." FilterType="Custom" />
</ItemTemplate> </ItemTemplate>
@@ -721,63 +721,36 @@
//} //}
} }
function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar, chk,Text,Tipo) { function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar, chk, Text, Tipo) {
let idTxtDescuento = TxtDescuento.id;
let idTxtDescuento = TxtDescuento.id let idTxtAbonar = TxtAbonar.id;
let idTxtAbonar = TxtAbonar.id
let descuentoValue = $("#" + idTxtDescuento).val().trim(); let descuentoValue = $("#" + idTxtDescuento).val().trim();
let descuentoParts = descuentoValue.split('+'); let descuentoParts = descuentoValue.split('+');
let abonarConDescuento = 0.0; let abonarConDescuento = saldo;
if (descuentoParts.length === 0 || (descuentoParts.length === 1 && descuentoParts[0] === "")) {
if (descuentoParts.length === 1) { $("#" + idTxtAbonar).val(saldo.toFixed(2));
if (isNaN(parseFloat(descuentoParts[0])) || descuentoParts[0] == "0") {
$("#" + idTxtAbonar).val(saldo.toFixed(2));
FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo);
} else {
let descuento = saldo * (parseFloat(descuentoParts[0]) / 100);
abonarConDescuento = saldo - descuento;
$("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2),2));
FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo);
}
} else if (descuentoParts.length === 2) {
if (isNaN(parseFloat(descuentoParts[0]))) {
$("#" + idTxtAbonar).val("");
FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo);
return;
}
let descuento1 = saldo * (parseFloat(descuentoParts[0]) / 100);
if (isNaN(parseFloat(descuentoParts[1]))) {
let descuento = saldo * (parseFloat(descuentoParts[0]) / 100);
abonarConDescuento = saldo - descuento;
$("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2), 2));
FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo);
return;
}
let descuento = saldo * (parseFloat(descuentoParts[0]) / 100);
abonarConDescuento = saldo - descuento;
let abonarConDescuento2 = abonarConDescuento - (abonarConDescuento * (parseFloat(descuentoParts[1]) / 100));
$("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento2.toFixed(2), 2));
FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo);
} else {
$("#" + idTxtAbonar).val("");
FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo); FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo);
return;
} }
for (let i = 0; i < descuentoParts.length; i++) {
let descuentoPart = descuentoParts[i].trim();
if (isNaN(parseFloat(descuentoPart)) || descuentoPart === "0") {
continue;
}
let descuento = abonarConDescuento * (parseFloat(descuentoPart) / 100);
abonarConDescuento -= descuento;
}
$("#" + idTxtAbonar).val(FormatoNumero(abonarConDescuento.toFixed(2), 2));
FnCambia(chk, TxtAbonar, saldo, 1, Text, Tipo);
} }
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -4227,12 +4227,14 @@ Partial Class Compras_Compras
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
'------------------ INICIA VALIDACIONES ------------------
If Not ValidaPresupuesto(2) Then If Not ValidaPresupuesto(2) Then
Exit Sub Exit Sub
End If End If
'------------------ INICIA VALIDACIONES ------------------
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia) Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -4689,6 +4691,11 @@ Partial Class Compras_Compras
Exit Sub Exit Sub
End If End If
If DdlMoneda.SelectedValue.ToEntero > 1 And TxtTC.Text.ToDecimal <= 10 Then
Alert("Al seleccionar dólares, el tipo de cambio debe ser superior a 10.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'------------------TERMINA VALIDACIONES------------------ '------------------TERMINA VALIDACIONES------------------
@@ -8552,7 +8559,7 @@ Partial Class Compras_Compras
If ArrAnticipos.Count > 0 Then If ArrAnticipos.Count > 0 Then
For Each Ant As Compras_Compras.Anticipos In ArrAnticipos For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
'ImporteAnticipo += (Ant.Importe + Ant.ImporteComision) 'ImporteAnticipo += (Ant.Importe + Ant.ImporteComision)
ImporteAnticipo += (Ant.Importe) ImporteAnticipo += ((Ant.Importe) + Ant.ImporteComision)
Next Next
End If End If
@@ -17103,7 +17110,7 @@ Partial Class Compras_Compras
'HdnIVAPS.Value = If(PS.Rows(0)("IVA").ToString = "-1", ViewState("IVA"), PS.Rows(0)("IVA").ToString).ToString 'HdnIVAPS.Value = If(PS.Rows(0)("IVA").ToString = "-1", ViewState("IVA"), PS.Rows(0)("IVA").ToString).ToString
ViewState("IVAPS") = PS("IVA").ToString ViewState("IVAPS") = PS("IVA").ToString
If ViewState("IVAPS").ToString.ToEntero() = -1 Then If ViewState("IVAPS").ToString.ToEntero() = -1 Then
Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero())(0) Dim Drr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa)(0)
ViewState("IVAPS") = Drr("IVA").ToString().ToDouble() ViewState("IVAPS") = Drr("IVA").ToString().ToDouble()
DdlProyecto.SelectedValueExist(Drr("CveProyecto")) DdlProyecto.SelectedValueExist(Drr("CveProyecto"))

View File

@@ -207,8 +207,8 @@
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado" <asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid"
GridLines="None" GridLines="None" data-sort="true"
data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros,CveMoneda,Moneda,CveSubProyecto"> DataKeyNames="CveContrato,NumeroContrato,DescripcionContrato,Ubicacion,FechaInicial,FechaFinal,CveCliente,NombreComercial,CveTipoAF,Importe,ImporteMin,ImporteMax,Observaciones,CveAF,CveChofer,CveChofer2,CveContratosEstatus,CantidadPasajeros,CveMoneda,Moneda,CveSubProyecto,NumChoferes">
<Columns> <Columns>
<asp:TemplateField HeaderText="Contrato"> <asp:TemplateField HeaderText="Contrato">
<ItemTemplate> <ItemTemplate>
@@ -421,7 +421,10 @@
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo" <asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo"
DataTextField="TipoActivoFijo" Class="form-control input-inline" DataTextField="TipoActivoFijo" Class="form-control input-inline"
Width="100%" runat="server" Enabled="true"> Width="100%" runat="server" Enabled="true"
AutoPostBack="true"
OnSelectedIndexChanged="DdlTipoAF_SelectedIndexChanged"
>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
@@ -447,6 +450,13 @@
</div> </div>
<div class="row my-1"> <div class="row my-1">
<label class="col-md-4">Requiere Seguncdo Chofer</label>
<div class="col-md-8" style="text-align:left!important">
<asp:CheckBox runat="server" ID="chkSegundoChofer" AutoPostBack="true" OnCheckedChanged="chkSegundoChofer_CheckedChanged" />
</div>
</div>
<div class="row my-1" runat="server" id="DVChofer2">
<label class="col-md-4">Chofer 2</label> <label class="col-md-4">Chofer 2</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal" <asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal"
@@ -507,6 +517,9 @@
<ContentTemplate> <ContentTemplate>
<asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button> <asp:Button runat="server" ID="BtnModal" OnClick="MostrarModal"></asp:Button>
<asp:HiddenField runat="server" ID="HdnCveContrato" Value="-1" ClientIDMode="Static" /> <asp:HiddenField runat="server" ID="HdnCveContrato" Value="-1" ClientIDMode="Static" />
<asp:Button runat="server" ID="BtnDdlTipoAF" OnClick="BtnDdlTipoAF_Click" ClientIDMode="Static"></asp:Button>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
@@ -515,6 +528,13 @@
<asp:HiddenField runat="server" ID="HidCurrentMonth" ClientIDMode="Static" Value="-1" /> <asp:HiddenField runat="server" ID="HidCurrentMonth" ClientIDMode="Static" Value="-1" />
<asp:HiddenField runat="server" ID="HidCurrentYear" ClientIDMode="Static" Value="-1" /> <asp:HiddenField runat="server" ID="HidCurrentYear" ClientIDMode="Static" Value="-1" />
<asp:HiddenField runat="server" ID="HidCveTipoAF" Value="-1" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HidNumChoferes" Value="-1" ClientIDMode="Static" />
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
@@ -782,8 +802,21 @@
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF); $('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
$('#<%=DdlSubProyectoModal.ClientID%>').val(event.CveSubProyecto); $('#<%=DdlSubProyectoModal.ClientID%>').val(event.CveSubProyecto);
$('#<%= HidCveTipoAF.ClientID%>').val( $('#<%=DdlTipoAF.ClientID%>').val() );
$('#<%=BtnDdlTipoAF.ClientID%>').click();
// alert(event.Moneda); $('#HidNumChoferes').val(event.NumChoferes);
<%-- if (event.NumChoferes === 2) {
$('#<%= chkSegundoChofer.ClientID %>').prop('checked', true);
$('#<%= DVChofer2.ClientID %>').css('display', 'block');
} else {
$('#<%= chkSegundoChofer.ClientID %>').prop('checked', false);
$('#<%= DVChofer2.ClientID %>').css('display', 'none');
}--%>
if (event.NombreComercial !== null) { if (event.NombreComercial !== null) {
@@ -793,6 +826,7 @@
} }
$('#HidModCveCliente').val(event.CveCliente); $('#HidModCveCliente').val(event.CveCliente);
$('#<%=BtnModal.ClientID%>').click(); $('#<%=BtnModal.ClientID%>').click();
} }
@@ -941,6 +975,14 @@
editable: true, editable: true,
minTime: "00:00:00", minTime: "00:00:00",
maxTime: "24:00:00", maxTime: "24:00:00",
eventOverlap: false, // No permitir la superposición de eventos
slotEventOverlap: false, // No permitir la superposición en vistas de agenda
eventRender: function (event, element) {
element.css({
'margin-bottom': '1px', // Ajusta el valor según sea necesario
'margin-left': '1px' // Ajusta el valor según sea necesario
});
},
events: { events: {
url: '/Ashx/CargaEventos.ashx', url: '/Ashx/CargaEventos.ashx',
type: 'GET', type: 'GET',

View File

@@ -208,24 +208,17 @@ Partial Class RepContratosCalendario
e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaInicial").ToDate.Ticks.ToString) e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaInicial").ToDate.Ticks.ToString)
End If End If
End Sub End Sub
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
If HidModClienteNombre.Value = "" Then
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
End If
DdlClientes.SelectedText = HidModClienteNombre.Value
DdlClientes.SelectedValue = HidModCveCliente.Value
DdlClientes.txtText.Value = HidModClienteNombre.Value
DdlClientes.txtValue.Value = HidModCveCliente.Value
UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
Protected Sub UpdateContrato(sender As Object, e As EventArgs) Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim NumChoferes As Integer = If(chkSegundoChofer.Checked, 2, 1)
If NumChoferes = 2 AndAlso DdlChofer2.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar un segundo chofer.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjContratos As New ClsContratos Dim ObjContratos As New ClsContratos
Dim DTAgendadados As New DataTable Dim DTAgendadados As New DataTable
@@ -250,8 +243,12 @@ Partial Class RepContratosCalendario
End If End If
If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", DdlSubProyectoModal.SelectedValue.ToEntero, If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", DdlSubProyectoModal.SelectedValue.ToEntero,
-1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim) Then -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34,
CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero,
CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim, NumChoferes:=NumChoferes) Then
RegistraScript("$('#ModalActualizar').modal('hide');") RegistraScript("$('#ModalActualizar').modal('hide');")
Alert("Actualizado Correctamente.") Alert("Actualizado Correctamente.")
End If End If
@@ -264,7 +261,10 @@ Partial Class RepContratosCalendario
End Sub End Sub
Protected Sub UpdateModal(sender As Object, e As EventArgs) Protected Sub UpdateModal(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 NumChoferes As Integer = GvRow.DataKey("NumChoferes").ToEntero
TxtFolio.Text = GvRow.DataKey("NumeroContrato") TxtFolio.Text = GvRow.DataKey("NumeroContrato")
TxtCantidadPasajeros.Text = GvRow.DataKey("CantidadPasajeros") TxtCantidadPasajeros.Text = GvRow.DataKey("CantidadPasajeros")
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente") DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
@@ -276,16 +276,115 @@ Partial Class RepContratosCalendario
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ") TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
TxtMoneda.Text = GvRow.DataKey("Moneda") TxtMoneda.Text = GvRow.DataKey("Moneda")
'Requeridos 'Requeridos
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer")) DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2")) DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus")) DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus"))
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto")) DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlTipoAF.SelectedValueExist(GvRow.DataKey("CveTipoAF"))
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
CveContrato = GvRow.DataKey("CveContrato").ToEntero CveContrato = GvRow.DataKey("CveContrato").ToEntero
OcultarMostrarSegundoChofer()
UpCommando.Update() UpCommando.Update()
UpModal.Update() UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');") RegistraScript("$('#ModalActualizar').modal('show');")
End Sub End Sub
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
If HidModClienteNombre.Value = "" Then
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
End If
DdlClientes.SelectedText = HidModClienteNombre.Value
DdlClientes.SelectedValue = HidModCveCliente.Value
DdlClientes.txtText.Value = HidModClienteNombre.Value
DdlClientes.txtValue.Value = HidModCveCliente.Value
chkSegundoChofer.Checked = If(HidNumChoferes.Value.ToEntero = 2, True, False)
OcultarMostrarSegundoChofer()
UpModal.Update()
RegistraScript("$('#ModalActualizar').modal('show');")
End Sub
Protected Sub chkSegundoChofer_CheckedChanged(sender As Object, e As EventArgs)
OcultarMostrarSegundoChofer()
End Sub
Private Sub OcultarMostrarSegundoChofer()
If chkSegundoChofer.Checked Then
DVChofer2.Attributes.Add("style", "display:block")
Else
DVChofer2.Attributes.Add("style", "display:none")
End If
UpCommando.Update()
UpModal.Update()
End Sub
Protected Sub DdlTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaAFDdl(DdlTipoAF.SelectedValue.ToEntero)
End Sub
Protected Sub BtnDdlTipoAF_Click(sender As Object, e As EventArgs)
CargaAFDdl(HidCveTipoAF.Value.ToEntero)
End Sub
Private Sub CargaAFDdl(CveTipoAF As Integer)
'Lista de Activos fijos
DdlAF.ClearSelection()
DdlAF.SelectedValue = Nothing
DdlAF.Items.Clear()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, UsuarioActual.CveEmpresa, CveContrato, 2) Then
If CveTipoAF > 0 Then
DdlAF.DataSource = ObjContratos.DtResultados.FiltraParametros($" CveTipoActivoFijo = {CveTipoAF} ")
Else
DdlAF.DataSource = ObjContratos.DtResultados
End If
End If
ObjContratos.Dispose()
'If CveTipoAF > 0 Then
' DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' AND CveTipoActivoFijo = {CveTipoAF} ")
'Else
' DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros($" EstadoActivoFijo= 'Activo' ")
'End If
DdlAF.DataBind()
DdlAF.Items.Insert(0, New ListItem("-", "-1"))
UpModal.Update()
End Sub
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString) GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
End Sub End Sub
@@ -325,4 +424,10 @@ Partial Class RepContratosCalendario
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaCronograma(DdlTipoVista.SelectedValue.ToEntero) CargaCronograma(DdlTipoVista.SelectedValue.ToEntero)
End Sub End Sub
End Class End Class