VyA identificar logística, si ocupa 1 ó 2 operadores, campo nuevo nchoferes 1 o 2
This commit is contained in:
@@ -64,6 +64,7 @@ Public Class CalendarEvent
|
||||
|
||||
Public Property CveMoneda As Integer
|
||||
Public Property Moneda As String
|
||||
Public Property NumChoferes As Integer = 1
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -193,6 +193,7 @@ Public Class ClsContratos
|
||||
Public Property CvePartida As Integer
|
||||
Public Property CveDestino As Integer
|
||||
Public Property CveMasivo As Integer
|
||||
Public Property NumChoferes As Integer = 1
|
||||
#End Region
|
||||
|
||||
#Region " C O N T R A T O S "
|
||||
@@ -318,7 +319,8 @@ Public Class ClsContratos
|
||||
Me.CantidadPasajeros = Data.Rows(0)("CantidadPasajeros").ToString.ToEntero
|
||||
Me.CvePartida = Data.Rows(0)("CvePartida").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
|
||||
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 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 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
|
||||
|
||||
DataAdapter("PA_Con_ContratosUpdate")
|
||||
@@ -487,6 +490,7 @@ Public Class ClsContratos
|
||||
.Add("@CvePartida", SqlDbType.Int).Value = CvePartida
|
||||
.Add("@CveDestino", SqlDbType.Int).Value = CveDestino
|
||||
.Add("@CveMasivo", SqlDbType.Int).Value = CveMasivo
|
||||
.Add("@NumChoferes", SqlDbType.Int).Value = NumChoferes
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -684,7 +688,7 @@ Public Class ClsContratos
|
||||
Return Retorno
|
||||
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
|
||||
DataAdapter("PA_Con_ContratosValUnidadesAgendadasGet")
|
||||
|
||||
@@ -694,6 +698,7 @@ Public Class ClsContratos
|
||||
.Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -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("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("Vendedor", dtOC(0)("Vendedor").ToString))
|
||||
params.Add(New ReportParameter("Observacion", dtOC(0)("PrioridadObservacion").ToString))
|
||||
|
||||
@@ -3401,6 +3401,7 @@ Public Class ClsVentas
|
||||
.Add("@EsFilial", SqlDbType.Int).Value = EsFilial
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.SelectCommand.CommandTimeout = 0
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
|
||||
@@ -552,13 +552,20 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal
|
||||
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
|
||||
cevent.CveTipoAF = dr("CveTipoAF").ToString.ToEntero
|
||||
cevent.backgroundColor = dr("BackgroundColor").ToString
|
||||
cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString
|
||||
cevent.NumeroContrato = dr("NumeroContrato").ToString
|
||||
cevent.Observaciones = dr("Observaciones").ToString
|
||||
cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
|
||||
cevent.CveMoneda = dr("CveMoneda").ToString.ToEntero
|
||||
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
|
||||
|
||||
@@ -446,10 +446,10 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%-- 11 --%>
|
||||
<asp:TemplateField Visible="false">
|
||||
<asp:TemplateField Visible="false" ItemStyle-Width="60px">
|
||||
<HeaderTemplate>% Desc.</HeaderTemplate>
|
||||
<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" />
|
||||
|
||||
</ItemTemplate>
|
||||
@@ -721,63 +721,36 @@
|
||||
//}
|
||||
}
|
||||
|
||||
function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar, chk,Text,Tipo) {
|
||||
|
||||
let idTxtDescuento = TxtDescuento.id
|
||||
let idTxtAbonar = TxtAbonar.id
|
||||
|
||||
let descuentoValue = $("#" + idTxtDescuento).val().trim();
|
||||
let descuentoParts = descuentoValue.split('+');
|
||||
let abonarConDescuento = 0.0;
|
||||
|
||||
|
||||
if (descuentoParts.length === 1) {
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
function calculaDescuentoEscalonado(saldo, TxtDescuento, TxtAbonar, chk, Text, Tipo) {
|
||||
let idTxtDescuento = TxtDescuento.id;
|
||||
let idTxtAbonar = TxtAbonar.id;
|
||||
|
||||
let descuentoValue = $("#" + idTxtDescuento).val().trim();
|
||||
let descuentoParts = descuentoValue.split('+');
|
||||
let abonarConDescuento = saldo;
|
||||
|
||||
if (descuentoParts.length === 0 || (descuentoParts.length === 1 && descuentoParts[0] === "")) {
|
||||
$("#" + idTxtAbonar).val(saldo.toFixed(2));
|
||||
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>
|
||||
</asp:Content>
|
||||
|
||||
@@ -4227,12 +4227,14 @@ Partial Class Compras_Compras
|
||||
|
||||
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
|
||||
|
||||
'------------------ INICIA VALIDACIONES ------------------
|
||||
|
||||
If Not ValidaPresupuesto(2) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'------------------ INICIA VALIDACIONES ------------------
|
||||
|
||||
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)
|
||||
Exit Sub
|
||||
@@ -4689,6 +4691,11 @@ Partial Class Compras_Compras
|
||||
Exit Sub
|
||||
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------------------
|
||||
|
||||
|
||||
@@ -8552,7 +8559,7 @@ Partial Class Compras_Compras
|
||||
If ArrAnticipos.Count > 0 Then
|
||||
For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
|
||||
'ImporteAnticipo += (Ant.Importe + Ant.ImporteComision)
|
||||
ImporteAnticipo += (Ant.Importe)
|
||||
ImporteAnticipo += ((Ant.Importe) + Ant.ImporteComision)
|
||||
Next
|
||||
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
|
||||
ViewState("IVAPS") = PS("IVA").ToString
|
||||
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()
|
||||
DdlProyecto.SelectedValueExist(Drr("CveProyecto"))
|
||||
|
||||
|
||||
@@ -207,8 +207,8 @@
|
||||
|
||||
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
|
||||
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid"
|
||||
GridLines="None"
|
||||
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">
|
||||
GridLines="None" 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,NumChoferes">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Contrato">
|
||||
<ItemTemplate>
|
||||
@@ -421,7 +421,10 @@
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlTipoAF" DataValueField="CveTipoActivoFijo"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -447,6 +450,13 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlChofer2" AppendDataBoundItems="true" DataValueField="CvePersonal"
|
||||
@@ -506,7 +516,10 @@
|
||||
<asp:UpdatePanel ID="UpCommando" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<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>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
@@ -515,6 +528,13 @@
|
||||
|
||||
<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="HidCveTipoAF" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<asp:HiddenField runat="server" ID="HidNumChoferes" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||
@@ -782,8 +802,21 @@
|
||||
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
|
||||
$('#<%=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) {
|
||||
@@ -793,6 +826,7 @@
|
||||
}
|
||||
|
||||
$('#HidModCveCliente').val(event.CveCliente);
|
||||
|
||||
$('#<%=BtnModal.ClientID%>').click();
|
||||
|
||||
}
|
||||
@@ -941,6 +975,14 @@
|
||||
editable: true,
|
||||
minTime: "00: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: {
|
||||
url: '/Ashx/CargaEventos.ashx',
|
||||
type: 'GET',
|
||||
|
||||
@@ -208,24 +208,17 @@ Partial Class RepContratosCalendario
|
||||
e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaInicial").ToDate.Ticks.ToString)
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
|
||||
|
||||
|
||||
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
|
||||
|
||||
If HidModClienteNombre.Value = "" Then
|
||||
HidModClienteNombre.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, -1, HidModCveCliente.Value.ToEntero).FiltroPrimeroValor("NombreComercial")
|
||||
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
|
||||
|
||||
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)
|
||||
Dim ObjContratos As New ClsContratos
|
||||
|
||||
Dim DTAgendadados As New DataTable
|
||||
@@ -250,8 +243,12 @@ Partial Class RepContratosCalendario
|
||||
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,
|
||||
-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');")
|
||||
Alert("Actualizado Correctamente.")
|
||||
End If
|
||||
@@ -263,8 +260,11 @@ Partial Class RepContratosCalendario
|
||||
InicializaCalendar()
|
||||
|
||||
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 NumChoferes As Integer = GvRow.DataKey("NumChoferes").ToEntero
|
||||
|
||||
TxtFolio.Text = GvRow.DataKey("NumeroContrato")
|
||||
TxtCantidadPasajeros.Text = GvRow.DataKey("CantidadPasajeros")
|
||||
DdlClientes.SelectedValue = GvRow.DataKey("CveCliente")
|
||||
@@ -274,18 +274,117 @@ Partial Class RepContratosCalendario
|
||||
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
|
||||
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).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")
|
||||
'Requeridos
|
||||
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
|
||||
TxtMoneda.Text = GvRow.DataKey("Moneda")
|
||||
'Requeridos
|
||||
|
||||
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"))
|
||||
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
|
||||
|
||||
OcultarMostrarSegundoChofer()
|
||||
|
||||
UpCommando.Update()
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
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
|
||||
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
||||
End Sub
|
||||
@@ -325,4 +424,10 @@ Partial Class RepContratosCalendario
|
||||
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaCronograma(DdlTipoVista.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user