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
|
ChkEntregaDirecta.Checked = False
|
||||||
End If
|
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
|
If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
|
||||||
Alert("PrePoliza de Presupuesto Generada Correctamente")
|
Alert("PrePoliza de Presupuesto Generada Correctamente")
|
||||||
Else
|
Else
|
||||||
@@ -3522,7 +3522,7 @@ Partial Class OC_OC
|
|||||||
End If
|
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
|
If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then
|
||||||
HuboError = True
|
HuboError = True
|
||||||
@@ -9161,7 +9161,7 @@ Partial Class OC_OC
|
|||||||
|
|
||||||
Dim Respuesta As Boolean = True
|
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 CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||||
Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal)
|
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 Importe As Decimal = item.TotalSum
|
||||||
Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, 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
|
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
|
Respuesta = False
|
||||||
|
|||||||
@@ -500,6 +500,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<asp:HiddenField runat="server" ID="HidModClienteNombre" ClientIDMode="Static" />
|
<asp:HiddenField runat="server" ID="HidModClienteNombre" ClientIDMode="Static" />
|
||||||
<asp:HiddenField runat="server" ID="HidModCveCliente" 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>
|
||||||
|
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||||
@@ -689,7 +692,13 @@
|
|||||||
|
|
||||||
function InitCalendar() {
|
function InitCalendar() {
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
Calendario();
|
|
||||||
|
let mes = parseInt($('#<%=HidCurrentMonth.ClientID%>').val());
|
||||||
|
let anio = parseInt($('#<%=HidCurrentYear.ClientID%>').val());
|
||||||
|
|
||||||
|
|
||||||
|
Calendario(mes,anio);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,7 +808,20 @@
|
|||||||
updateEventOnDropResize(event);
|
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 date = new Date();
|
||||||
var d = date.getDate();
|
var d = date.getDate();
|
||||||
@@ -807,6 +829,7 @@
|
|||||||
var y = date.getFullYear();
|
var y = date.getFullYear();
|
||||||
var h = {};
|
var h = {};
|
||||||
|
|
||||||
|
//alert(fechaInicio);
|
||||||
if ($('#calendar').width() <= 400) {
|
if ($('#calendar').width() <= 400) {
|
||||||
$('#calendar').addClass("mobile");
|
$('#calendar').addClass("mobile");
|
||||||
h = {
|
h = {
|
||||||
@@ -826,6 +849,7 @@
|
|||||||
|
|
||||||
$('#calendar').fullCalendar('destroy');
|
$('#calendar').fullCalendar('destroy');
|
||||||
$('#calendar').fullCalendar({
|
$('#calendar').fullCalendar({
|
||||||
|
defaultDate: fechaInicio,
|
||||||
header: h,
|
header: h,
|
||||||
monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
|
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'],
|
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
|
||||||
@@ -857,10 +881,39 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
eventDrop: eventDropped,
|
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>
|
</script>
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ Partial Class RepContratosCalendario
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub InicializaCalendar()
|
Private Sub InicializaCalendar()
|
||||||
|
|
||||||
RegistraScript("InitCalendar();")
|
RegistraScript("InitCalendar();")
|
||||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||||
End Sub
|
End Sub
|
||||||
@@ -205,6 +206,7 @@ Partial Class RepContratosCalendario
|
|||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
UpTitulos.Update()
|
UpTitulos.Update()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
|
InicializaCalendar()
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user