VyA - calendario pierde las fechas, la regresa al mes actual al hacer postback
This commit is contained in:
@@ -926,7 +926,7 @@ Partial Class OC_OC
|
||||
ChkEntregaDirecta.Checked = False
|
||||
End If
|
||||
|
||||
If CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then
|
||||
If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
|
||||
Alert("PrePoliza de Presupuesto Generada Correctamente")
|
||||
Else
|
||||
@@ -3522,7 +3522,7 @@ Partial Class OC_OC
|
||||
End If
|
||||
|
||||
|
||||
If Not HuboError AndAlso UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 73) Then
|
||||
|
||||
If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then
|
||||
HuboError = True
|
||||
@@ -9161,7 +9161,7 @@ Partial Class OC_OC
|
||||
|
||||
Dim Respuesta As Boolean = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(13, 73) Then
|
||||
|
||||
Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||
Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal)
|
||||
@@ -9204,7 +9204,7 @@ Partial Class OC_OC
|
||||
|
||||
Dim Importe As Decimal = item.TotalSum
|
||||
Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, item.TotalSum)
|
||||
Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, 1, item.TotalSum * TC)
|
||||
Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC)
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then
|
||||
Respuesta = False
|
||||
|
||||
@@ -500,6 +500,9 @@
|
||||
</div>
|
||||
<asp:HiddenField runat="server" ID="HidModClienteNombre" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="HidModCveCliente" ClientIDMode="Static" />
|
||||
|
||||
<asp:HiddenField runat="server" ID="HidCurrentMonth" ClientIDMode="Static" Value="-1" />
|
||||
<asp:HiddenField runat="server" ID="HidCurrentYear" ClientIDMode="Static" Value="-1" />
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||
@@ -688,8 +691,14 @@
|
||||
var date = null;
|
||||
|
||||
function InitCalendar() {
|
||||
$(document).ready(function () {
|
||||
Calendario();
|
||||
$(document).ready(function () {
|
||||
|
||||
let mes = parseInt($('#<%=HidCurrentMonth.ClientID%>').val());
|
||||
let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
|
||||
|
||||
|
||||
Calendario(mes,anio);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -799,7 +808,20 @@
|
||||
updateEventOnDropResize(event);
|
||||
}
|
||||
|
||||
function Calendario() {
|
||||
function Calendario(mes = -1, anio = -1) {
|
||||
|
||||
|
||||
let fechaActual = new Date();
|
||||
if (mes === -1) {
|
||||
mes = fechaActual.getMonth() + 1;
|
||||
}
|
||||
if (anio === -1) {
|
||||
anio = fechaActual.getFullYear();
|
||||
}
|
||||
|
||||
|
||||
let mesFormateado = ('0' + mes).slice(-2);
|
||||
let fechaInicio = `${anio}-${mesFormateado}-01`;
|
||||
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
@@ -807,6 +829,7 @@
|
||||
var y = date.getFullYear();
|
||||
var h = {};
|
||||
|
||||
//alert(fechaInicio);
|
||||
if ($('#calendar').width() <= 400) {
|
||||
$('#calendar').addClass("mobile");
|
||||
h = {
|
||||
@@ -826,6 +849,7 @@
|
||||
|
||||
$('#calendar').fullCalendar('destroy');
|
||||
$('#calendar').fullCalendar({
|
||||
defaultDate: fechaInicio,
|
||||
header: h,
|
||||
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
|
||||
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
|
||||
@@ -857,10 +881,39 @@
|
||||
}
|
||||
},
|
||||
eventDrop: eventDropped,
|
||||
eventResize: eventResized
|
||||
eventResize: eventResized,
|
||||
viewRender: function(view, element) {
|
||||
|
||||
let pointDate = view.intervalStart;
|
||||
let currentMonth = pointDate.month() + 1;
|
||||
let currentYear = pointDate.year();
|
||||
|
||||
$('#<%=HidCurrentMonth.ClientID%>').val(currentMonth);
|
||||
$('#<%=HidCurrentYear.ClientID%>').val(currentYear);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function obtenerFechaInicio(mes = -1, anio = -1) {
|
||||
let fechaActual = new Date();
|
||||
|
||||
if (mes === -1) {
|
||||
mes = fechaActual.getMonth() + 1; // getMonth() es base 0, así que se suma 1
|
||||
}
|
||||
if (anio === -1) {
|
||||
anio = fechaActual.getFullYear();
|
||||
}
|
||||
|
||||
|
||||
let mesFormateado = ('0' + mes).slice(-2);
|
||||
|
||||
|
||||
let fechaInicio = `${anio}-${mesFormateado}-01`;
|
||||
|
||||
return fechaInicio;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -107,7 +107,8 @@ Partial Class RepContratosCalendario
|
||||
UPPGantt.Update()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub InicializaCalendar()
|
||||
Private Sub InicializaCalendar()
|
||||
|
||||
RegistraScript("InitCalendar();")
|
||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||
End Sub
|
||||
@@ -200,11 +201,12 @@ Partial Class RepContratosCalendario
|
||||
Alert("Actualizado Correctamente.")
|
||||
Else
|
||||
ObjContratos.RollBack()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjContratos.Dispose()
|
||||
UpTitulos.Update()
|
||||
CargaDatos()
|
||||
InicializaCalendar()
|
||||
End Sub
|
||||
Protected Sub UpdateModal(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
|
||||
Reference in New Issue
Block a user