VyA RepContratoCalendario, rdlc rep anomalias, Compras gv Inv requerir lote y fecha de caducidad
This commit is contained in:
@@ -749,23 +749,17 @@
|
||||
<asp:HiddenField runat="server" ID="HidRemisionSaldo" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidCveAF" Value="-1" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidCveAFDes" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<div style="display:none!important">
|
||||
<asp:UpdatePanel runat="server" ID="UPCargaCalendario">
|
||||
<ContentTemplate>
|
||||
<asp:Button runat="server" ID="BtnCargaContratoCalendario" OnClick="BtnCargaContratoCalendario_Click" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||
<%--<script src="https://cdn.amcharts.com/lib/5/index.js"></script>
|
||||
<script src="https://cdn.amcharts.com/lib/5/xy.js"></script>--%>
|
||||
<%--<script src="https://cdn.amcharts.com/lib/5/themes/Animated.js"></script>--%>
|
||||
<%--<script src="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.js"></script>--%>
|
||||
<%--<script src="/Transportes/Gant/dhtmlxgantt.js"></script>--%>
|
||||
|
||||
|
||||
<!-- Essential JS 2 all material theme -->
|
||||
<%--<link href="Gant/material.css" rel="stylesheet" type="text/css"/>
|
||||
<!-- Essential JS 2 all script -->
|
||||
<script src="Gant/ej2.min.js" type="text/javascript"></script>--%>
|
||||
|
||||
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
<!-- Librería principal de amCharts 4 -->
|
||||
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
|
||||
@@ -780,39 +774,7 @@
|
||||
<script src="https://cdn.amcharts.com/lib/4/lang/es_ES.js"></script>
|
||||
|
||||
<script>
|
||||
// Create root element
|
||||
// https://www.amcharts.com/docs/v5/getting-started/#Root_element
|
||||
//var root = am5.Root.new("chartdiv");
|
||||
|
||||
var am5locales_es_ES = {
|
||||
"Jan": "Enero",
|
||||
"Feb": "Febrero",
|
||||
"Mar": "Marzo",
|
||||
"Apr": "Abril",
|
||||
"May": "Mayo",
|
||||
"Jun": "Junio",
|
||||
"Jul": "Julio",
|
||||
"Aug": "Agosto",
|
||||
"Sep": "Septiembre",
|
||||
"Oct": "Octubre",
|
||||
"Nov": "Noviembre",
|
||||
"Dec": "Diciembre",
|
||||
|
||||
"January": "Enero",
|
||||
"February": "Febrero",
|
||||
"March": "Marzo",
|
||||
"April": "Abril",
|
||||
"June": "Junio",
|
||||
"July": "Julio",
|
||||
"August": "Agosto",
|
||||
"September": "Septiembre",
|
||||
"October": "Octubre",
|
||||
"November": "Noviembre",
|
||||
"December": "Diciembre",
|
||||
|
||||
};
|
||||
let dateAxis;
|
||||
let yAxis;
|
||||
|
||||
var chartHeader;
|
||||
var chartBody;
|
||||
@@ -834,6 +796,7 @@
|
||||
// Convertir valores a objetos Date
|
||||
let minDate = new Date(fechaI.split("/").reverse().join("-"));
|
||||
let maxDate = new Date(fechaF.split("/").reverse().join("-"));
|
||||
maxDate.setDate(maxDate.getDate() + 1);
|
||||
maxDate.setHours(23, 59, 59, 999);
|
||||
|
||||
// Crear instancia del gráfico del encabezado
|
||||
@@ -856,14 +819,14 @@
|
||||
// Crear eje X (DateAxis) para el encabezado
|
||||
var xAxisHeader = chartHeader.xAxes.push(new am4charts.DateAxis());
|
||||
//xAxisHeader.baseInterval = { timeUnit: "hour", count: 1 };
|
||||
xAxisHeader.baseInterval = { timeUnit: "day", count: 1 }; // Cambiado a "day"
|
||||
xAxisHeader.minPeriod = "day"; // Añadido
|
||||
xAxisHeader.baseInterval = { timeUnit: "day", count: 1 };
|
||||
xAxisHeader.minPeriod = "day";
|
||||
xAxisHeader.min = minDate.getTime();
|
||||
xAxisHeader.max = maxDate.getTime();
|
||||
xAxisHeader.renderer.opposite = false; // Cambiado a false
|
||||
xAxisHeader.renderer.opposite = false;
|
||||
xAxisHeader.renderer.minGridDistance = 1; // Ajusta según sea necesario para evitar superposición
|
||||
xAxisHeader.renderer.minorGridEnabled = false;
|
||||
xAxisHeader.markUnitChange = false;
|
||||
xAxisHeader.markUnitChange = false;
|
||||
|
||||
|
||||
// Configurar las líneas de cuadrícula
|
||||
@@ -880,11 +843,26 @@
|
||||
xAxisHeader.renderer.labels.template.fontWeight = "bold";
|
||||
|
||||
// Formatear las etiquetas de fecha
|
||||
xAxisHeader.dateFormatter.dateFormat = "dd/MM";
|
||||
//xAxisHeader.dateFormats.setKey("day", "dd/MM"); // Añadido
|
||||
xAxisHeader.periodChangeDateFormats.setKey("day", "dd/MM"); // Asegurado
|
||||
xAxisHeader.periodChangeDateFormats.setKey("month", "MMMM"); // Opcional, si deseas mostrar meses
|
||||
xAxisHeader.dateFormatter.dateFormat = "dd";
|
||||
xAxisHeader.markUnitChange = false;
|
||||
xAxisHeader.periodChangeDateFormats.setKey("day", "dd");
|
||||
xAxisHeader.periodChangeDateFormats.setKey("month", "dd");
|
||||
xAxisHeader.periodChangeDateFormats.setKey("year", "dd");
|
||||
|
||||
// Personalizar las etiquetas del eje X
|
||||
xAxisHeader.renderer.labels.template.adapter.add("text", function (text, target) {
|
||||
if (target.dataItem && target.dataItem.date) {
|
||||
var date = target.dataItem.date;
|
||||
var numberFormatter = new am4core.NumberFormatter();
|
||||
return numberFormatter.format(date.getDate(), "00");
|
||||
} else {
|
||||
return text;
|
||||
}
|
||||
});
|
||||
|
||||
// Desactivar marcas y rellenos de cambio de periodo
|
||||
xAxisHeader.renderer.ticks.template.disabled = true;
|
||||
xAxisHeader.renderer.axisFills.template.disabled = true;
|
||||
|
||||
|
||||
// Crear eje Y (ValueAxis) para el encabezado (dummy)
|
||||
@@ -893,18 +871,18 @@
|
||||
yAxisHeader.renderer.grid.template.disabled = true;
|
||||
|
||||
// Asignar datos al gráfico del encabezado
|
||||
// Creamos datos dummy con fechas mínimas y máximas
|
||||
// Creamos datos con fechas mínimas y máximas
|
||||
chartHeader.data = [
|
||||
{ date: minDate, value: 0 },
|
||||
{ date: maxDate, value: 0 }
|
||||
];
|
||||
|
||||
// Añadir una serie dummy para que el eje X se renderice correctamente
|
||||
// Añadir una serie para que el eje X se renderice correctamente
|
||||
var seriesHeader = chartHeader.series.push(new am4charts.LineSeries());
|
||||
seriesHeader.dataFields.dateX = "date";
|
||||
seriesHeader.dataFields.valueY = "value";
|
||||
seriesHeader.strokeOpacity = 0; // Hacemos la línea invisible
|
||||
seriesHeader.fillOpacity = 0;
|
||||
seriesHeader.strokeOpacity = 1; // Hacemos la línea invisible
|
||||
seriesHeader.fillOpacity = 1;
|
||||
|
||||
// Crear instancia del gráfico principal (cuerpo)
|
||||
chartBody = am4core.create("chart-body", am4charts.XYChart);
|
||||
@@ -925,9 +903,9 @@
|
||||
|
||||
|
||||
// Configurar el cursor para permitir interacción solo en el eje X
|
||||
chartBody.cursor = new am4charts.XYCursor();
|
||||
chartBody.cursor.behavior = "zoomX"; // O "panX" si solo deseas desplazamiento horizontal
|
||||
chartBody.cursor.lineY.disabled = true; // Deshabilita la línea vertical del cursor
|
||||
chartBody.cursor = new am4charts.XYCursor();
|
||||
chartBody.cursor.behavior = "zoomX"; // O "panX" si solo deseas desplazamiento horizontal
|
||||
chartBody.cursor.lineY.disabled = true; // Deshabilita la línea vertical del cursor
|
||||
|
||||
|
||||
// Definir cellSize para el tamaño fijo de cada categoría en el eje Y
|
||||
@@ -959,8 +937,9 @@
|
||||
|
||||
// Deshabilitar las etiquetas y grids del eje X en el gráfico principal
|
||||
xAxisBody.renderer.labels.template.disabled = true;
|
||||
xAxisBody.renderer.grid.template.disabled = true;
|
||||
|
||||
// visibilzar grid
|
||||
xAxisBody.renderer.grid.template.disabled = false;
|
||||
xAxisBody.renderer.labels.template.forceShow = true;
|
||||
|
||||
|
||||
// Añadir la serie al gráfico principal
|
||||
@@ -969,12 +948,13 @@
|
||||
seriesBody.dataFields.dateX = "toDate";
|
||||
seriesBody.dataFields.categoryY = "category";
|
||||
|
||||
seriesBody.columns.template.tooltipText = "UNIDAD: {category}-{unidad}\nCONTRATO: {contrato}\nDURACIÓN: {fromDate} - {toDate}";
|
||||
seriesBody.columns.template.tooltipText = "UNIDAD: {category}-{unidad}\nCONTRATO: {contrato}\nCLIENTE: {cliente}\nDURACIÓN: {fromDate} - {toDate}";
|
||||
seriesBody.columns.template.strokeOpacity = 0;
|
||||
|
||||
// Asignar colores a las columnas basado en el campo 'color' de los datos
|
||||
seriesBody.columns.template.propertyFields.fill = "color";
|
||||
seriesBody.columns.template.propertyFields.stroke = "color";
|
||||
|
||||
|
||||
var labelBullet = seriesBody.bullets.push(new am4charts.LabelBullet());
|
||||
labelBullet.label.text = "{contrato}";
|
||||
@@ -1015,10 +995,23 @@
|
||||
yAxisBody.zoom({ start: 0, end: 1 });
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Animaciones al cargar
|
||||
seriesBody.appear();
|
||||
chartBody.appear(1000, 100);
|
||||
|
||||
|
||||
chartBody.events.on("datavalidated", function () {
|
||||
//chartHeader.paddingLeft = yAxisBody.renderer.pixelWidth;
|
||||
chartHeader.paddingLeft = 50;
|
||||
//alert(chartBody.yAxes.getIndex(0).renderer.pixelWidth);
|
||||
chartHeader.validateLayout();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cargaDiagramaGrant(data, categorias, TipoVista) {
|
||||
@@ -1244,195 +1237,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
<%--function cargaDiagramaGrant(data, categorias, TipoVista) {
|
||||
|
||||
am5.ready(function () {
|
||||
//SI YA HAY GRAFICA, QUITA LA ACTUAL PARA HACER UNA NUEVA
|
||||
root.container.children.clear();
|
||||
|
||||
root.dateFormatter.setAll({
|
||||
dateFormat: "dd/MM/yyyy HH:mm",
|
||||
dateFields: ["valueX", "openValueX"]
|
||||
});
|
||||
|
||||
root.locale = am5locales_es_ES;
|
||||
|
||||
// Set themes
|
||||
// https://www.amcharts.com/docs/v5/concepts/themes/
|
||||
root.setThemes([
|
||||
am5themes_Animated.new(root)
|
||||
]);
|
||||
|
||||
// Create chart
|
||||
// https://www.amcharts.com/docs/v5/charts/xy-chart/
|
||||
var chart = root.container.children.push(am5xy.XYChart.new(root, {
|
||||
panX: false,
|
||||
panY: false,
|
||||
wheelX: "none",
|
||||
wheelY: "none",
|
||||
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, {
|
||||
centerX: am5.p50,
|
||||
x: am5.p50
|
||||
}))
|
||||
|
||||
var colors = chart.get("colors");
|
||||
|
||||
// Create axes
|
||||
// https://www.amcharts.com/docs/v5/charts/xy-chart/axes/
|
||||
var yAxis = chart.yAxes.push(
|
||||
am5xy.CategoryAxis.new(root, {
|
||||
categoryField: "category",
|
||||
renderer: am5xy.AxisRendererY.new(root, {
|
||||
inversed: true,
|
||||
minorGridEnabled: true
|
||||
}),
|
||||
tooltip: am5.Tooltip.new(root, {
|
||||
themeTags: ["axis"],
|
||||
animationDuration: 200
|
||||
})
|
||||
})
|
||||
);
|
||||
|
||||
yAxis.data.setAll(categorias);
|
||||
|
||||
// Obtener valores de las cajas de texto
|
||||
var fechaI = document.getElementById('<%= txtFechaI.ClientID %>').value;
|
||||
var fechaF = document.getElementById('<%= txtFechaF.ClientID %>').value;
|
||||
|
||||
// Convertir valores a objetos Date
|
||||
var minDate = new Date(fechaI.split("/").reverse().join("-"));
|
||||
var maxDate = new Date(fechaF.split("/").reverse().join("-"));
|
||||
|
||||
|
||||
var xAxis = chart.xAxes.push(
|
||||
am5xy.DateAxis.new(root, {
|
||||
baseInterval: { timeUnit: "day", count: 1 },
|
||||
renderer: am5xy.AxisRendererX.new(root, {
|
||||
opposite: true,
|
||||
minorGridEnabled: true,
|
||||
minGridDistance: 30 // Ajusta según sea necesario
|
||||
}),
|
||||
min: minDate.getTime(),
|
||||
max: maxDate.getTime(),
|
||||
groupData: false,
|
||||
markUnitChange: false
|
||||
})
|
||||
);
|
||||
|
||||
// Asegurar que todas las etiquetas se muestren
|
||||
xAxis.get("renderer").labels.template.setAll({
|
||||
forceHidden: false,
|
||||
minPosition: 0.001,
|
||||
maxPosition: 0.999,
|
||||
location: 0.5 // Centra las etiquetas
|
||||
});
|
||||
|
||||
|
||||
// Formatear las etiquetas de fecha
|
||||
xAxis.get("renderer").labels.template.adapters.add("text", function (text, target) {
|
||||
var dataItem = target.dataItem;
|
||||
if (dataItem) {
|
||||
var value = dataItem.get('value');
|
||||
var date = new Date(value);
|
||||
var day = date.getDate().toString().padStart(2, '0');
|
||||
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
return day + '/' + month;
|
||||
} else {
|
||||
return text; // O puedes devolver una cadena vacía: return '';
|
||||
}
|
||||
});
|
||||
|
||||
//chart.topAxesContainer.children.push(dateAxis);
|
||||
|
||||
// Add series
|
||||
// https://www.amcharts.com/docs/v5/charts/xy-chart/series/
|
||||
var series = chart.series.push(am5xy.ColumnSeries.new(root, {
|
||||
xAxis: xAxis,
|
||||
yAxis: yAxis,
|
||||
openValueXField: "fromDate",
|
||||
valueXField: "toDate",
|
||||
categoryYField: "category",
|
||||
sequencedInterpolation: true
|
||||
}));
|
||||
|
||||
|
||||
series.columns.template.setAll({
|
||||
templateField: "columnSettings",
|
||||
strokeOpacity: 0,
|
||||
tooltipText: "UNIDAD: {category}-{unidad} \nCONTRATO: {contrato} \nDURACIÓN: {openValueX} - {valueX}"
|
||||
});
|
||||
|
||||
series.data.processor = am5.DataProcessor.new(root, {
|
||||
dateFields: ["fromDate", "toDate"],
|
||||
dateFormat: "yyyy-MM-dd HH:mm"
|
||||
});
|
||||
series.data.setAll(data);
|
||||
|
||||
|
||||
// Scrollbar X
|
||||
var scrollbarX = am5.Scrollbar.new(root, {
|
||||
orientation: "horizontal"
|
||||
});
|
||||
|
||||
var scrollbarY = am5.Scrollbar.new(root, {
|
||||
orientation: "vertical"
|
||||
});
|
||||
|
||||
chart.set("scrollbarX", scrollbarX);
|
||||
chart.bottomAxesContainer.children.push(scrollbarX);
|
||||
|
||||
chart.set("scrollbarY", scrollbarY);
|
||||
|
||||
|
||||
//MOSTRAR MODAL DE CONTRATO AL HACER CLICK
|
||||
series.columns.template.events.on("click", e => {
|
||||
let cveContrato = e.target.dataItem.dataContext.cveContrato;
|
||||
|
||||
$('#<%=HdnCveContrato.ClientID%>').val(cveContrato);
|
||||
|
||||
let url = '/Ashx/CargaEventos.ashx?METODO=contrato_transportes';
|
||||
let parametros = '&cveContrato=' + cveContrato + '&U=' + '<%= UsuarioActual.CveUsuario %>' + '&E=' + '<%= UsuarioActual.CveEmpresa %>' + '&tipoVista=' + '<%= RBTipoVista.Text %>' + '&CveUsuarioPara:' + $('#DdlTecnico').val(); + '&CveSubProyecto:' + $('#DdlSubProyecto').val();
|
||||
|
||||
fetch(url + parametros).then(response => response.json()).then(json => {
|
||||
updateEvent(json[0], null, false);
|
||||
}).catch(err => console.log('Solicitud fallida', err));
|
||||
});
|
||||
|
||||
series.events.on("datavalidated", function (ev) {
|
||||
let cellSize = 45;
|
||||
|
||||
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
|
||||
let chartHeight = categorias.length * cellSize + xAxis.height() + chart.get("paddingTop", 0) + chart.get("paddingBottom", 0);
|
||||
|
||||
// Set it on chart's container
|
||||
chart.root.dom.style.height = chartHeight + "px";
|
||||
|
||||
// ev.target.get("xAxis").zoomToValues(new Date(2024,6,15).getTime(), new Date(2024,6,20).getTime());
|
||||
});
|
||||
|
||||
// Make stuff animate on load
|
||||
// https://www.amcharts.com/docs/v5/concepts/animations/
|
||||
series.appear();
|
||||
chart.appear(1000, 100);
|
||||
|
||||
|
||||
}); // end am5.ready()
|
||||
}--%>
|
||||
|
||||
|
||||
|
||||
var PrimeraCargaCalendario = true;
|
||||
@@ -1459,73 +1263,10 @@
|
||||
|
||||
function updateEvent(event, element, esCalendario = true) {
|
||||
|
||||
$('#<%=TxtCantidadPasajeros.ClientID%>').val(event.CantidadPasajeros);
|
||||
$('#<%=TxtFolio.ClientID%>').val(event.NumeroContrato);
|
||||
$('#<%=TxtObservaciones.ClientID%>').val(event.Observaciones);
|
||||
$('#<%=TxtDescripcion.ClientID%>').val(event.description);
|
||||
$('#<%=TxtUbicacion.ClientID%>').val(event.NombreAcercamiento);
|
||||
|
||||
if (esCalendario) {
|
||||
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start._i));
|
||||
} else {
|
||||
$('#<%=TxtFechaSalida.ClientID%>').val(formatearFechaISO(event.start));
|
||||
}
|
||||
$('#<%=TxtFechaRegreso.ClientID%>').val(formatearFechaISO(event.FechaFinal));
|
||||
$('#<%=DdlClientes.ClientID%>').val(event.CveCliente);
|
||||
|
||||
$('#<%=DdlChofer.ClientID%>').val(event.CvePersonal);
|
||||
|
||||
if (event.CvePersonal2 > 0) {
|
||||
$('#<%=chkSegundoChofer.ClientID%>').prop('checked', true);
|
||||
setTimeout(function () { $('#<%=DdlChofer2.ClientID%>').val(event.CvePersonal2).change(); }, 500);;
|
||||
;
|
||||
} else {
|
||||
$('#<%=chkSegundoChofer.ClientID%>').prop('checked', false);
|
||||
$('#<%=DdlChofer2.ClientID%>').val(-1);
|
||||
}
|
||||
|
||||
$('#<%=DdlEstatusContrato.ClientID%>').val(event.CveEventoEstatus);
|
||||
$('#<%=TxtDolares.ClientID%>').val(event.Dolares);
|
||||
$('#<%=TxtPesos.ClientID%>').val(event.Pesos);
|
||||
$('#<%=TxtMoneda.ClientID%>').val(event.Moneda);
|
||||
|
||||
|
||||
|
||||
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
|
||||
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
|
||||
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
|
||||
$('#<%=DdlSubProyectoModal.ClientID%>').val(event.CveSubProyecto);
|
||||
|
||||
$('#<%= HidCveTipoAF.ClientID%>').val($('#<%=TxtAnticipo.ClientID%>').val());
|
||||
|
||||
<%--$('#<%=BtnDdlTipoAF.ClientID%>').click();--%>
|
||||
<%--$('#<%=DdlAF.ClientID%>').val(event.CveActivoFijo);--%>
|
||||
|
||||
$('#HidNumChoferes').val(event.NumChoferes);
|
||||
|
||||
$('#HidRemisionSerieFolio').val(event.RemisionSerieFolio);
|
||||
$('#HidCveVentaRemision').val(event.CveVentaRemision);
|
||||
$('#HidRemisionSaldo').val(event.RemisionSaldo);
|
||||
$('#HdnNumContrato').val(event.NumeroContrato);
|
||||
|
||||
if (event.CveActivoFijo > 0) {
|
||||
$('#HidCveAF').val(event.CveActivoFijo);
|
||||
} else {
|
||||
$('#HidCveAF').val('-1');
|
||||
}
|
||||
|
||||
|
||||
if (event.NombreComercial !== null) {
|
||||
$('#HidModClienteNombre').val('');
|
||||
} else {
|
||||
$('#HidModClienteNombre').val(event.NombreComercial);
|
||||
}
|
||||
|
||||
$('#HidModCveCliente').val(event.CveCliente);
|
||||
|
||||
$('#<%=HdnCveContrato.ClientID%>').click();
|
||||
|
||||
$('#<%=BtnModal.ClientID%>').click();
|
||||
$('#BtnCargaContratoCalendario').click();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,8 @@ Partial Class RepContratosCalendario
|
||||
strData.AppendLine($"color: am4core.color('" & String.Format("#{0:X6}", random.Next(16777216)) & "'),")
|
||||
strData.AppendLine($"cveContrato: {Row("CveContrato").ToString.ToEntero},")
|
||||
strData.AppendLine($"contrato: '{Row("NumeroContrato").ToString}',")
|
||||
strData.AppendLine($"fechaFinalViaje: '{FF.ToString("yyyy-MM-dd HH:mm:ss")}'")
|
||||
strData.AppendLine($"fechaFinalViaje: '{FF.ToString("yyyy-MM-dd HH:mm:ss")}',")
|
||||
strData.AppendLine($"cliente: '{Row("NombreComercial").ToString.Replace("'", "")}'")
|
||||
strData.AppendLine("},")
|
||||
|
||||
|
||||
@@ -564,6 +565,82 @@ Partial Class RepContratosCalendario
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCargaContratoCalendario_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim CveContratoConsulta As Integer = HdnCveContrato.Value.ToEntero
|
||||
|
||||
If CveContratoConsulta > 0 Then
|
||||
Dim Objcontrato As New ClsContratos
|
||||
If Objcontrato.GetContratos(CveContratoConsulta, UsuarioActual.CveEmpresa) AndAlso Objcontrato.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Dim DRow As DataRow
|
||||
DRow = Objcontrato.DtResultados.Rows(0)
|
||||
'Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
Dim NumChoferes As Integer = DRow("NumChoferes").ToString.ToEntero
|
||||
|
||||
TxtFolio.Text = DRow("NumeroContrato").ToString
|
||||
TxtCantidadPasajeros.Text = DRow("CantidadPasajeros").ToString
|
||||
DdlClientes.SelectedValue = DRow("CveCliente").ToString
|
||||
DdlClientes.SelectedText = DRow("NombreComercial").ToString
|
||||
TxtDescripcion.Text = DRow("DescripcionContrato").ToString
|
||||
TxtObservaciones.Text = DRow("Observaciones").ToString
|
||||
TxtUbicacion.Text = DRow("Ubicacion").ToString
|
||||
TxtFechaSalida.Text = Convert.ToDateTime(DRow("FechaInicial")).ToString("dd/MM/yyyy HH:mm:ss")
|
||||
TxtFechaRegreso.Text = Convert.ToDateTime(DRow("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
|
||||
TxtMoneda.Text = DRow("Moneda").ToString
|
||||
'Requeridos
|
||||
|
||||
DdlChofer.SelectedValueExist(DRow("CveChofer").ToString)
|
||||
DdlChofer2.SelectedValueExist(DRow("CveChofer2").ToString)
|
||||
chkSegundoChofer.Checked = If(NumChoferes = 2, True, False)
|
||||
|
||||
DdlEstatusContrato.SelectedValueExist(DRow("CveContratosEstatus").ToString)
|
||||
DdlSubProyectoModal.SelectedValueExist(DRow("CveSubProyecto").ToString)
|
||||
|
||||
DdlTipoAF.SelectedValueExist(DRow("CveTipoAF").ToString)
|
||||
DdlTipoAF_SelectedIndexChanged(Nothing, Nothing)
|
||||
|
||||
DdlAF.SelectedValueExist(DRow("CveAF").ToString)
|
||||
|
||||
HidCveAF.Value = "-1"
|
||||
HidCveAFDes.Value = ""
|
||||
If DRow("CveAF").ToString.ToEntero > 0 Then
|
||||
HidCveAF.Value = DRow("CveAF").ToString.ToString
|
||||
HidCveAFDes.Value = DdlAF.SelectedItem.Text
|
||||
End If
|
||||
TxtMotivoCambioUnidad.Text = ""
|
||||
DVMotivoCambioAF.Visible = False
|
||||
|
||||
|
||||
HypRemision.Text = DRow("RemisionSerieFolio").ToString
|
||||
HypRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={DRow("CveVentaRemision").ToString}"
|
||||
|
||||
If DRow("RemisionSaldo").ToString.ToDecimal > 0 Then
|
||||
LblSaldo.Text = $"Saldo {DRow("RemisionSaldo").ToString.ToDecimal.ToString("###,###,###.00")}"
|
||||
Else
|
||||
LblSaldo.Text = ""
|
||||
End If
|
||||
|
||||
CveContrato = CveContratoConsulta
|
||||
OcultarMostrarSegundoChofer()
|
||||
|
||||
UpCommando.Update()
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
|
||||
End If
|
||||
Objcontrato.Dispose()
|
||||
Else
|
||||
Alert("Contrato no especificado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -597,11 +674,11 @@ Partial Class RepContratosCalendario
|
||||
End If
|
||||
End If
|
||||
|
||||
If HidCveAF.Value.ToEntero <> DdlAF.SelectedValue.ToEntero Then
|
||||
If Not objGenerales.AddHistorialBitacora(465, -1, -1, -1, -1, -1, -1, -1, DdlAF.SelectedItem.Text, HidCveAFDes.Value, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, TxtMotivoCambioUnidad.Text, "", "", CveContrato:=CveContrato) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
'If HidCveAF.Value.ToEntero <> DdlAF.SelectedValue.ToEntero Then
|
||||
' If Not objGenerales.AddHistorialBitacora(465, -1, -1, -1, -1, -1, -1, -1, DdlAF.SelectedItem.Text, HidCveAFDes.Value, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, TxtMotivoCambioUnidad.Text, "", "", CveContrato:=CveContrato) Then
|
||||
' TieneError = True
|
||||
' 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,
|
||||
-1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34,
|
||||
@@ -718,6 +795,7 @@ Partial Class RepContratosCalendario
|
||||
UpModal.Update()
|
||||
myModalLabel.InnerText = "Contrato: " & HdnNumContrato.Value
|
||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub chkSegundoChofer_CheckedChanged(sender As Object, e As EventArgs)
|
||||
@@ -857,4 +935,6 @@ Partial Class RepContratosCalendario
|
||||
CargaCronograma(DdlTipoVistaCalendario.SelectedValue.ToEntero)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user