", NowADS().ToLongDateString)
GvE.CaptionAlign = TableCaptionAlign.Left
GvE.DataSource = dt
GvE.DataBind()
diff --git a/AIMMGM/PopRegistro.aspx.vb b/AIMMGM/PopRegistro.aspx.vb
index 6e590e2cf..34d29a09b 100644
--- a/AIMMGM/PopRegistro.aspx.vb
+++ b/AIMMGM/PopRegistro.aspx.vb
@@ -72,7 +72,7 @@ Partial Class AIMMGM_Registro
For Each dr As DataRow In dtExcursiones.Rows
Dim AIM As New ClsAIMMGM
- If AIM.RepVentasPS(1, -1, -1, -1, "01/01/2014".ToDate, Now, 43) Then
+ If AIM.RepVentasPS(1, -1, -1, -1, "01/01/2014".ToDate, NowADS(), 43) Then
Contador = AIM.DtResultados.COUNT("CvePS", "CvePS = " & dr("CvePS").ToString)
If Contador >= 20 Then
dr("CvePS") = 0
@@ -299,7 +299,7 @@ Partial Class AIMMGM_Registro
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler IsNot Nothing Then
Dim Img, Botones As String
Dim Titulo As String
- Dim Plus As String = DateTime.Now.Ticks.ToString
+ Dim Plus As String = NowADS().Ticks.ToString
Mensaje = Mensaje.Replace("'"c, "\'")
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
@@ -335,8 +335,8 @@ Partial Class AIMMGM_Registro
Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.Handler, Page)
- 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
- ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
+ 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
+ ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
Pag = Nothing
Catch ex As Exception
@@ -420,7 +420,7 @@ Partial Class AIMMGM_Registro
Dim tnombre As String
Dim TieneExcursion As Boolean = False
'DdlFiscalMetodoPago.SelectedValue.ToEntero1,
- If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, CveMetodoPago, 0, 0, Now, "", "", 0, Now, -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 1, 0, 2069, 43) Then
+ If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, CveMetodoPago, 0, 0, NowADS(), "", "", 0, NowADS(), -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 1, 0, 2069, 43) Then
Dim CveVenta As Integer = Venta.CveVenta
For Each dr As DataRow In TmpDT.Rows
Dim CveUnidadMedida As Integer
@@ -555,7 +555,7 @@ Partial Class AIMMGM_Registro
Dim Liga As String = "http://aimmgm.adsistemas.mx/AIMMGM/Portal.aspx"
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & CveCliente & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & CveCliente & "&Opcion=Activar&Hora=" & NowADS().Ticks)
Dim strSQL As New StringBuilder
strSQL.Append(" ")
diff --git a/AIMMGM/Registro.aspx.vb b/AIMMGM/Registro.aspx.vb
index f103fa711..1783c2cbe 100644
--- a/AIMMGM/Registro.aspx.vb
+++ b/AIMMGM/Registro.aspx.vb
@@ -96,7 +96,7 @@ Partial Class AIMMGM_Registro
For Each dr As DataRow In dtExcursiones.Rows
Dim AIM As New ClsAIMMGM
- If AIM.RepVentasPS(1, -1, -1, -1, "01/01/2014".ToDate, Now, 43) Then
+ If AIM.RepVentasPS(1, -1, -1, -1, "01/01/2014".ToDate, NowADS(), 43) Then
Contador = AIM.DtResultados.COUNT("CvePS", "CvePS = " & dr("CvePS").ToString)
If Contador >= 20 Then
dr("CvePS") = 0
@@ -387,7 +387,7 @@ Partial Class AIMMGM_Registro
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler IsNot Nothing Then
Dim Img, Botones As String
Dim Titulo As String
- Dim Plus As String = DateTime.Now.Ticks.ToString
+ Dim Plus As String = NowADS().Ticks.ToString
Mensaje = Mensaje.Replace("'"c, "\'")
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
@@ -423,8 +423,8 @@ Partial Class AIMMGM_Registro
Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.Handler, Page)
- 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
- ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
+ 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
+ ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
Pag = Nothing
Catch ex As Exception
@@ -597,7 +597,7 @@ Partial Class AIMMGM_Registro
Dim tnombre As String
Dim TieneExcursion As Boolean = False
- If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, DdlFiscalMetodoPago.SelectedValue.ToEntero, 0, 0, Now, "", "", 0, Now, -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 0, 1, 2069, 43) Then
+ If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, DdlFiscalMetodoPago.SelectedValue.ToEntero, 0, 0, NowADS(), "", "", 0, NowADS(), -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 0, 1, 2069, 43) Then
Dim CveVenta As Integer = Venta.CveVenta
For Each dr As DataRow In TmpDT.Rows
Dim CveUnidadMedida As Integer
@@ -715,7 +715,7 @@ Partial Class AIMMGM_Registro
Dim tnombre As String
Dim TieneExcursion As Boolean = False
- If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, DdlFiscalMetodoPago.SelectedValue.ToEntero, 0, 0, Now, "", "", 0, Now, -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 1, 0, 2069, 43) Then
+ If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, DdlFiscalMetodoPago.SelectedValue.ToEntero, 0, 0, NowADS(), "", "", 0, NowADS(), -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 1, 0, 2069, 43) Then
Dim CveVenta As Integer = Venta.CveVenta
For Each dr As DataRow In TmpDT.Rows
Dim CveUnidadMedida As Integer
@@ -745,7 +745,7 @@ Partial Class AIMMGM_Registro
If Not Errorr Then
- If AIM.AddPago(CveCliente, Venta.CveVentaDetalle, dr("Total").ToString.ToDouble, 1, Now, "", "Pago en terminal", TxtNumeroAsesor.Text.Trim.ToEntero, TxtNumeroAprobacion.Text.Trim.ToEntero) <= 0 Then
+ If AIM.AddPago(CveCliente, Venta.CveVentaDetalle, dr("Total").ToString.ToDouble, 1, NowADS(), "", "Pago en terminal", TxtNumeroAsesor.Text.Trim.ToEntero, TxtNumeroAprobacion.Text.Trim.ToEntero) <= 0 Then
Errorr = True
End If
@@ -853,7 +853,7 @@ Partial Class AIMMGM_Registro
Dim Liga As String = "http://aimmgm.adsistemas.mx/AIMMGM/Portal.aspx"
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & CveCliente & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & CveCliente & "&Opcion=Activar&Hora=" & NowADS().Ticks)
Dim strSQL As New StringBuilder
strSQL.Append(" ")
@@ -1062,7 +1062,7 @@ Partial Class AIMMGM_Registro
Cliente.Dispose()
End If
- Dim ClavePago As String = String.Format("{0}-{1}", CveCliente, Now.Ticks)
+ Dim ClavePago As String = String.Format("{0}-{1}", CveCliente, NowADS().Ticks)
'actualizo la clavedel cliente en todos los registros
@@ -1079,8 +1079,8 @@ Partial Class AIMMGM_Registro
myNameValueCollection.Add("ref", CveCliente.ToString)
myNameValueCollection.Add("imp", TmpDT.SUM("Total").ToString) '".01"
myNameValueCollection.Add("ema", TxtEmail.Text.Trim)
- myNameValueCollection.Add("urlOk", String.Format("http://aimmgm.adsistemas.mx/AIMMGM/ePagos.aspx?p={0}", Encripta(String.Format("Cve={0}&F={1}&CveCliente={2}&P=1", ClavePago, Now, CveCliente))))
- myNameValueCollection.Add("urlKo", String.Format("http://aimmgm.adsistemas.mx/AIMMGM/ePagos.aspx?p={0}", Encripta(String.Format("Cve={0}&F={1}&CveCliente={2}&NP=1", ClavePago, Now, CveCliente))))
+ myNameValueCollection.Add("urlOk", String.Format("http://aimmgm.adsistemas.mx/AIMMGM/ePagos.aspx?p={0}", Encripta(String.Format("Cve={0}&F={1}&CveCliente={2}&P=1", ClavePago, NowADS(), CveCliente))))
+ myNameValueCollection.Add("urlKo", String.Format("http://aimmgm.adsistemas.mx/AIMMGM/ePagos.aspx?p={0}", Encripta(String.Format("Cve={0}&F={1}&CveCliente={2}&NP=1", ClavePago, NowADS(), CveCliente))))
myNameValueCollection.Add("autoBack", "1")
myNameValueCollection.Add("datbloq", "1")
@@ -1096,8 +1096,8 @@ Partial Class AIMMGM_Registro
'If Request.Form("__VIEWSTATE_KEY") IsNot Nothing Then Cache.Remove(Request.Form("__VIEWSTATE_KEY")) 'elimino la cachado anteriormente
- Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, Date.Now.Ticks)
- Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache
+ Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, NowADS().Ticks)
+ Cache.Add(VSKey, pviewState, Nothing, NowADS().AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache
ClientScript.RegisterHiddenField("__VIEWSTATE_KEY", VSKey)
End Sub
diff --git a/AIMMGM/VentasPS.aspx.vb b/AIMMGM/VentasPS.aspx.vb
index 7211c69b9..125350b66 100644
--- a/AIMMGM/VentasPS.aspx.vb
+++ b/AIMMGM/VentasPS.aspx.vb
@@ -10,8 +10,8 @@ Partial Class AIMMGM_Ventas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaI.Text = "01/01/" & Now.Year
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = "01/01/" & NowADS().Year
+ txtFechaF.Text = NowADS().ToShortDateString
Dim dt As DataTable
diff --git a/AIMMGM/ePagos.aspx.vb b/AIMMGM/ePagos.aspx.vb
index 1e498a877..31874f43c 100644
--- a/AIMMGM/ePagos.aspx.vb
+++ b/AIMMGM/ePagos.aspx.vb
@@ -64,7 +64,7 @@ Partial Class AIMMGM_ePagos
Dim Fecha As String = ClsPaginas.UrlParametros("F").ToString
- If Fecha.ToDate > Now.AddHours(-1) AndAlso ClsPaginas.UrlParametros("P") IsNot Nothing AndAlso ClsPaginas.UrlParametros("P").ToString = "1" Then
+ If Fecha.ToDate > NowADS().AddHours(-1) AndAlso ClsPaginas.UrlParametros("P") IsNot Nothing AndAlso ClsPaginas.UrlParametros("P").ToString = "1" Then
ClavePago = ClsPaginas.UrlParametros("CVE").ToString
CargaCompra()
@@ -124,7 +124,7 @@ Partial Class AIMMGM_ePagos
Dim tnombre As String
Dim TieneExcursion As Boolean = False
- If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, CveMetodoPago, 0, 0, Now, "", "", -1, Now, -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 1, 0, 2069, 43) Then
+ If Venta.AddVenta("Rem", 0, CveCliente, 2069, TmpDT.SUM("Total"), 0, 0, 0, 0, 0, TmpDT.SUM("Total"), 1, 0, CveMetodoPago, 0, 0, NowADS(), "", "", -1, NowADS(), -1, -1, "", "", "", 0, 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 1, 0, 2069, 43) Then
Dim CveVenta As Integer = Venta.CveVenta
For Each dr As DataRow In TmpDT.Rows
Dim CveUnidadMedida As Integer
@@ -154,7 +154,7 @@ Partial Class AIMMGM_ePagos
Next
If Not Errorr Then
- If AIM.AddPago(CveCliente, -1, TmpDT.SUM("Total"), 1, Now, "", "Pago en línea", 0, 0) <= 0 Then
+ If AIM.AddPago(CveCliente, -1, TmpDT.SUM("Total"), 1, NowADS(), "", "Pago en línea", 0, 0) <= 0 Then
Errorr = True
End If
If Not Errorr Then
@@ -199,7 +199,7 @@ Partial Class AIMMGM_ePagos
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler IsNot Nothing Then
Dim Img, Botones As String
Dim Titulo As String
- Dim Plus As String = DateTime.Now.Ticks.ToString
+ Dim Plus As String = NowADS().Ticks.ToString
Mensaje = Mensaje.Replace("'"c, "\'")
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
@@ -235,8 +235,8 @@ Partial Class AIMMGM_ePagos
Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.Handler, Page)
- 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
- ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
+ 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
+ ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
Pag = Nothing
Catch ex As Exception
@@ -312,7 +312,7 @@ Partial Class AIMMGM_ePagos
Dim Liga As String = "http://aimmgm.adsistemas.mx/AIMMGM/Portal.aspx"
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & CveCliente & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & CveCliente & "&Opcion=Activar&Hora=" & NowADS().Ticks)
Dim strSQL As New StringBuilder
strSQL.Append(" ")
diff --git a/Acarreos/AcarreosConcluidos.aspx.vb b/Acarreos/AcarreosConcluidos.aspx.vb
index 90a0d30f7..0770ad579 100644
--- a/Acarreos/AcarreosConcluidos.aspx.vb
+++ b/Acarreos/AcarreosConcluidos.aspx.vb
@@ -13,8 +13,8 @@ Partial Class Acarreos_AcarreosAutoConciliacion
CargaDdlTransportista()
CargaDdlMaterial()
CargaDdlNumContrato()
- txtFechaF.Text = Now.AddDays(0).ToShortDateString
- txtFechaI.Text = Now.AddYears(-1).ToShortDateString
+ txtFechaF.Text = NowADS().AddDays(0).ToShortDateString
+ txtFechaI.Text = NowADS().AddYears(-1).ToShortDateString
BtnAgregarAcarreoConcluido.Text = "Vincular"
End If
End Sub
diff --git a/Acarreos/AcarreosPreEstimacion.aspx.vb b/Acarreos/AcarreosPreEstimacion.aspx.vb
index 6e76fc51e..8c9f9be4b 100644
--- a/Acarreos/AcarreosPreEstimacion.aspx.vb
+++ b/Acarreos/AcarreosPreEstimacion.aspx.vb
@@ -14,7 +14,7 @@ Partial Class Acarreos_AcarreosPreEstimacion
DdlTransportista.DataBind()
DdlMaterial.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlMaterial.DataBind()
- TxtFechaPreEstimacion.Text = Now.AddDays(0).ToShortDateString
+ TxtFechaPreEstimacion.Text = NowADS().AddDays(0).ToShortDateString
BtnAgregarPreEstimacion.Text = "Pre-Estimar"
CargaDdlNumContrato()
End If
@@ -65,7 +65,7 @@ Partial Class Acarreos_AcarreosPreEstimacion
DdlMaterial.DataBind()
CargaDdlNumContrato()
TxtNumPreEstimacion.Text = ""
- TxtFechaPreEstimacion.Text = Now.AddDays(0).ToShortDateString
+ TxtFechaPreEstimacion.Text = NowADS().AddDays(0).ToShortDateString
GvPreEstimacion.DataSource = Nothing
GvPreEstimacion.DataBind()
Else
diff --git a/Acarreos/RegistroAcarreo.aspx.vb b/Acarreos/RegistroAcarreo.aspx.vb
index ec3533883..d3a4f625c 100644
--- a/Acarreos/RegistroAcarreo.aspx.vb
+++ b/Acarreos/RegistroAcarreo.aspx.vb
@@ -145,7 +145,7 @@ Partial Class Acarreos_EditarAcarreo
DdlChofer.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlMaterial.Items.Insert(0, New ListItem("Seleccione", "-1"))
CargaDdlNumContrato()
- TxtFecha.Text = Now.AddDays(0).ToShortDateString
+ TxtFecha.Text = NowADS().AddDays(0).ToShortDateString
CargaDatos()
divEstatus.Visible = False
SetPermisos()
@@ -325,7 +325,7 @@ Partial Class Acarreos_EditarAcarreo
DdlTransportista.Items.Clear()
RBDestino.Checked = False
RBOrigen.Checked = False
- TxtFecha.Text = Now.AddDays(0).ToShortDateString
+ TxtFecha.Text = NowADS().AddDays(0).ToShortDateString
DdlNumContrato.SelectedIndex = -1
DdlTransportista.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlUnidad.Items.Insert(0, New ListItem("Seleccione", "-1"))
diff --git a/Acarreos/RegistroContratosAcarreos.aspx.vb b/Acarreos/RegistroContratosAcarreos.aspx.vb
index 8f4149a4e..661f28235 100644
--- a/Acarreos/RegistroContratosAcarreos.aspx.vb
+++ b/Acarreos/RegistroContratosAcarreos.aspx.vb
@@ -74,8 +74,8 @@ Partial Class Acarreos_ContratosAcarreos
CargaDdlUnidadMedida()
CreaTmpTarifas()
CreaTmpMaterialVolumen()
- TxtFechaInicio.Text = Now.AddDays(0).ToShortDateString
- TxtFechaFin.Text = Now.AddDays(0).ToShortDateString
+ TxtFechaInicio.Text = NowADS().AddDays(0).ToShortDateString
+ TxtFechaFin.Text = NowADS().AddDays(0).ToShortDateString
CargaDatos()
End If
End Sub
@@ -303,8 +303,8 @@ Partial Class Acarreos_ContratosAcarreos
TxtVolumenTipo.Text = ""
TxtDescripcion.Text = ""
TxtNumContrato.Text = ""
- TxtFechaInicio.Text = Now.AddDays(0).ToShortDateString
- TxtFechaFin.Text = Now.AddDays(0).ToShortDateString
+ TxtFechaInicio.Text = NowADS().AddDays(0).ToShortDateString
+ TxtFechaFin.Text = NowADS().AddDays(0).ToShortDateString
DTTarifa.Rows.Clear()
DTMaterialVolumen.Rows.Clear()
GvTarifa.DataSource = Nothing
diff --git a/Acarreos/RepAcarreos.aspx.vb b/Acarreos/RepAcarreos.aspx.vb
index c530964bc..0e43a11d2 100644
--- a/Acarreos/RepAcarreos.aspx.vb
+++ b/Acarreos/RepAcarreos.aspx.vb
@@ -22,8 +22,8 @@ Partial Class Acarreos_RepAcarreos
CargaDdlTransportista()
CargaDdlMaterial()
CargaDdlNumContrato()
- txtFechaF.Text = Now.AddDays(0).ToShortDateString
- txtFechaI.Text = Now.AddYears(-1).ToShortDateString
+ txtFechaF.Text = NowADS().AddDays(0).ToShortDateString
+ txtFechaI.Text = NowADS().AddYears(-1).ToShortDateString
End If
End Sub
diff --git a/Acarreos/RepAcarreosDetalle.aspx.vb b/Acarreos/RepAcarreosDetalle.aspx.vb
index b39288317..c62913d3e 100644
--- a/Acarreos/RepAcarreosDetalle.aspx.vb
+++ b/Acarreos/RepAcarreosDetalle.aspx.vb
@@ -24,8 +24,8 @@ Partial Class Acarreos_RepAcarreosDetalle
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaF.Text = Now.AddDays(0).ToShortDateString
- txtFechaI.Text = Now.AddYears(-1).ToShortDateString
+ txtFechaF.Text = NowADS().AddDays(0).ToShortDateString
+ txtFechaI.Text = NowADS().AddYears(-1).ToShortDateString
CargaDdlChofer()
CargaDdlSubProyectoOrigen()
CargaDdlSubProyectoDestino()
diff --git a/Acarreos/RepContratosAcarreos.aspx.vb b/Acarreos/RepContratosAcarreos.aspx.vb
index 62f3b8812..6adf28707 100644
--- a/Acarreos/RepContratosAcarreos.aspx.vb
+++ b/Acarreos/RepContratosAcarreos.aspx.vb
@@ -27,8 +27,8 @@ Partial Class Acarreos_RepContratosAcarreos
CargaDdlSubProyectoOrigen()
CargaDdlTransportista()
CargaDdlProveedor()
- txtFechaF.Text = Now.AddDays(0).ToShortDateString
- txtFechaI.Text = Now.AddYears(-1).ToShortDateString
+ txtFechaF.Text = NowADS().AddDays(0).ToShortDateString
+ txtFechaI.Text = NowADS().AddYears(-1).ToShortDateString
End If
End Sub
@@ -154,14 +154,14 @@ Partial Class Acarreos_RepContratosAcarreos
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", $"file://{Imagen}"))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
- ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreos.rdlc", DTCont, params, String.Format("RepContratosAcarreos-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreos.rdlc", DTCont, params, String.Format("RepContratosAcarreos-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -182,10 +182,10 @@ Partial Class Acarreos_RepContratosAcarreos
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreos.rdlc", DTCont, params, String.Format("RepContratosAcarreos-{0}", Now.ToDateTime.ToShortDateString), "Excel")
+ ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreos.rdlc", DTCont, params, String.Format("RepContratosAcarreos-{0}", NowADS().ToDateTime.ToShortDateString), "Excel")
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
diff --git a/Acarreos/RepContratosAcarreosDetalle.aspx.vb b/Acarreos/RepContratosAcarreosDetalle.aspx.vb
index 3333d3de7..0c148923e 100644
--- a/Acarreos/RepContratosAcarreosDetalle.aspx.vb
+++ b/Acarreos/RepContratosAcarreosDetalle.aspx.vb
@@ -183,7 +183,7 @@ Partial Class Acarreos_RepContratosAcarreosDetalle
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Contrato", LblContrato.Text))
params.Add(New ReportParameter("FechaInicio", LblFechaInicio.Text))
params.Add(New ReportParameter("FechaFin", LblFechaFin.Text))
@@ -205,7 +205,7 @@ Partial Class Acarreos_RepContratosAcarreosDetalle
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
- ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreosDetalle.rdlc", DTCont, params, String.Format("RepContratosAcarreosDetalle-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreosDetalle.rdlc", DTCont, params, String.Format("RepContratosAcarreosDetalle-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -222,7 +222,7 @@ Partial Class Acarreos_RepContratosAcarreosDetalle
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Contrato", LblContrato.Text))
params.Add(New ReportParameter("FechaInicio", LblFechaInicio.Text))
params.Add(New ReportParameter("FechaFin", LblFechaFin.Text))
@@ -240,7 +240,7 @@ Partial Class Acarreos_RepContratosAcarreosDetalle
params.Add(New ReportParameter("VolF", LblVolFaltante.Text))
params.Add(New ReportParameter("PresF", LblPresFaltante.Text))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreosDetalle.rdlc", DTCont, params, String.Format("RepContratosAcarreosDetalle-{0}", Now.ToDateTime.ToShortDateString), "Excel")
+ ImprimirPDF("Empresas/Grales/Formatos/RepContratosAcarreosDetalle.rdlc", DTCont, params, String.Format("RepContratosAcarreosDetalle-{0}", NowADS().ToDateTime.ToShortDateString), "Excel")
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
diff --git a/Acarreos/RepPreEstimacionDetalle.aspx.vb b/Acarreos/RepPreEstimacionDetalle.aspx.vb
index f89d915fc..119866856 100644
--- a/Acarreos/RepPreEstimacionDetalle.aspx.vb
+++ b/Acarreos/RepPreEstimacionDetalle.aspx.vb
@@ -100,14 +100,14 @@ Partial Class Acarreos_RepPreEstimacionDetalle
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", $"file://{Imagen}"))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
- ImprimirPDF("Empresas/Grales/Formatos/RepPreEstimacionDetalle.rdlc", DTCont, params, String.Format("RepPreEstimacionDetalle-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepPreEstimacionDetalle.rdlc", DTCont, params, String.Format("RepPreEstimacionDetalle-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -133,10 +133,10 @@ Partial Class Acarreos_RepPreEstimacionDetalle
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepPreEstimacionDetalle.rdlc", DTCont, params, String.Format("RepPreEstimacionDetalle-{0}", Now.ToDateTime.ToShortDateString), "Excel")
+ ImprimirPDF("Empresas/Grales/Formatos/RepPreEstimacionDetalle.rdlc", DTCont, params, String.Format("RepPreEstimacionDetalle-{0}", NowADS().ToDateTime.ToShortDateString), "Excel")
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
diff --git a/Acumuladores/EntradasUsadosResumenRep.aspx.vb b/Acumuladores/EntradasUsadosResumenRep.aspx.vb
index ea3a27693..3a33a5241 100644
--- a/Acumuladores/EntradasUsadosResumenRep.aspx.vb
+++ b/Acumuladores/EntradasUsadosResumenRep.aspx.vb
@@ -35,11 +35,11 @@ Partial Class Acumuladores_RepEntradasUsados
End Sub
Protected Sub CargarCombos()
- Dim fecha As Date = Date.Now.AddMonths(-1)
+ Dim fecha As Date = NowADS().AddMonths(-1)
Dim Años As New ListItem
Dim i As Integer
If Cargado = 0 Then
- For i = Date.Now.Year.ToEntero To (fecha.Year.ToEntero - 5) Step -1
+ For i = NowADS().Year.ToEntero To (fecha.Year.ToEntero - 5) Step -1
Años = New ListItem(i.ToString, i.ToString)
DdlAño.Items.Add(Años)
Next
@@ -85,7 +85,7 @@ Partial Class Acumuladores_RepEntradasUsados
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Direccion", Direccion))
- params.Add(New ReportParameter("FechaConFormato", Date.Now.ToString))
+ params.Add(New ReportParameter("FechaConFormato", NowADS().ToString))
params.Add(New ReportParameter("FechaInicial", txtFechaI.Text))
params.Add(New ReportParameter("FechaFinal", txtFechaF.Text))
params.Add(New ReportParameter("Sucursal", "Sucursal"))
diff --git a/Acumuladores/RepAcumuladoresVigencia.aspx.cs b/Acumuladores/RepAcumuladoresVigencia.aspx.cs
index da9ed60da..aa1e08d0a 100644
--- a/Acumuladores/RepAcumuladoresVigencia.aspx.cs
+++ b/Acumuladores/RepAcumuladoresVigencia.aspx.cs
@@ -17,7 +17,7 @@ public partial class Acumuladores_RepAcumuladoresVigencia : ClsPaginas
{
if (Consultado)
{
- GvAcum.ExportToExcelG("RepAcumuladoresVigencia " + DateTime.Now.ToString("dd-MM-yyyy"), "Reporte de Vigencia de Acumuladores", UsuarioActual);
+ GvAcum.ExportToExcelG("RepAcumuladoresVigencia " + NowADS().ToString("dd-MM-yyyy"), "Reporte de Vigencia de Acumuladores", UsuarioActual);
}
else
{
@@ -53,8 +53,8 @@ public partial class Acumuladores_RepAcumuladoresVigencia : ClsPaginas
{
Consultado = false;
CargaCombos();
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().AddMonths(-24).ToShortDateString();
- txtFechaF.Text = DateTime.Now.LastDayOfMonth().AddMonths(-6).ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().AddMonths(-24).ToShortDateString();
+ txtFechaF.Text = NowADS().LastDayOfMonth().AddMonths(-6).ToShortDateString();
UpFiltros.Update();
}
diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb
index 6a89cc2c4..d77d1166b 100644
--- a/Acumuladores/RepEntradasUsadosClientes.aspx.vb
+++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb
@@ -36,8 +36,8 @@ Partial Class Acumuladores_RepEntradasUsadosClientes
DdlAlmacen.DataBind()
DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
- TxtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- TxtFechaF.text = now.toshortdatestring
+ TxtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ TxtFechaF.text = NowADS().toshortdatestring
End Sub
diff --git a/Acumuladores/RepIndicadorDiario.aspx.vb b/Acumuladores/RepIndicadorDiario.aspx.vb
index 1e0fbc7ab..8b9358b27 100644
--- a/Acumuladores/RepIndicadorDiario.aspx.vb
+++ b/Acumuladores/RepIndicadorDiario.aspx.vb
@@ -63,8 +63,8 @@ Partial Class ACumuladores_RepIndicadorDiario
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
- txtFechaI.Text = Now.FirstDayOfMonth().ToString("dd/MM/yyyy")
- txtFechaF.Text = Now.ToString("dd/MM/yyyy")
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToString("dd/MM/yyyy")
+ txtFechaF.Text = NowADS().ToString("dd/MM/yyyy")
CargaCombos()
@@ -119,7 +119,7 @@ Partial Class ACumuladores_RepIndicadorDiario
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
Dim TipoCambio As Double
LiEspecifico.Visible = True
- TipoCambio = GlobalTipoCambio(Now)
+ TipoCambio = GlobalTipoCambio(NowADS())
TxtEspecifico.Text = TipoCambio.ToString
Else
LiEspecifico.Visible = False
@@ -162,7 +162,7 @@ Partial Class ACumuladores_RepIndicadorDiario
#Region " IMPRIMIR "
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
- 'GvDatos.ExportToExcel("ReporteComprasClasificacion" & Now.ToShortDateString)
+ 'GvDatos.ExportToExcel("ReporteComprasClasificacion" & NowADS().ToShortDateString)
GenerarPDF("EXCEL")
End Sub
@@ -193,11 +193,11 @@ Partial Class ACumuladores_RepIndicadorDiario
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString))
params.Add(New ReportParameter("AgrupadoPor", $"Filtros Por: {FechaIn} {FechaFn} {SubProyecto} "))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepIndicadorDiario.rdlc", DtDatos, params, $"RepIndicadorDiario_{Now.ToString("yyyyMMddhhmmss")}", Opcion)
+ ImprimirPDF("Empresas/Grales/Formatos/RepIndicadorDiario.rdlc", DtDatos, params, $"RepIndicadorDiario_{NowADS().ToString("yyyyMMddhhmmss")}", Opcion)
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
diff --git a/Acumuladores/RepPolizasVirtuales.aspx.vb b/Acumuladores/RepPolizasVirtuales.aspx.vb
index 4ce6c4895..58be54395 100644
--- a/Acumuladores/RepPolizasVirtuales.aspx.vb
+++ b/Acumuladores/RepPolizasVirtuales.aspx.vb
@@ -13,7 +13,7 @@ Partial Class Acumuladores_RepPolizasVirtuales
Private Sub CargaCombos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto)
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth.ToShortDateString()
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString()
End Sub
diff --git a/Acumuladores/RepUsados.aspx.cs b/Acumuladores/RepUsados.aspx.cs
index 082d114ee..fce9117cf 100644
--- a/Acumuladores/RepUsados.aspx.cs
+++ b/Acumuladores/RepUsados.aspx.cs
@@ -14,8 +14,8 @@ public partial class Ventas_RepUsados : ClsPaginas
private void InicializaValores()
{
CargaCliente();
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().LastDayOfMonth().ToShortDateString();
UpFiltros.Update();
}
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 56dc02260..e7a21f5c5 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -987,7 +987,7 @@ Public Class ClsBancos
Dim dttpagosimpuestos As DataTable = Nothing
Dim dr As Data.DataRow = Nothing
- If GetComplementoPagosRep(-1, Now.AddYears(-5), Now, If(CvePrePoliza > 0, -1, CveIE), CveVenta, If(EsRegeneracion, 2, 1), UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza) Then
+ If GetComplementoPagosRep(-1, ClsPaginas.NowADS().AddYears(-5), ClsPaginas.NowADS(), If(CvePrePoliza > 0, -1, CveIE), CveVenta, If(EsRegeneracion, 2, 1), UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza) Then
dr = DtResultados.FiltroPrimero("CveVenta IS NULL")
dttpagos = DtResultados.FiltraParametros("CveVenta > 0")
End If
@@ -1000,23 +1000,23 @@ Public Class ClsBancos
RowFiltro = dttpagos.FiltroPrimero("")
If RowFiltro IsNot Nothing Then
- If Now.EsHorarioVerano Then
+ If ClsPaginas.NowADS().EsHorarioVerano Then
Dim UTCOffsetVerano As Integer = RowFiltro("UTCOffsetVerano").ToString().ToEntero()
If UTCOffsetVerano <> 0 Then
FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffsetVerano)
Else
- FechaTimbrado = DateTime.Now
+ FechaTimbrado = ClsPaginas.NowADS()
End If
Else
Dim UTCOffsetInvierno As Integer = RowFiltro("UTCOffsetInvierno").ToString().ToEntero()
If UTCOffsetInvierno <> 0 Then
FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffsetInvierno)
Else
- FechaTimbrado = DateTime.Now
+ FechaTimbrado = ClsPaginas.NowADS()
End If
End If
Else
- FechaTimbrado = DateTime.Now
+ FechaTimbrado = ClsPaginas.NowADS()
End If
End If
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index f5eaa75ab..72954ea76 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -292,7 +292,7 @@ Public Class ClsContabilidad
Public Function UpdatePrePolizasDetalle(CvePrePolizaDetalle As Integer, Concepto As String, CveSubProyecto As Integer, IdCtaContable As Integer, TipoMovto As Boolean, ImporteMN As Decimal, Optional CveTipoGasto As Integer = -1,
Optional CveConceptoContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVenta As Integer = -1,
- Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1, Optional CveIE As Integer = -1) As Boolean
+ Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1, Optional CveIE As Integer = -1, Optional TipoCambio As Decimal = -1) As Boolean
Dim Retorno As Boolean = False
@@ -305,7 +305,7 @@ Public Class ClsContabilidad
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable
.Add("@TipoMovto", SqlDbType.Bit).Value = TipoMovto
- '.Add("@Importe", SqlDbType.Money).Value = Importe
+ .Add("@TipoCambio", SqlDbType.Decimal).Value = TipoCambio
.Add("@ImporteMN", SqlDbType.Money).Value = ImporteMN
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
.Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
@@ -968,9 +968,6 @@ Public Class ClsContabilidad
.Add("@TCPago", SqlDbType.Decimal).Value = TipoCambioPago
.Add("@Referencia", SqlDbType.VarChar).Value = Referencia
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto
- '.Add("@FechaVencimiento", SqlDbType.Date).Value = FechaVencimiento
- '.Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable
- '.Add("@IdSegmentoNegocio", SqlDbType.Int).Value = IdSegmentoNegocio
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
@@ -993,6 +990,7 @@ Public Class ClsContabilidad
.Add("@CveCreditoDetalle", SqlDbType.Int).Value = CveCreditoDetalle
.Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto
.Add("@CveNominaMovtoPermanente", SqlDbType.Money).Value = CveNominaMovtoPermanente
+ .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
.Add("@CvePrePolizaDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -5664,7 +5662,7 @@ Public Class ClsContabilidad
Public Function AddCuentasAsignaciones(CveConceptoContable As Integer, CveEmpresa As Integer, CveCuenta As Integer,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1,
Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
- Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional CveCredito As Integer = -1,
+ Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional CveCredito As Integer = -1, Optional CveColectiva As Integer = -1,
Optional RegeneraCuenta As Boolean = False,
Optional OpActualizarClasificacion As Boolean = False) As Boolean
Dim Retorno As Boolean = False
@@ -5687,6 +5685,7 @@ Public Class ClsContabilidad
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
.Add("@CveCredito", SqlDbType.Int).Value = CveCredito
+ .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
.Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta
.Add("@OpActualizarClasificacion", SqlDbType.Bit).Value = OpActualizarClasificacion
End With
@@ -5706,7 +5705,7 @@ Public Class ClsContabilidad
Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1,
Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1,
- Optional CveCredito As Integer = -1, Optional RegeneraCuenta As Boolean = False) As Boolean
+ Optional CveCredito As Integer = -1, Optional CveColectiva As Integer = -1, Optional RegeneraCuenta As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_CuentasAsignacionesUpdate")
@@ -5727,6 +5726,7 @@ Public Class ClsContabilidad
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
.Add("@CveCredito", SqlDbType.Int).Value = CveCredito
+ .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
.Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta
End With
@@ -6328,7 +6328,7 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function GetEstadosMensualHorizontal(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1) As Boolean
+ Public Function GetEstadosMensualHorizontal(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1, Optional VistaPorcentaje As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta2_EstadoResultadosMensualHorizontal")
@@ -6342,6 +6342,7 @@ Public Class ClsContabilidad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Tipo", SqlDbType.Int).Value = Tipo
+ .Add("@VistaPorcentaje", SqlDbType.Int).Value = VistaPorcentaje
End With
@@ -6357,7 +6358,7 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function GetEstadosAnualHorizontal(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1, Optional Periodo As Integer = 12) As Boolean
+ Public Function GetEstadosAnualHorizontal(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1, Optional Periodo As Integer = 12, Optional VistaPorcentaje As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta2_EstadoResultadosAnualHorizontal")
@@ -6372,6 +6373,7 @@ Public Class ClsContabilidad
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Tipo", SqlDbType.Int).Value = Tipo
.Add("@Periodo", SqlDbType.Int).Value = Periodo
+ .Add("@VistaPorcentaje", SqlDbType.Int).Value = VistaPorcentaje
End With
@@ -6388,7 +6390,7 @@ Public Class ClsContabilidad
End Function
- Public Function GetEstadosSubProyectoHorizontal(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1) As Boolean
+ Public Function GetEstadosSubProyectoHorizontal(FechaI As Date, FechaF As Date, CveProyecto As Integer, CveSubProyecto As Integer, Divisor As Integer, CveEmpresa As Integer, CveUsuario As Integer, Optional Tipo As Integer = 1, Optional VistaPorcentaje As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta2_EstadoResultadosSubProyectolHorizontal")
@@ -6402,7 +6404,7 @@ Public Class ClsContabilidad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Tipo", SqlDbType.Int).Value = Tipo
-
+ .Add("@VistaPorcentaje", SqlDbType.Int).Value = VistaPorcentaje
End With
SqlAdapter.SelectCommand.CommandTimeout = 0
diff --git a/App_Code/ClsDG.vb b/App_Code/ClsDG.vb
index 9a3f09070..500a506d0 100644
--- a/App_Code/ClsDG.vb
+++ b/App_Code/ClsDG.vb
@@ -611,7 +611,7 @@ Public Class ClsDG
Public Sub GuardaLog(pTexto As String)
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto)
+ strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString, pTexto)
Try
ArchivoW = New StreamWriter(String.Format("{0}\LogDG.txt", AppDomain.CurrentDomain), True, System.Text.Encoding.UTF8)
diff --git a/App_Code/ClsEncuestas.vb b/App_Code/ClsEncuestas.vb
index fb9c893d5..d7a8e0a51 100644
--- a/App_Code/ClsEncuestas.vb
+++ b/App_Code/ClsEncuestas.vb
@@ -566,7 +566,7 @@ Public Class ClsEncuestas
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@Fecha", SqlDbType.Date).Value = Now
+ .Add("@Fecha", SqlDbType.Date).Value = ClsPaginas.NowADS()
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEncuestaAplicada", SqlDbType.Int).Direction = ParameterDirection.Output
End With
diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index 1b98bec8a..a28971f9e 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -31,9 +31,7 @@ Public Class ClsGenerales
Public Property Direccion As String
Public Property Telefono As String
Public Property Correo As String
- Public Property Tipo As Integer
- Public Property IdCtaContable As Integer
- Public Property CtaContable As String
+ Public Property Tipo As Integer
Public Property Estatus As Boolean
Public Property FechaIng As DateTime
Public Property CveUsuario As Integer
@@ -1245,18 +1243,17 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "C O L E C T I V A S"
- Public Function GetColectivas(Optional CveColectiva As Integer = -1, Optional Colectiva As String = "-1", Optional Codigo As String = "-1", Optional Tipo As String = "-1", Optional CveEmpresa As Integer = -1) As Boolean
+ Public Function GetColectivas(CveEmpresa As Integer, Optional CveColectiva As Integer = -1, Optional Tipo As String = "-1", Optional CveConceptoContable As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ColectivasGet")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
- .Add("@Colectiva", SqlDbType.VarChar).Value = Colectiva
- .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
+ .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
@@ -1270,9 +1267,7 @@ Public Class ClsGenerales
Me.Direccion = Data.Rows(0)("Direccion").ToString
Me.Telefono = Data.Rows(0)("Telefono").ToString
Me.Correo = Data.Rows(0)("Correo").ToString
- Me.Tipo = Data.Rows(0)("Tipo").ToString.ToEntero
- Me.IdCtaContable = Data.Rows(0)("IdCtaContable").ToString.ToEntero
- Me.CtaContable = Data.Rows(0)("CtaContable").ToString
+ Me.Tipo = Data.Rows(0)("Tipo").ToString.ToEntero
Me.Estatus = CBool(Data.Rows(0)("Estatus").ToString)
Me.FechaIng = Data.Rows(0)("FechaIng").ToString.ToDateTime
Me.Usuario = Data.Rows(0)("Usuario").ToString
@@ -1392,7 +1387,7 @@ Public Class ClsGenerales
DataAdapter("PA_Gral_ColectivasGetByProveedor")
With SqlAdapter.SelectCommand.Parameters
- .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
@@ -1403,10 +1398,10 @@ Public Class ClsGenerales
End Try
Return Retorno
- End Function
-
+ End Function
+
#End Region
-
+
#Region "C O L E C T I V A S - D E T A L L E S"
Public Function GetColectivasDetalles(CveColectiva As Integer, Tipo As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1728,7 +1723,7 @@ Public Class ClsGenerales
.Add("@Estatus", SqlDbType.VarChar).Value = Estatus
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito
- .Add("@FechaIng", SqlDbType.Date).Value = Date.Now
+ .Add("@FechaIng", SqlDbType.Date).Value = ClsPaginas.NowADS()
.Add("@RefCrediProveedor", SqlDbType.VarChar).Value = RefCrediProveedor
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@Correo", SqlDbType.VarChar).Value = Correo
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index c0b1a6eb8..d10630102 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -992,7 +992,7 @@ Public Class ClsInventarios
DataAdapter("PA_Inv_MovimientosAdd")
If FechaMovto.Hour = 0 AndAlso FechaMovto.Minute = 0 AndAlso FechaMovto.Second = 0 Then
- FechaMovto = String.Format("{0} {1}:{2}:{3}", FechaMovto.ToShortDateString, Now.Hour, Now.Minute, Now.Second).ToDateTime
+ FechaMovto = String.Format("{0} {1}:{2}:{3}", FechaMovto.ToShortDateString, ClsPaginas.NowADS().Hour, ClsPaginas.NowADS().Minute, ClsPaginas.NowADS().Second).ToDateTime
End If
With SqlAdapter.SelectCommand.Parameters
@@ -1535,7 +1535,8 @@ Public Class ClsInventarios
End Function
Public Function GetKardexAlmacenHorizontal(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer,
IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0,
- Optional Orden As Integer = -1, Optional Marcas As String = "-1", Optional IncluyeProyectado As Integer = -1, Optional CveAlmacenes As String = "-1", Optional GPO As Integer = 1) As Boolean
+ Optional Orden As Integer = -1, Optional Marcas As String = "-1", Optional IncluyeProyectado As Integer = -1, Optional CveAlmacenes As String = "-1",
+ Optional GPO As Integer = 1, Optional CodigoPS As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_KardexAlmacenHorizontalGet")
@@ -1558,6 +1559,7 @@ Public Class ClsInventarios
.Add("@IncluyeProyectado", SqlDbType.TinyInt).Value = IncluyeProyectado
.Add("@CveAlmacenes", SqlDbType.NVarChar).Value = CveAlmacenes
.Add("@GPO", SqlDbType.Int).Value = GPO
+ .Add("@CodigoPS", SqlDbType.VarChar).Value = CodigoPS
End With
@@ -1981,7 +1983,7 @@ Public Class ClsInventarios
Dim Retorno As Decimal = -1
If FechaMovto = "-1" Then
- FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd"))
+ FechaMovto = String.Format("{0} 00:00", ClsPaginas.NowADS().AddDays(1).ToString("yyyy/MM/dd"))
End If
DataAdapter("PA_Inv_ExistenciasPSGet")
@@ -2176,7 +2178,7 @@ Public Class ClsInventarios
Dim Retorno As Boolean = False
If FechaMovto = "-1" Then
- FechaMovto = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd"))
+ FechaMovto = String.Format("{0} 00:00", ClsPaginas.NowADS().AddDays(1).ToString("yyyy/MM/dd"))
End If
DataAdapter("PA_Inv_ExistenciasPSEmpaqueGet")
@@ -2216,7 +2218,7 @@ Public Class ClsInventarios
Dim Retorno As Boolean = False
If Fecha = "-1" Then
- Fecha = String.Format("{0} 00:00", Now.AddDays(1).ToString("yyyy/MM/dd"))
+ Fecha = String.Format("{0} 00:00", ClsPaginas.NowADS().AddDays(1).ToString("yyyy/MM/dd"))
End If
DataAdapter("PA_Inv_ExistenciasPSXMLGet")
@@ -5630,7 +5632,7 @@ Public Class ClsInventarios
NumPolizaSeguro As String, CveUsuario As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguroCarga As String,
Optional CveTipoCamion As Integer = 1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "",
Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False, Optional CveProveedor As Integer = -1,
- Optional Marca As String = "", Optional Color As String = "") As Boolean
+ Optional Marca As String = "", Optional Color As String = "", Optional CveChoferAsignado As Integer = -1, Optional CveRemolque1Asignado As Integer = -1, Optional CveRemolque2Asignado As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_CamionesAdd")
@@ -5660,6 +5662,9 @@ Public Class ClsInventarios
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@Marca", SqlDbType.VarChar).Value = Marca
.Add("@Color", SqlDbType.VarChar).Value = Color
+ .Add("@CveChoferAsignado", SqlDbType.Int).Value = CveChoferAsignado
+ .Add("@CveRemolque1Asignado", SqlDbType.Int).Value = CveRemolque1Asignado
+ .Add("@CveRemolque2Asignado", SqlDbType.Int).Value = CveRemolque2Asignado
End With
Try
SqlAdapter.Fill(Data)
@@ -5694,7 +5699,7 @@ Public Class ClsInventarios
NumPolizaSeguro As String, CveUsuario As Integer, CveEmpresa As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String,
NumPolizaSeguroCarga As String, Optional CveTipoCamion As Integer = -1, Optional LongitudCaja As String = "", Optional LineaTransportacion As String = "", Optional SCAC As String = "", Optional CAAT As String = "",
Optional CveTipoRemolque As Integer = -1, Optional NumeroTrailer As String = "", Optional Estatus As Boolean = False, Optional CveProveedor As Integer = -1,
- Optional Marca As String = "", Optional Color As String = "") As Boolean
+ Optional Marca As String = "", Optional Color As String = "", Optional CveChoferAsignado As Integer = -1, Optional CveRemolque1Asignado As Integer = -1, Optional CveRemolque2Asignado As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_CamionesUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -5724,6 +5729,9 @@ Public Class ClsInventarios
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@Marca", SqlDbType.VarChar).Value = Marca
.Add("@Color", SqlDbType.VarChar).Value = Color
+ .Add("@CveChoferAsignado", SqlDbType.Int).Value = CveChoferAsignado
+ .Add("@CveRemolque1Asignado", SqlDbType.Int).Value = CveRemolque1Asignado
+ .Add("@CveRemolque2Asignado", SqlDbType.Int).Value = CveRemolque2Asignado
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb
index a63389698..123eec236 100644
--- a/App_Code/ClsMovimientos.vb
+++ b/App_Code/ClsMovimientos.vb
@@ -120,7 +120,7 @@ Public Class ClsMovimientos
Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1", Optional FechaCorte As Date = MaxFecha, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha) As Boolean
Dim Retorno As Boolean = False
- FechaCorte = IIf(FechaCorte = Nothing, Date.Now.AddYears(1), FechaCorte).ToString.ToDate
+ FechaCorte = IIf(FechaCorte = Nothing, ClsPaginas.NowADS().AddYears(1), FechaCorte).ToString.ToDate
DataAdapter("PA_Vta_ClienteCxC")
With SqlAdapter.SelectCommand.Parameters
@@ -684,7 +684,7 @@ Public Class ClsMovimientos
Optional TipoDocto As String = "-1", Optional TipoAgrupacion As Integer = -1, Optional CveProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
- If FechaCorte = Nothing Then FechaCorte = Now
+ If FechaCorte = Nothing Then FechaCorte = ClsPaginas.NowADS()
DataAdapter("PA_Comp_RepCxP")
With SqlAdapter.SelectCommand.Parameters
@@ -1314,7 +1314,7 @@ Public Class ClsMovimientos
Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1, Optional TipoDocto As String = "-1", Optional CveProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
- If FechaCorte = Nothing Then FechaCorte = Now
+ If FechaCorte = Nothing Then FechaCorte = ClsPaginas.NowADS()
DataAdapter("PA_Comp_RepCxPDetalle")
With SqlAdapter.SelectCommand.Parameters
@@ -1481,7 +1481,7 @@ Public Class ClsMovimientos
#End Region
#Region "Anticipos de Proveedores"
- Public Function GetAnticiposProveedor(CveProveedor As Integer, CveProveedorSucursal As Integer, Optional CveMoneda As Integer = -1, Optional SelectTop As Integer = -1, Optional FechaI As String = "-1", Optional FechaF As String = "-1", Optional TipoDocto As String = "-1") As Boolean
+ Public Function GetAnticiposProveedor(CveProveedor As Integer, CveEmpresa As Integer, Optional CveMoneda As Integer = -1, Optional CveProveedorSucursal As Integer = -1, Optional SelectTop As Integer = -1, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha, Optional TipoDocto As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_ProveedorAnticipos")
@@ -1489,13 +1489,13 @@ Public Class ClsMovimientos
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveProveedorSucursal", SqlDbType.Int).Value = CveProveedorSucursal
- .Add("@SelectTop", SqlDbType.Int).Value = SelectTop
- .Add("@FechaI", SqlDbType.VarChar).Value = FechaI
- .Add("@FechaF", SqlDbType.VarChar).Value = FechaF
+ .Add("@SelectTop", SqlDbType.Int).Value = SelectTop
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FechaI", SqlDbType.Date).Value = FechaI
+ .Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
End With
-
Try
SqlAdapter.Fill(Data)
Retorno = True
diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb
index fe4cc82c8..a492db067 100644
--- a/App_Code/ClsOC.vb
+++ b/App_Code/ClsOC.vb
@@ -706,7 +706,8 @@ Public Class ClsOC
Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "",
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
- Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1") As Boolean
+ Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1",
+ Optional CveColectiva As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraAdd")
@@ -750,6 +751,7 @@ Public Class ClsOC
.Add("@Promocion", SqlDbType.VarChar).Value = Promocion
.Add("@CveProveedorContacto", SqlDbType.Int).Value = CveProveedorContacto
.Add("@NumRemision", SqlDbType.VarChar).Value = NumRemision
+ .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
.Add("@vCveOrdenCompra", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -1156,7 +1158,7 @@ Public Class ClsOC
pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Decimal = 0,
Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional Total As Decimal = 0,
Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Decimal = 0, Optional RetIVAPorcentaje As Decimal = 0, Optional RetISRPorcentaje As Decimal = 0, Optional IEPSPSPorcentaje As Decimal = 0,
- Optional IEPSPSIVAPorcentaje As Decimal = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
+ Optional IEPSPSIVAPorcentaje As Decimal = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, Optional CveColectiva As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraDetalleAdd")
@@ -1189,6 +1191,7 @@ Public Class ClsOC
.Add("@CveVentaDetalleCotizacion", SqlDbType.Int).Value = CveVentaDetalleCotizacion
.Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra
.Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
+ .Add("@CveColectiva", SqlDbType.Int).Value = CveColectiva
End With
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index e8a0fd6bc..7a59a1ea4 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -98,6 +98,21 @@ Public Class ClsPaginas
End Try
End Set
End Property
+
+ Public Shared Function NowADS() As DateTime
+ Dim tHora As Integer = 0
+ 'If UsuarioActual IsNot Nothing AndAlso UsuarioActual.Empresa IsNot Nothing Then tHora = UsuarioActual.Empresa.UTCOffset
+ Try
+ If HttpContext.Current.Session("UsuarioSIG") IsNot Nothing AndAlso CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).Empresa IsNot Nothing Then tHora = CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).Empresa.UTCOffset
+ Catch ex As Exception
+
+ End Try
+
+
+ Return If(tHora <> 0, Now.ToUniversalTime.AddMinutes(tHora), Now)
+ End Function
+
+
#End Region
#Region "GlobalDTs"
@@ -105,7 +120,7 @@ Public Class ClsPaginas
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
- If Fecha = MinFecha Then Fecha = Now
+ If Fecha = MinFecha Then Fecha = NowADS()
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
@@ -124,7 +139,7 @@ Public Class ClsPaginas
Get
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
- If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
+ If ObjGral.GetTipoCambioUltimaFluctuacion(-1, NowADS()) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
@@ -136,7 +151,7 @@ Public Class ClsPaginas
.FechaFluctuacion = MinFecha
}
'sino tiene dato lo recargo por si ya esta insertado
- If Fecha = MinFecha Then Fecha = Now
+ If Fecha = MinFecha Then Fecha = NowADS()
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr As DataRow = DirectCast(HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha < '{0}'", Fecha), Orderby:="Fecha DESC")
@@ -159,7 +174,7 @@ Public Class ClsPaginas
Get
If GlobalTipoCambioEuro <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
- If Fecha = MinFecha Then Fecha = Now
+ If Fecha = MinFecha Then Fecha = NowADS()
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambioEuro") = ObjGral.DtResultados.Rows(0)("TipoCambioEuro").ToString.ToDouble
@@ -1083,6 +1098,7 @@ Public Class ClsPaginas
Application(AppNombre) = value
End Set
End Property
+
Public Shared Property GlobalDTClasificacionesPresupuestos(CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = $"GlobalDTClasificacionesPresupuestos-{CveEmpresa}"
@@ -1763,7 +1779,7 @@ Public Class ClsPaginas
Application(AppNombre) = value
End Set
End Property
- Property GlobalDTInvCamiones(CveEmpresa As Integer, Optional CveCamion As Integer = -1) As DataTable
+ Property GlobalDTInvCamiones(CveEmpresa As Integer, Optional CveCamion As Integer = -1, Optional CveTipoCamion As Integer = -1) As DataTable
Get
Dim AppNombre As String = $"GlobalDTInvCamiones-{CveEmpresa}"
If Application(AppNombre) Is Nothing Then
@@ -1773,6 +1789,7 @@ Public Class ClsPaginas
End If
Dim Str As New StringBuilder
If CveCamion > 0 Then Str.AppendFormat("CveCamion = {0}", CveCamion)
+ If CveTipoCamion > 0 Then Str.AppendFormat("CveTipoCamion = {0}", CveTipoCamion)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTInvCamiones = Dv.ToTable
Dv.Dispose()
@@ -4374,9 +4391,7 @@ Public Class ClsPaginas
End If
Else
LocalStopwatch.Value.Restart()
- If EsProduccion Then
- If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 166) Then System.Threading.Thread.Sleep(1100)
- End If
+
If Not Page.IsPostBack Then
'If Not CType(Session("UsuarioSIG"), Usuario).SeleccionoEmpresa AndAlso Request.ServerVariables("URL") <> "/Sistemas/PopUpSeleccionarEmpresa.aspx" Then
' Response.Redirect("/Sistemas/PopUpSeleccionarEmpresa.aspx")
@@ -4426,7 +4441,7 @@ Public Class ClsPaginas
End Sub
Private Shared Function GetCurrentPageViewState() As System.Web.UI.StateBag
Dim page As Page = TryCast(HttpContext.Current.CurrentHandler, Page)
- Dim viewStateProp = page?.[GetType]().GetProperty("ViewState", Reflection.BindingFlags.FlattenHierarchy Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
+ Dim viewStateProp As Reflection.PropertyInfo = page?.[GetType]().GetProperty("ViewState", Reflection.BindingFlags.FlattenHierarchy Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
Return CType(viewStateProp?.GetValue(page), System.Web.UI.StateBag)
End Function
Public Shared Sub Alert(Mensaje As String, Optional pOpcion As TipoMensaje = TipoMensaje.MsgInformacion, Optional JSBtnAceptar As String = "", Optional timeout As Integer = 5, Optional ShowCloseButton As Boolean = True, Optional TextoConfirmacion As String = "", Optional TextoSegundoBoton As String = "", Optional JSBtn2 As String = "")
@@ -4499,7 +4514,7 @@ Public Class ClsPaginas
Public Shared Sub RegistraScript(Script As String, Optional valuetick As String = "")
Dim page As Page = TryCast(HttpContext.Current.CurrentHandler, Page)
Script = $"{Script.TrimEnd(";"c)};" 'sino trae ";" al final, se lo agregamos
- ScriptManager.RegisterStartupScript(page, page.GetType(), $"{DateTime.Now.Ticks + 1}{ThreadSafeRandom.Next()}{valuetick}", Script, True)
+ ScriptManager.RegisterStartupScript(page, page.GetType(), $"{NowADS().Ticks + 1}{ThreadSafeRandom.Next()}{valuetick}", Script, True)
End Sub
Public Sub TabEnabled(Tab As System.Web.UI.HtmlControls.HtmlAnchor, Valor As Boolean)
If Valor Then
@@ -4521,11 +4536,11 @@ Public Class ClsPaginas
End Sub
Public Sub NotificacionesPendientes(Nota As String)
'incremento el contador de alertas
- Dim Type = Master.GetType
- Dim Prop = Type.GetProperty("countNotificaciones")
+ Dim Type As System.Type = Master.GetType
+ Dim Prop As Reflection.PropertyInfo = Type.GetProperty("countNotificaciones")
Prop.SetValue(Master, 1 + CInt(Prop.GetValue(Master)))
'end incremento contador de alertas
- Dim ltl = DirectCast(Master.FindControl("LtlMNotificaciones"), Literal)
+ Dim ltl As Literal = DirectCast(Master.FindControl("LtlMNotificaciones"), Literal)
ltl.Text = String.Format(" {0} {1}", ltl.Text, Nota)
End Sub
Public Sub Confirmacion(Mensaje As String, Tipo As String, FuncionOK As String, FuncionCancel As String)
@@ -4628,7 +4643,7 @@ Public Class ClsPaginas
lrds.Add(rds)
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR, Content_Disposition)
End Sub
- Public Sub ImprimirPDFStimulsoft(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "Datos", Optional Content_Disposition As String = "attachment")
+ Public Sub ImprimirPDFStimul(RutaReporte As String, DtDatos As DataTable, Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "Datos", Optional Content_Disposition As String = "attachment")
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource
rds.Name = RDSName
@@ -4638,7 +4653,7 @@ Public Class ClsPaginas
If Formato.ToLower() = "excel" Then
Extension = "xlsx"
End If
- ImprimirbytesPDF(StreamBytesStimulsoft("Facturas", RutaReporte, lrds, Parametros, NombreArchivo:=NombreArchivo, Formato:=Formato), NombreArchivo, Formato, Content_Disposition:=Content_Disposition, Extension:=Extension)
+ ImprimirbytesPDF(StreamBytesStimul("Facturas", RutaReporte, lrds, Parametros, NombreArchivo:=NombreArchivo, Formato:=Formato), NombreArchivo, Formato, Content_Disposition:=Content_Disposition, Extension:=Extension)
End Sub
Public Sub ImprimirPDFMultiDS(RutaReporte As String, lrds As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional RDSName As String = "DataSet1", Optional MR As ReportViewer = Nothing)
ImprimirPDF(RutaReporte, lrds, Parametros, NombreArchivo, Formato, MR)
@@ -5110,7 +5125,7 @@ Public Class ClsPaginas
#End Region
#Region "IMPRIMIR FACTURA"
- Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing, Optional UsarStimulsoft As Boolean = False) As Byte()
+ Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing, Optional UsarStimul As Boolean = False) As Byte()
Dim retorno As Byte() = Nothing
' Dim ObjVentas As New ClsVentas
'DATOS GENERALES
@@ -5504,7 +5519,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("ClienteDiasCredito", "0"))
params.Add(New ReportParameter("MonedaAbreviatura", If(Vta.MonedaAbreviatura.ToString IsNot Nothing, Vta.MonedaAbreviatura.ToString, "")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("Sucursal", Vta.SubProyecto.SubProyecto))
params.Add(New ReportParameter("EstatusFactura", If(Vta.TipoEstatus = 5, Vta.EstatusFactura, "")))
params.Add(New ReportParameter("EstatusEntrega", If(Vta.Inv_CveEstatusEntrega = 1, Vta.Inv_EstatusEntrega, "")))
@@ -5947,7 +5962,7 @@ Public Class ClsPaginas
lrds.Add(rds3)
Dim rds4 As New ReportDataSource With {.Name = "DataSet4", .Value = If(Vta.DtDocumentosRelacionados IsNot Nothing, Vta.DtDocumentosRelacionados, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte
lrds.Add(rds4)
- If UsuarioActual.Empresa.Funcionalidad(707) = "1" OrElse UsarStimulsoft Then
+ If UsuarioActual.Empresa.Funcionalidad(707) = "1" OrElse UsarStimul Then
If Vta.Cliente.CodigoRegimenFiscal.ToString.Length > 0 Then
params.Add(New ReportParameter("ClienteRegimenFiscal", $"{Vta.Cliente.CodigoRegimenFiscal}-{Vta.Cliente.RegimenFiscal}"))
End If
@@ -5993,11 +6008,11 @@ Public Class ClsPaginas
If UsuarioActual.Empresa.Funcionalidad(707) = "1" Then
Dim ArchivoStimulsfot As New System.IO.FileInfo(RutaFormato.Replace(".rdlc", ".mrt"))
If ArchivoStimulsfot.Exists Then
- UsarStimulsoft = True
+ UsarStimul = True
params.Add(New ReportParameter("RegimenFiscalEmpresa", String.Format("{0} - {1}", UsuarioActual.Empresa.CodigoRegimenFiscal, UsuarioActual.Empresa.RegimenFiscal)))
End If
End If
- If Not UsarStimulsoft Then
+ If Not UsarStimul Then
Dim Archivo As New System.IO.FileInfo(RutaFormato)
If Archivo.Exists Then
@@ -6029,7 +6044,10 @@ Public Class ClsPaginas
End If
Else
RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
- retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
+
+ params.Add(New ReportParameter("SucursalCliente", If(Vta.ClienteSucursal.Sucursal Is Nothing, "", Vta.ClienteSucursal.Sucursal.ToString)))
+
+ retorno = StreamBytesStimul("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
If UsuarioActual.Empresa.Funcionalidad(707) = "1" Then
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
If Guardar Then
@@ -6057,7 +6075,7 @@ Public Class ClsPaginas
End Try
Return retorno
End Function
- Protected Function StreamBytesStimulsoft(Opcion As String, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional NombreDataSource As String = "Datos") As Byte()
+ Protected Function StreamBytesStimul(Opcion As String, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional NombreDataSource As String = "Datos") As Byte()
'limpio ReportViwer
Dim sw As Stopwatch = Stopwatch.StartNew()
@@ -6119,12 +6137,12 @@ Public Class ClsPaginas
New JProperty("parametros", paramsArray),
New JProperty("dataSource", dataSourceArray)
)
- Dim data = New StringContent(payload.ToString(), Encoding.UTF8, "application/json")
- Using httpClient = New HttpClient()
- Using request = New HttpRequestMessage(HttpMethod.Post, Url)
+ Dim data As New StringContent(payload.ToString(), Encoding.UTF8, "application/json")
+ Using httpClient As New HttpClient()
+ Using request As New HttpRequestMessage(HttpMethod.Post, Url)
'request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
request.Content = New StringContent(payload.ToString(), Encoding.UTF8, "application/json")
- Dim response = httpClient.SendAsync(request).Result
+ Dim response As HttpResponseMessage = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
Bytes = response.Content.ReadAsByteArrayAsync().Result
End If
@@ -6453,7 +6471,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("EntregaDirecta", ObjOC.EntregaDirecta.ToString))
params.Add(New ReportParameter("NombreCliente", ObjOC.NombreCliente.ToString))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("DomicilioSucursal", DomicilioSucursal))
params.Add(New ReportParameter("ProveedorContacto", ObjOC.ProveedorContacto))
params.Add(New ReportParameter("Comprador", ObjOC.UsuarioAsignado))
@@ -6651,7 +6669,7 @@ Public Class ClsPaginas
lista.Add(New CrystalParametro("Empresa", EmpresaActual.Empresa))
lista.Add(New CrystalParametro("TipoCuentas", "Todas"))
lista.Add(New CrystalParametro("FechaInicio", "-"))
- lista.Add(New CrystalParametro("FechaFin", DateTime.Now.ToShortDateString))
+ lista.Add(New CrystalParametro("FechaFin", NowADS().ToShortDateString))
lista.Add(New CrystalParametro("NombreProveedor", NombreProv))
lista.Add(New CrystalParametro("DireccionProveedor", Direccion))
lista.Add(New CrystalParametro("ProveedorRFC", RFC))
@@ -7126,7 +7144,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("EmpresaNoInt", UsuarioActual.Empresa.NoInt))
'DATOS IMPRESION
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
'DATOS GENERALES
Dim Ruta As String = UsuarioActual.Empresa.Ruta
Dim PathXML As String = $"{Ruta}XML\Pag\{Serie}-{Folio}.xml"
@@ -7457,9 +7475,9 @@ Public Class ClsPaginas
ImporteMovimiento = (PorcentajePago * CompraActual.RetISR).RoundSQL
ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL
If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
- Dim ContabilizableISR As Boolean = False
- If UsuarioActual.CveEmpresa.Contiene(140, 7, 11, 12, 122, 145, 172, 173, 174) Then
- ContabilizableISR = True
+ Dim ContabilizableISR As Boolean = True
+ If UsuarioActual.CveEmpresa.Contiene(13, 83, 141, 153, 154, 158) Then
+ ContabilizableISR = False
End If
Dim Ret As ConceptosRetenciones = CompraActual.ConceptoPrePolizaRetISR
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, Ret.CveConceptoxAcreditar, CompraActual.SerieFolio, Concepto, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=CompraActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, Contabilizable:=ContabilizableISR, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True
@@ -7865,6 +7883,11 @@ Public Class ClsPaginas
Dim Contabilizable As Boolean = True
If PorcentajePago > 1 Then PorcentajePago = 1
+ ''validación
+ If Pago.TipoPago = "I" AndAlso Pago.CveClientePago <= 0 Then
+ Return True
+ End If
+
Dim Concepto As String = String.Format("{0} F:{1}", VentaActual.ClienteNombre, VentaActual.SerieFolio)
Dim FuncionalidadFluctuacionImpuestos As Boolean = If(VentaActual.UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False)
Dim tFecha As Date = Pago.Fecha
@@ -8028,12 +8051,12 @@ Public Class ClsPaginas
End If
If Pago.CveMonedaPago > 1 Then
'Agregamos la Extranjera
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=Pago.CveClientePago, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 332, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImporteMN, 332, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=Pago.CveClientePago, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
Else
'Agregamos Nacional
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 92, Pago.Referencia, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=Pago.CveClientePago, CveIE:=Pago.CveIE, CveSubProyecto:=VentaActual.CveSubProyecto, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
End If
End If
'si tiene otros gastos/ingresos
@@ -8106,7 +8129,7 @@ Public Class ClsPaginas
Public Property AplicaTraslado As Boolean = True
Public Property Referencia As String
Public Property CveConceptoPago As Integer = -1
-
+ Public Property CveClientePago As Integer = -1
Public Property ImporteFluctuacionAdicional As Decimal = 0
Public Property ValorMultiplicador As Decimal = 1
End Class
@@ -8465,7 +8488,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Bancos/RepCobradoPagadoDetalle.aspx".ToUpper(), -1)
PaginaDict.Add("/Bancos/RepCobradoPagado.aspx".ToUpper(), 368)
PaginaDict.Add("/Bancos/RepIngresosPorComprobar.aspx".ToUpper(), 381)
- PaginaDict.Add("/Bancos/Documentos.aspx".ToUpper(), 319)
+ 'PaginaDict.Add("/Bancos/Documentos.aspx".ToUpper(), 319)
PaginaDict.Add("/Bancos/RepCreditos.aspx".ToUpper(), 320)
PaginaDict.Add("/Bancos/RepSaldosDAP.aspx".ToUpper(), 385)
PaginaDict.Add("/Bancos/DepositosCaja.aspx".ToUpper(), 560)
@@ -9310,7 +9333,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx".ToUpper(), 1331)
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=OP".ToUpper(), 1332)
- PaginaDict.Add("/Ventas/FacturacionAcarreos.aspx".ToUpper(), 774)
+ PaginaDict.Add("/Ventas/FacturacionAcarreos.aspx".ToUpper(), 784)
PaginaDict.Add("/Ventas/RepIndicadoresPorProyecto.aspx".ToUpper(), 617)
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index 77ee44b44..368ab5a2f 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -411,7 +411,8 @@ Public Class ClsProductosServicios
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False,
Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False,
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0,
- Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1) As Integer
+ Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1,
+ Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_ProductosServiciosAdd")
@@ -509,6 +510,11 @@ Public Class ClsProductosServicios
'Nuevo MLopez 18/11/2022
.Add("@CveTipoEmpacado", SqlDbType.Int).Value = CveTipoEmpacado
.Add("@CveTipoOrganico", SqlDbType.Int).Value = CveTipoOrganico
+ .Add("@NombreComercial", SqlDbType.VarChar).Value = NombreComercial
+ .Add("@NotasAdicionales", SqlDbType.VarChar).Value = NotasAdicionales
+ .Add("@EcommerceEtiquetas", SqlDbType.VarChar).Value = EcommerceEtiquetas
+ .Add("@ActivoEcommerce", SqlDbType.VarChar).Value = ActivoEcommerce
+ .Add("@EcommercePrecio", SqlDbType.SmallMoney).Value = EcommercePrecio
End With
@@ -634,7 +640,7 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function UpdatePS(CveClasificacion As Integer, CveClasificacionCosto As Integer, CveUnidadMedida As Integer, Codigo As String, Codigo2 As String, CodigoBarras As String, PS As String, Precio As Double, IVA As Double, RetIVA As Double, Inventariable As Boolean, CveProveedorCompra As Integer,
- AplicaParaConcepto As Boolean, AplicaParaVenta As Boolean, Estado As Boolean, CveUsuario As Integer, CvePS As Integer, CveMetodoInventario As Integer, EsPaquete As Integer, CveSATPS As Integer, Optional CveTipoPS As Integer = -1, Optional TipoServicio As Integer = -1,
+ AplicaParaConcepto As Boolean, AplicaParaVenta As Boolean, Estado As Boolean, CveUsuario As Integer, CvePS As Integer, CveMetodoInventario As Integer, EsPaquete As Integer, CveSATPS As Integer, CveEmpresa As Integer, Optional CveTipoPS As Integer = -1, Optional TipoServicio As Integer = -1,
Optional CveClasificacion2 As Integer = -1, Optional CveMarca As Integer = -1, Optional AlmacenSeccion As String = "", Optional AplicaIEPS As Boolean = False, Optional IEPSPorcentaje As Decimal = -1,
Optional CveCompuesto As Integer = -1, Optional IEPSGrabaIVA As Boolean = False, Optional VentaMinima As Decimal = 0,
Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
@@ -643,7 +649,8 @@ Public Class ClsProductosServicios
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1,
Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False,
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0,
- Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1) As Boolean
+ Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1,
+ Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
@@ -677,6 +684,7 @@ Public Class ClsProductosServicios
.Add("@IEPSPorcentaje", SqlDbType.SmallMoney).Value = IEPSPorcentaje
.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
.Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
'Nuevo R: 26/09/2017'
.Add("@Inventariable", SqlDbType.Bit).Value = Inventariable
@@ -740,6 +748,11 @@ Public Class ClsProductosServicios
'Nuevo MLopez 18/11/2022
.Add("@CveTipoEmpacado", SqlDbType.Int).Value = CveTipoEmpacado
.Add("@CveTipoOrganico", SqlDbType.Int).Value = CveTipoOrganico
+ .Add("@NombreComercial", SqlDbType.VarChar).Value = NombreComercial
+ .Add("@NotasAdicionales", SqlDbType.VarChar).Value = NotasAdicionales
+ .Add("@EcommerceEtiquetas", SqlDbType.VarChar).Value = EcommerceEtiquetas
+ .Add("@ActivoEcommerce", SqlDbType.VarChar).Value = ActivoEcommerce
+ .Add("@EcommercePrecio", SqlDbType.SmallMoney).Value = EcommercePrecio
End With
diff --git a/App_Code/ClsProspectos.vb b/App_Code/ClsProspectos.vb
index 47fe6ac76..08aa72f85 100644
--- a/App_Code/ClsProspectos.vb
+++ b/App_Code/ClsProspectos.vb
@@ -658,7 +658,7 @@ Public Class ClsProspectos
.Add("@CveProspectoEstatus", SqlDbType.Int).Value = CveProspectoEstatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@FechaIng", SqlDbType.DateTime).Value = If(FechaIngreso = "-1", Now, FechaIngreso.ToDate)
+ .Add("@FechaIng", SqlDbType.DateTime).Value = If(FechaIngreso = "-1", ClsPaginas.NowADS(), FechaIngreso.ToDate)
.Add("@CveProspecto", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index 583e57ad7..fcc6dab3f 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -7085,7 +7085,7 @@ Public Class ClsRH
ListaTagsDocumentost.Add(New TagsDocumentos("{Estatura}", DtResultados(0)("Estatura").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{Peso}", DtResultados(0)("Peso").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{LugarNacimiento}", DtResultados(0)("LugarNacimiento").ToString))
- ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", If(DtResultados(0)("Edad").ToString = "", If(DtResultados(0)("FechaNacimiento").ToString = "", "", DateDiff(DateInterval.Year, DtResultados(0)("FechaNacimiento").ToString.ToDate, Now.Date).ToString), DtResultados(0)("Edad").ToString)))
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", If(DtResultados(0)("Edad").ToString = "", If(DtResultados(0)("FechaNacimiento").ToString = "", "", DateDiff(DateInterval.Year, DtResultados(0)("FechaNacimiento").ToString.ToDate, ClsPaginas.NowADS().Date).ToString), DtResultados(0)("Edad").ToString)))
ListaTagsDocumentost.Add(New TagsDocumentos("{NombreTelEmergencia}", DtResultados(0)("NombreTelEmergencia").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{TipoSangre}", DtResultados(0)("TipoSangre").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{SubProyecto}", DtResultados(0)("SubProyecto").ToString))
@@ -7137,8 +7137,8 @@ Public Class ClsRH
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaNacimiento}", DtResultados(0)("FechaNacimiento").ToString.ToDate.ToString("dd/MM/yyyy")))
- Dim fechaActual As String = $" { Now.Day } de { MesTexto(Now.Month) } del año { Now.Year}"
- Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
+ Dim fechaActual As String = $" { ClsPaginas.NowADS().Day } de { MesTexto(ClsPaginas.NowADS().Month) } del año { ClsPaginas.NowADS().Year}"
+ Dim FechaActualDF As String = ClsPaginas.NowADS().ToString("dd/MM/yyyy")
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb
index 9e12c8c4c..7218f50ce 100644
--- a/App_Code/ClsSisEmpresas.vb
+++ b/App_Code/ClsSisEmpresas.vb
@@ -440,6 +440,8 @@ Public Class ClsSisEmpresas
_Empresa.FielPassword = Data.Rows(0)("FielPassword").ToString
_Empresa.FielPFX = Data.Rows(0)("FielPFX").ToString
_Empresa._RutaArchivos = Data.Rows(0)("RutaArchivos").ToString
+ _Empresa.CveZonaHoraria = Data.Rows(0)("CveZonaHoraria").ToString.ToEntero
+ _Empresa.UTCOffset = Data.Rows(0)("UTCOffset").ToString.ToEntero
Else
'Alert("No se encontró la Empresa solicitada.", TipoMensaje.MsgAdvertencia)
@@ -467,7 +469,7 @@ Public Class ClsSisEmpresas
CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer,
PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer,
Optional CveMetodoPago As Integer = 0, Optional CvePAC As Integer = 0,
- Optional RegistroCompleto As Boolean = False
+ Optional RegistroCompleto As Boolean = False, Optional CveZonaHoraria As Integer = -1
) As Boolean
Dim Retorno As Boolean = False
@@ -562,6 +564,7 @@ Public Class ClsSisEmpresas
.Add("@RequiereCentroCosto", SqlDbType.Bit).Value = RequiereCentroCosto
.Add("@PV_TerminalTipo", SqlDbType.Int).Value = PV_TerminalTipo
.Add("@Importe", SqlDbType.Decimal).Value = Importe
+ .Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria
End With
@@ -593,7 +596,7 @@ Public Class ClsSisEmpresas
Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, RegistroPatronal As String, AreaGeografica As String,
NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, CvePAC As Integer,
Importe As Decimal, CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer,
- PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer) As Boolean
+ PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer, Optional CveZonaHoraria As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -685,6 +688,8 @@ Public Class ClsSisEmpresas
.Add("@RequiereCentroCosto", SqlDbType.Bit).Value = RequiereCentroCosto
.Add("@PV_TerminalTipo", SqlDbType.Int).Value = PV_TerminalTipo
.Add("@Importe", SqlDbType.Decimal).Value = Importe
+ .Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria
+
End With
Try
@@ -1423,7 +1428,7 @@ Public Class ClsSisEmpresas
.Add("@AsuntoPlantilla", SqlDbType.VarChar).Value = NombreCampoBDAsuntoPlantilla
.Add("@ValorAsuntoPlantilla", SqlDbType.NVarChar).Value = AsuntoValor
.Add("@Plantilla", SqlDbType.VarChar).Value = NombreCampoBDPlantilla
- .Add("@ValorPlantilla", SqlDbType.NVarChar).Value = HTMLValorPlantilla
+ .Add("@ValorPlantilla", SqlDbType.VarChar).Value = HTMLValorPlantilla
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb
index a7169b443..26574baba 100644
--- a/App_Code/ClsSisNotificaciones.vb
+++ b/App_Code/ClsSisNotificaciones.vb
@@ -758,7 +758,7 @@ Public Class ClsSisNotificaciones
' RptParametro.Add(New ReportParameter("FechaInicio", RowParada("FechaInicio").ToString))
' RptParametro.Add(New ReportParameter("FechaFin", RowParada("FechaNotificacion").ToString))
' RptParametro.Add(New ReportParameter("UsuarioImprimio", RowParada("UsuarioImprimio").ToString))
- ' RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
+ ' RptParametro.Add(New ReportParameter("FechaImpresion", NowADS().ToShortDateString))
' RptParametro.Add(New ReportParameter("Grupo", RowParada("Grupo").ToString))
' Dim RowRep As DataRow = ObjGPS.DtResultados.FiltroPrimero("TipoColumna=1")
@@ -866,7 +866,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToShortDateString))
RptParametro.Add(New ReportParameter("MapaURL", ""))
RptParametro.Add(New ReportParameter("UsuarioImprimio", Correos))
- RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New ReportParameter("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
Retorno = StreamPDF(Liga, DataSource, RptParametro, "ReporteUltimaPosicion", "PDF", MR:=Nothing, RDSName:="DsOC")
Catch ex As Exception
@@ -920,7 +920,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
RptParametro.Add(New CrystalParametro("FechaFin", FechaF.ToString))
RptParametro.Add(New CrystalParametro("UsuarioImprimio", Correos))
- RptParametro.Add(New CrystalParametro("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New CrystalParametro("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
If DataSource.Rows.Count > 0 Then
RptParametro.Add(New CrystalParametro("KMRecorridos", $"{DataSource.Rows(0)("KMRecorridos")} KM"))
Else
@@ -1002,7 +1002,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToString))
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
RptParametro.Add(New ReportParameter("UsuarioImprimio", Correos))
- RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New ReportParameter("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
Retorno = StreamPDF(Liga, DataSource, RptParametro, "ReporteIgnicion", "PDF", MR:=Nothing, RDSName:="DsOC")
Catch ex As Exception
@@ -1075,7 +1075,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
RptParametro.Add(New CrystalParametro("FechaFin", FechaF.ToString))
RptParametro.Add(New CrystalParametro("UsuarioImprimio", Correos))
- RptParametro.Add(New CrystalParametro("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New CrystalParametro("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
RptParametro.Add(New CrystalParametro("TiempoMuerto", "10 Min"))
Retorno = StreamPDFCrystal(Liga, DataSource, RptParametro, NombreReporte, "PDF")
@@ -1120,7 +1120,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToShortDateString))
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToShortDateString))
RptParametro.Add(New ReportParameter("UsuarioImprimio", Correos))
- RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New ReportParameter("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
Retorno = StreamPDF(Liga, DataSource, RptParametro, "ReporteRalenti", "PDF", MR:=Nothing, RDSName:="DsOC")
Catch ex As Exception
@@ -1171,7 +1171,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
RptParametro.Add(New CrystalParametro("FechaFin", FechaF.ToString))
RptParametro.Add(New CrystalParametro("UsuarioImprimio", Correos))
- RptParametro.Add(New CrystalParametro("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New CrystalParametro("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
Retorno = StreamPDFCrystal(Liga, DataSource, RptParametro, "ReporteEvento", "PDF")
Catch ex As Exception
@@ -1227,7 +1227,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToShortDateString))
RptParametro.Add(New ReportParameter("UsuarioImprimio", Correos))
RptParametro.Add(New ReportParameter("MapaURL", ""))
- RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New ReportParameter("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
Retorno = StreamPDF(Liga, DataSource, RptParametro, "ReporteGeoReferencias", "PDF", MR:=Nothing, RDSName:="DsOC")
Catch ex As Exception
@@ -1247,7 +1247,7 @@ Public Class ClsSisNotificaciones
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToShortDateString))
RptParametro.Add(New ReportParameter("UsuarioImprimio", Correos))
RptParametro.Add(New ReportParameter("MapaURL", ""))
- RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
+ RptParametro.Add(New ReportParameter("FechaImpresion", ClsPaginas.NowADS().ToShortDateString))
Retorno = StreamPDF(Liga, DataSource, RptParametro, "ReportePuntosInteres", "PDF", MR:=Nothing, RDSName:="DsOC")
Catch ex As Exception
@@ -1709,7 +1709,7 @@ Public Class ClsSisNotificaciones
.lat = Lat,
.lng = Lng
},
- .timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+ .timestamp = ClsPaginas.NowADS().ToString("yyyy-MM-dd HH:mm:ss")
}
}
}
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 56877acac..cfa37b684 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -3387,7 +3387,7 @@ Public Class ClsVentas
Dim Resp As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(Usuario.Empresa, FolioFiscal, Total, RFCReceptor, Usuario.Empresa.RFC)
If Resp.Verificado Then
- If Not ObjVentas.UpdateEstatusFactura(5, FolioFiscal, ObjCancelacion.CancelacionAcuse, Now, PCveVenta.ToEntero, -1, CvePAC:=Usuario.Empresa.CvePAC) Then
+ If Not ObjVentas.UpdateEstatusFactura(5, FolioFiscal, ObjCancelacion.CancelacionAcuse, ClsPaginas.NowADS(), PCveVenta.ToEntero, -1, CvePAC:=Usuario.Empresa.CvePAC) Then
CveVentasError.Add(PCveVenta.ToEntero)
End If
Else
diff --git a/App_Code/Empresa.vb b/App_Code/Empresa.vb
index f1fa5817d..ff38fa730 100644
--- a/App_Code/Empresa.vb
+++ b/App_Code/Empresa.vb
@@ -134,6 +134,9 @@ Public Class Empresa
Public Property FielPassword As String
Public Property FielPFX As String
Public Property AsuntoPlantillaMailVentaCotizacion As String
+
+ Public Property UTCOffset As Integer
+ Public Property CveZonaHoraria As Integer
Public Property PlantillaMailVentaCotizacion As String
Dim Funcionalidades As HybridDictionary
'HybridDictionary, no se puede serializar, por eso no es propiedad, y se utilizar el setfuncionalidad, para asignarle valor
diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb
index 1bc6491c8..8d486b968 100644
--- a/App_Code/LogicNominas.vb
+++ b/App_Code/LogicNominas.vb
@@ -426,7 +426,7 @@ Public Class LogicNominas
Dim otrp = New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()}
If Row("SATCveConcepto").ToString().ToEntero() = 4 Then
- otrp.ejercicio = DateTime.Now.Year - If(DateTime.Now.Month = 12, 0, 1)
+ otrp.ejercicio = ClsPaginas.NowADS().Year - If(ClsPaginas.NowADS().Month = 12, 0, 1)
otrp.SaldoAFavor = Row("ImporteValor").ToString().ToDecimal().Abs()
otrp.RemanenteSalFav = Row("ImporteValor").ToString().ToDecimal().Abs() - Row("Importe").ToString().ToDecimal().Abs()
End If
@@ -463,7 +463,7 @@ Public Class LogicNominas
cfdi.Comprobante.Version = If(versionTimbre = VersionTimbradoEnum.Version4_0, "4.0", "3.3")
cfdi.Comprobante.Serie = Serie
cfdi.Comprobante.Folio = Folio
- cfdi.Comprobante.Fecha = Now
+ cfdi.Comprobante.Fecha = ClsPaginas.NowADS()
cfdi.Comprobante.SubTotal = subTotalDb 'cfdi.Nomina.TotalPercepciones.ToString().ToDecimal() + cfdi.Nomina.TotalOtrosPagos.ToString().ToDecimal()
cfdi.Comprobante.Descuentos = cfdi.Nomina.TotalDeducciones.ToString().ToDecimal()
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 7860b5459..4ab7ac9a0 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -562,12 +562,12 @@ Namespace Modelos
Me.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda} ")
Me.RefDocto = ""
' Me.CveMesa = -1
- Me.Fecha = Now
+ Me.Fecha = ClsPaginas.NowADS()
Me.CvePrePoliza = -1
- Me.FechaPago = Now
+ Me.FechaPago = ClsPaginas.NowADS()
Me.MotivoDescuento = ""
Me.Observaciones = ""
- Me.FechaEjecucion = Now
+ Me.FechaEjecucion = ClsPaginas.NowADS()
Me.CveCondicionEntrega = -1
Me.CondicionEntrega = ""
Me.NumeroCuenta = ""
@@ -1292,12 +1292,12 @@ Namespace Modelos
ObjFactura.CveMoneda = CveMoneda
ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
- ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(Now).ToDecimal())
+ ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal())
ObjFactura.TipoDocto = "Ing"
ObjFactura.RefDocto = ""
ObjFactura.Folio = -1
ObjFactura.Serie = "-1"
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = ClsPaginas.NowADS()
ObjFactura.CvePrePoliza = -1
ObjFactura.CveMetodoPago = 1
ObjFactura.MetodoPago = "Efectivo"
@@ -2942,7 +2942,7 @@ Namespace Modelos
Dim CveMovimiento As Integer = -1
Try
Dim CveConceptoSalidaUsado As Integer = 45
- Dim tFecha As DateTime = Now
+ Dim tFecha As DateTime = ClsPaginas.NowADS()
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacenUsado, CveConceptoSalidaUsado, 1, tFecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, factura.CveVenta,
factura.CveSubProyecto, CveActivoFijo:=-1, Guia:="", Observaciones:="", CvePersonal:=-1, CveCliente:=factura.CveCliente, CveClienteSucursal:=-1, Modulo:="M/CU")
If CveMovimiento <= 0 Then
@@ -3140,7 +3140,7 @@ Namespace Modelos
Dim TCFluctuacion As Decimal = tipoCambio
'TOMA EL TC DE LA ULTIMA FLUCTUACION
If ValorMultiplicador = -1 AndAlso esMesAnterior AndAlso UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso ObjFactura.CveMoneda = 2 Then
- Dim UltimaFluctuacion As ClsPaginas.MTipoCambioFluctuacion = ClsPaginas.GlobalTipoCambioUltimaFluctuacion(Now)
+ Dim UltimaFluctuacion As ClsPaginas.MTipoCambioFluctuacion = ClsPaginas.GlobalTipoCambioUltimaFluctuacion(ClsPaginas.NowADS())
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= FechaCancelacion Then
@@ -4274,7 +4274,7 @@ Namespace Modelos
End If
' GENERA EL MOVIMIENTO DE GARANTIA SI TIENE
- If Not GenerarMovimientoGarantia(14, "Entrada Garantía", Now, factura, ObjAcum, ObjInventario, ObjConta) Then
+ If Not GenerarMovimientoGarantia(14, "Entrada Garantía", ClsPaginas.NowADS(), factura, ObjAcum, ObjInventario, ObjConta) Then
OcurrioError = True
End If
@@ -4532,7 +4532,7 @@ Namespace Modelos
Dim ContadorMovtosDetalles As Integer = 0
'Creamos el movimiento
- Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Mod/M2")
+ Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Mod/M2")
If CveMovimientoInventario > 0 Then
@@ -5061,7 +5061,7 @@ Namespace Modelos
End If
'CANCELA FACTURA
- If Month(factura.Fecha) = Month(Now) OrElse BanderaGeneraNC = True Then
+ If Month(factura.Fecha) = Month(ClsPaginas.NowADS()) OrElse BanderaGeneraNC = True Then
If CancelarFactura(ObjVentas, ObjConta, ObjBancos) Then
Obj.Add(factura)
Else
@@ -5069,7 +5069,7 @@ Namespace Modelos
End If
Else
FacturaDevolucion.TipoDocto = "Egs"
- FacturaDevolucion.Fecha = Now
+ FacturaDevolucion.Fecha = ClsPaginas.NowADS()
If RegistrarNC(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, TmpDTconceptos, ObjEventos) Then
Obj.Add(FacturaDevolucion)
Else
@@ -5420,13 +5420,13 @@ Namespace Modelos
CancelacionFecha = xmlAcuse.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate()
CveEstatus = 5
Else
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CancelacionAcuse = ""
CveEstatus = 5
End If
Catch ex As Exception
GuardaLog(ex.ToString())
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CancelacionAcuse = ""
End Try
@@ -5436,7 +5436,7 @@ Namespace Modelos
If Resp.Verificado Then
'GENERAMOS EL ACUSE Y MANDAMOS MAIL DE CON EL ACUSE DE CANCELACIÓN
If RequiereAceptacion Then
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CveEstatus = 20
Else
CancelacionFecha = ObjCancelacion.CancelacionFecha
@@ -5478,7 +5478,7 @@ Namespace Modelos
CveEstatus = 20
ContinuarCancelacion = False
RequiereAceptacion = True
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CancelacionAcuse = ""
End If
End If
@@ -5491,7 +5491,7 @@ Namespace Modelos
Else
ObtenerAcuse = False
ContinuarCancelacion = True
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CancelacionAcuse = ""
'VERICA SI YA SE TIENE EL ESTADO DE CANCELACION, PARA SABER SI REQUIERE ACEPTACION
@@ -5502,7 +5502,7 @@ Namespace Modelos
RequiereAceptacion = True
End If
Else
- Dim diasTimbrado As Decimal = DateDiff(DateInterval.Day, ObjFactura.FechaCP, Now)
+ Dim diasTimbrado As Decimal = DateDiff(DateInterval.Day, ObjFactura.FechaCP, ClsPaginas.NowADS())
If ObjFactura.Total < 1000D OrElse diasTimbrado <= 1 OrElse ObjFactura.Cliente.RFC.Contiene("XAXX010101000", "XEXX010101000") Then
RequiereAceptacion = False
@@ -5517,7 +5517,7 @@ Namespace Modelos
If Resp.Verificado Then
'GENERAMOS EL ACUSE Y MANDAMOS MAIL DE CON EL ACUSE DE CANCELACIÓN
'If Resp.cve Then
- ' CancelacionFecha = Now.Date
+ ' CancelacionFecha = ClsPaginas.NowADS().Date
' CveEstatus = 20
'Else
' CancelacionFecha = ObjCancelacion.CancelacionFecha
@@ -5534,16 +5534,16 @@ Namespace Modelos
Return Retorno
End If
Else
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CancelacionAcuse = ""
End If
End If
Else
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CancelacionAcuse = ""
End If
Else
- CancelacionFecha = Now.Date
+ CancelacionFecha = ClsPaginas.NowADS().Date
CancelacionAcuse = ""
End If
Catch ex As Exception
@@ -5558,7 +5558,7 @@ Namespace Modelos
End Try
Else
CveEstatus = CveEstatusFacturaAsignado
- CancelacionFecha = If(IsDate(FechaCancelacion), FechaCancelacion, Now.ToString("dd/MM/yyyy")).ToDateTime()
+ CancelacionFecha = If(IsDate(FechaCancelacion), FechaCancelacion, ClsPaginas.NowADS().ToString("dd/MM/yyyy")).ToDateTime()
CancelacionAcuse = AcuseCancelacion
End If
@@ -5794,7 +5794,7 @@ Namespace Modelos
'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION
If ObjFactura.SaldoAlmacen <> 0 Then
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
- CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="Mod/CV1")
+ CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="Mod/CV1")
Folio = ObjInventario.Folio
If CveMovimientoDevolucion > 0 Then
@@ -5837,7 +5837,7 @@ Namespace Modelos
End If
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
- Dim Fecha As Date = Now
+ Dim Fecha As Date = ClsPaginas.NowADS()
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
@@ -5890,7 +5890,7 @@ Namespace Modelos
End If
End If
Else
- ErrorCancelar = True
+ ErrorCancelar = True
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
End If
End If
@@ -6025,7 +6025,7 @@ Namespace Modelos
'CANCELAR MOVIMIENTOS DE GARANTIA SI TIENE
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
- If Not GenerarMovimientoGarantia(15, "Salida Garantía", Now, ObjRemision, ObjAcum, ObjInventario, ObjConta) Then
+ If Not GenerarMovimientoGarantia(15, "Salida Garantía", ClsPaginas.NowADS(), ObjRemision, ObjAcum, ObjInventario, ObjConta) Then
ErrorCancelar = True
End If
End If
@@ -6134,7 +6134,7 @@ Namespace Modelos
'CANCELAR MOVIMIENTOS DE GARANTIA SI TIENE
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
- If Not GenerarMovimientoGarantia(15, "Salida Garantía", Now, ObjFactura, ObjAcum, ObjInventario, ObjConta) Then
+ If Not GenerarMovimientoGarantia(15, "Salida Garantía", ClsPaginas.NowADS(), ObjFactura, ObjAcum, ObjInventario, ObjConta) Then
ErrorCancelar = True
End If
End If
@@ -6297,7 +6297,7 @@ Namespace Modelos
End If
Else
If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion,
- CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm"), CveMotivoCancelacion:=CveMotivoCancelacion,
+ CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=ClsPaginas.NowADS().ToString("yyyy-MM-dd HH:mm:ss.mmm"), CveMotivoCancelacion:=CveMotivoCancelacion,
MotivoCancelacion:=MotivoCancelacion, EstadoCancelacion:=EstadoCancelacion, CveEstadoCancelacion:=CveEstadoCancelacion, SelloSolicitudDigitalSAT:=SolicitudCancelacionAcuse) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al guardar el estatus de cancelación."
@@ -6418,7 +6418,7 @@ Namespace Modelos
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
- CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
+ CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual")
If CveMovimientoVirtual > 0 Then
@@ -6497,7 +6497,7 @@ Namespace Modelos
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimientoDevolucion
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
- CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
+ CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual")
If CveMovimientoVirtual > 0 Then
@@ -6585,11 +6585,11 @@ Namespace Modelos
End If
'SALIDA GENERAL
- CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem, Modulo:="Mod/ExAR1")
+ CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacenDevolucion, 8, 1, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem, Modulo:="Mod/ExAR1")
FolioMovimientoSalidaDevRem = ObjInventario.Folio
'ENTRADA ADELANTADO
- CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion, Modulo:="Mod/ExAR2")
+ CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, DrMovtos("CveRem").ToString.ToEntero, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=CveAlmacenDevolucion, Modulo:="Mod/ExAR2")
FolioMovimientoEntradaDevRem = ObjInventario.Folio
If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
@@ -6666,7 +6666,7 @@ Namespace Modelos
Dim CveMovimientoEntradaDevRem As Integer = 0
Dim FolioMovimientoEntradaDevRem As Integer = 0
- Dim Fecha As DateTime = Now
+ Dim Fecha As DateTime = ClsPaginas.NowADS()
'SALIDA DE (ENTREGA POR ADELANTADO)
CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveRemision, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Mod/CancExAR1")
@@ -6773,7 +6773,7 @@ Namespace Modelos
For Each Dr As DataRow In DtTempApartados.Rows
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString.ToEntero Then
- CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveVendedor:=1, CveCliente:=CveCliente, CveAlmacenDestino:=Dr("CveAlmacen").ToString.ToEntero, Modulo:="Mod/Apar1")
+ CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveVendedor:=1, CveCliente:=CveCliente, CveAlmacenDestino:=Dr("CveAlmacen").ToString.ToEntero, Modulo:="Mod/Apar1")
FolioSalida = ObjInventario.Folio
CveAlmacenApartado = Dr("CveAlmacen").ToString.ToEntero
@@ -6800,7 +6800,7 @@ Namespace Modelos
For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString.ToEntero
- CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString.ToEntero, 9, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", CveAlmacenDestino:=CveAlmacenDevolucion, CveMovimientoRelacionado:=CveMovimientoSalida, Guia:="", CveContrato:=CveContrato, CveVendedor:=-1, CveCliente:=CveCliente, Modulo:="Mod/Apar2")
+ CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString.ToEntero, 9, 1, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", CveAlmacenDestino:=CveAlmacenDevolucion, CveMovimientoRelacionado:=CveMovimientoSalida, Guia:="", CveContrato:=CveContrato, CveVendedor:=-1, CveCliente:=CveCliente, Modulo:="Mod/Apar2")
FolioEntrada = ObjInventario.Folio
If Not CveMovimientoEntradaApartado > 0 Then
@@ -6859,7 +6859,7 @@ Namespace Modelos
End If
- CvePrePoliza = ObjConta.AddPrePolizas("Modelos/GuardaEstatus", CvePlantillaPoliza, Me.Total, Me.Total, Me.CveMoneda, Now, Me.Cliente.NombreComercial, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CvePrePoliza = ObjConta.AddPrePolizas("Modelos/GuardaEstatus", CvePlantillaPoliza, Me.Total, Me.Total, Me.CveMoneda, ClsPaginas.NowADS(), Me.Cliente.NombreComercial, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
FacturaDevolucion.CveVenta = CveVenta
FacturaDevolucion.CvePrePoliza = CvePrePoliza
@@ -6879,7 +6879,7 @@ Namespace Modelos
If CveEstatus = 4 Then
- If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
+ If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", ClsPaginas.NowADS(), CveVenta, IDPoliza) Then
Mensaje = "El nuevo estatus se guardó correctamente"
Else
ErrorCancelar = True
@@ -6901,7 +6901,7 @@ Namespace Modelos
Dim Total As Decimal = Me.Total
Dim RFCReceptor As String = Me.Cliente.RFC
- If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", Now, CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
+ If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", ClsPaginas.NowADS(), CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
ErrorCancelar = True
End If
@@ -6920,7 +6920,7 @@ Namespace Modelos
'End If
If Not ErrorCancelar Then
- If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, Now, CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
+ If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, ClsPaginas.NowADS(), CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
Mensaje = "El nuevo estatus se guardó correctamente"
Else
ErrorCancelar = True
@@ -7007,7 +7007,7 @@ Namespace Modelos
' Else
' Dim DTPresupuestoIngresos As New DataTable
' Dim AC As New ClsAC
- ' If AC.GetPresupuestoIngresos(-1, Now.Year, True, UsuarioActual.CveEmpresa) Then
+ ' If AC.GetPresupuestoIngresos(-1, ClsPaginas.NowADS().Year, True, UsuarioActual.CveEmpresa) Then
' DTPresupuestoIngresos = AC.DtResultados.Copy()
' End If
' AC.Dispose()
@@ -7115,7 +7115,7 @@ Namespace Modelos
Public Property CvePAC As Integer
Public Property CveAnticipo As Integer
Public Property RemisionesLista As List(Of Integer)
- Public Property CveAlmacen As Integer
+ Public Property CveAlmacen As Integer = -1
Public Property GenerarSalidaAlmacen As Boolean = False
Public Property CveConceptoMovimiento As Integer
Public Property MovimientoObservaciones As String
@@ -7202,7 +7202,7 @@ Namespace Modelos
Public ReadOnly Property FechaCP As DateTime
Get
If Me.SubProyecto IsNot Nothing Then
- If Now.EsHorarioVerano Then
+ If ClsPaginas.NowADS().EsHorarioVerano Then
Return DateTime.UtcNow.AddHours(Me.SubProyecto.UTCOffsetVerano)
Else
Return DateTime.UtcNow.AddHours(Me.SubProyecto.UTCOffsetInvierno)
@@ -7323,7 +7323,7 @@ Namespace Modelos
Public Property TipoCambioDolares As Decimal
Public Property ConvertirPesos As Boolean
Public Property ConvertirDolares As Boolean
- Public Property FormaPago As Integer
+ Public Property FormaPago As Integer = 0
Public ReadOnly Property FormaPagoText As String
Get
@@ -7338,7 +7338,7 @@ Namespace Modelos
End Get
End Property
- Public Property CondicionesPago As Integer
+ Public Property CondicionesPago As Integer = 0 ' 0 - Contado, 1 - Credito (CHECAR)
Public ReadOnly Property CondicionesPagoText As String
Get
@@ -7589,10 +7589,10 @@ Namespace Modelos
Public Property NumeroContrato As String = ""
Public Property PedidoContrato As String = ""
Public Property OrdenCompra As String = ""
- Public Property CveMetodoPago As Integer
+ Public Property CveMetodoPago As Integer = 0
Public Property MetodoPago As String = ""
Public Property ClaveMetodoPagoSAT As String = ""
- Public Property CveMetodoPago33 As Integer
+ Public Property CveMetodoPago33 As Integer = 1
Public Property MetodoPago33 As String = ""
Public Property CveFormaPago33 As Integer
Public Property MetodoPagoSAT33 As String = ""
diff --git a/App_Code/Thalamus.vb b/App_Code/Thalamus.vb
index a8a3c4468..a5dcde4ca 100644
--- a/App_Code/Thalamus.vb
+++ b/App_Code/Thalamus.vb
@@ -16,7 +16,7 @@ Public Class Thalamus
Public Function GenerarArchivos(CveEmpresa As Integer) As Boolean
- Dim RutaArchivoVentas As String = $"C:\Temp\Ventas{Now.ToString("yyyyMMdd")}.xlsx"
+ Dim RutaArchivoVentas As String = $"C:\Temp\Ventas{ClsPaginas.NowADS().ToString("yyyyMMdd")}.xlsx"
Dim DTVentas As New DataTable
DTVentas.Columns.Add("systemId")
@@ -34,7 +34,7 @@ Public Class Thalamus
dr(0) = $"systemId {x}"
dr(1) = $"Branch {x}"
dr(2) = $"{x}"
- dr(3) = $"{Now.ToString("yyyy-MM-dd")}"
+ dr(3) = $"{ClsPaginas.NowADS().ToString("yyyy-MM-dd")}"
dr(4) = $"{x}"
dr(5) = $"{x}.00"
dr(6) = $"{x}"
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index c99190c6a..567b98f93 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -252,255 +252,6 @@ Public Class Timbrado
MsgCancelacion.AppendFormat("CvePAC:{0}", CvePACCancelacion)
Select Case CvePACCancelacion
- Case 1
- MsgCancelacion.AppendFormat("1.1")
- Try
- Dim CFDi As New ClbNegBICFDv3_2.ClsNegEDI
- Dim Respuesta As New ClbNegBICFDv3_2.ClsNegRespuesta
- Respuesta = CFDi.CancelaCFdi(Empresa.BIUsuario, Empresa.BIContraseña, Empresa.Ruta & "Certificados\" & Empresa.ArchivoPfx, Empresa.ContraseñaKey, Empresa.RFC, FolioFiscal, "http://portalbiinform.com.mx/srvCFDi/service1.asmx")
-
- If Respuesta IsNot Nothing AndAlso Respuesta.SelloSAT <> "" Then
- Dim xml64 As String = ""
- Dim myXml As String = Respuesta.SelloSAT
- Dim resp As XElement = XElement.Parse(myXml)
- For Each elem As XElement In resp.Descendants
- If elem.Name = "xmlBase64" Then xml64 = elem.Value
- Next
-
- 'If Respuesta.UUDI.Contiene("0", "201", "202") Then
- Dim xmlDoc As New System.Xml.XmlDocument()
- xmlDoc.LoadXml(If(xml64 = "", Respuesta.SelloSAT, Encoding.UTF8.GetString(Convert.FromBase64String(xml64))))
- Dim AcuseChild = xmlDoc.ChildNodes.Cast(Of XmlNode).Where(Function(a) a.Name.Equals("Acuse", StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault()
-
- Dim FoliosChild = AcuseChild.ChildNodes.Cast(Of XmlNode).Where(Function(a) a.LocalName.Equals("Folios", StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault()
- Dim SignatureChild = AcuseChild.ChildNodes.Cast(Of XmlNode).Where(Function(a) a.LocalName.Equals("Signature", StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault()
-
- Dim prefixFol As String = FoliosChild.Prefix
- If prefixFol <> "" Then prefixFol = $"{prefixFol}:" 'se le agregan los ":" si tiene prefijo
-
- CancelacionState = xmlDoc.GetElementsByTagName($"{prefixFol}EstatusUUID")(0).InnerText.ToEntero
- 'verificación basada en el resultado del xml.
- If CancelacionState.Contiene(201, 202) Then
-
- Dim prefixSig = SignatureChild.Prefix
- If prefixSig <> "" Then prefixSig = $"{prefixSig}:" 'se le agregan los ":" si tiene prefijo
- Dim SignatureValue = xmlDoc.GetElementsByTagName($"{prefixSig}SignatureValue")
- CancelacionAcuse = If(SignatureValue.Count < 1, SignatureValue(0).InnerText, SignatureValue(0).InnerText)
- Try
- CancelacionFecha = AcuseChild.Attributes("Fecha").Value.ToDate
- Catch ex As Exception
- CancelacionFecha = xmlDoc.GetElementsByTagName("CancelaCFDResult")(0).Attributes("Fecha").Value.ToDate
- End Try
-
- Retorno.Verificado = True
- Retorno.CancelacionFecha = CancelacionFecha
- Retorno.CancelacionAcuse = CancelacionAcuse
- End If
-
- 'End If
-
- Else
- Me.GuardaLog(CFDi.MsgError)
- End If
- Respuesta = Nothing
- CFDi = Nothing
- Catch ex As Exception
- GuardaLog($"{ex.Message}")
- End Try
-
- Case 2
- MsgCancelacion.AppendFormat("2.1")
- Dim ArchivoLLave As String = $"{Empresa.Ruta}Certificados\{Empresa.ArchivoKey}"
- Dim ArchivoCertificado As String = $"{Empresa.Ruta}Certificados\{Empresa.ArchivoCer}"
- Dim UsuarioServicio As String = If(CvePACCancelacion = 2, Empresa.RFC, "rene.molina@adsistemas.mx")
- Dim ClaveServicio As String = If(CvePACCancelacion = 2, Empresa.RFC.ToLower, "rene2018")
- Dim Clave As String = Empresa.ContraseñaKey
- Dim UrlServicio As String = "" ' Produccion
- Select Case CvePACCancelacion
- Case 2
- UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL"
- Case 4
- UrlServicio = "http://192.168.0.2:8080/ADSistemas/Timbrado.asmx?WSDL"
- End Select
-
- If Not Empresa.FacturaProduccion Then
- ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key"
- ArchivoCertificado = $"{Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer"
- Select Case CvePACCancelacion
- Case 2
- UsuarioServicio = "fgomez"
- ClaveServicio = "12121212"
- UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL"
- Case 4
- UsuarioServicio = "UserTest"
- ClaveServicio = "1234567890"
- UrlServicio = "http://192.168.0.2:8080/ADSistemas/Timbrado.asmx?WSDL"
- End Select
- End If
-
-#Region "Valida"
- If Not File.Exists(ArchivoCertificado) Then
- Alert("El archivo de certificado no existe", TipoMensaje.MsgError)
- Retorno.Verificado = False
- End If
- If Not File.Exists(ArchivoLLave) Then
- Alert("El archivo de llave privada no existe", TipoMensaje.MsgError)
- Retorno.Verificado = False
- End If
- If Empresa.ContraseñaKey = "" Then
- Alert("La clave no puede ser vacía", TipoMensaje.MsgError)
- Retorno.Verificado = False
- End If
-#End Region
-
-#Region "Variables"
- Dim llaveByte As Byte(), certByte As Byte()
- Dim llaveBase64 As String = "", certBase64 As String = ""
- Dim cfdi As New RVCFDI.GeneraCFDI()
- Dim complemento As String = ""
- Dim complementoConcepto As String = ""
-
-#End Region
-
-#Region "Verifica"
- Try
- llaveByte = System.IO.File.ReadAllBytes(ArchivoLLave)
- llaveBase64 = Convert.ToBase64String(llaveByte)
- Catch ex As Exception
- Alert($"Error al leer la llave privada: {ex.Message}", TipoMensaje.MsgError)
- Retorno.Verificado = False
- End Try
-
-
- Try
- certByte = System.IO.File.ReadAllBytes(ArchivoCertificado)
- certBase64 = Convert.ToBase64String(certByte)
- Catch ex As Exception
- Alert($"Error al leer el certificado: {ex.Message}", TipoMensaje.MsgError)
- Retorno.Verificado = False
- End Try
-#End Region
-
-
- Dim base64 As String
- Dim ObjCancelacion As New RVCancelacion.Cancelacion()
-
- Dim xmlCancelacion As String = ObjCancelacion.crearXMLCancelacion(certBase64, llaveBase64, Clave, FolioFiscal)
- If (ObjCancelacion.MensajeDeError = "") Then
-
- base64 = CodificarABase64(xmlCancelacion)
-
- Dim objWS As RVCFDI.WSGeneraCFDI.Service = Nothing
- Dim objAuthSoapHD As RVCFDI.WSGeneraCFDI.AuthSoapHd
- Dim objResponse As RVCFDI.WSGeneraCFDI.StructCfd
- Dim objCancel As RVCFDI.WSGeneraCFDI.StructCancel
-
- Try
-
-
- 'Variables de consumo de servicio web
- objWS = New RVCFDI.WSGeneraCFDI.Service()
- objAuthSoapHD = New RVCFDI.WSGeneraCFDI.AuthSoapHd()
- 'creacion de Autorizacion de cabecera Soap
- objCancel = New RVCFDI.WSGeneraCFDI.StructCancel()
- 'Configura el servicio
- objWS.Url = UrlServicio
-
- objAuthSoapHD.strPassword = ClaveServicio
- objAuthSoapHD.strUserName = UsuarioServicio
- 'Coloca la cabecera
- objWS.AuthSoapHdValue = objAuthSoapHD
- 'Obtiene el resultado
- objCancel = objWS.CancelTicket(base64)
- 'Valida la respuesta
- ''Codigos del SAT
- ''201 - El folio se ha cancelado con éxito.
- ''202 - El CFDI ya había sido cancelado previamente.
- ''203 - UUID no corresponde al emisor.
- ''204 - El CFDI no aplica para cancelación.
- ''205 - El UUID no existe o no ha sido procesado por el SAT.
- ''402 - El Contribuyente no se encuentra el la LCO o la validez de obligaciones se reporta como negativa.
- CancelacionState = objCancel.state
- CancelacionMensaje = objCancel.Descripcion
-
- If objCancel.state.Contiene(0, 201, 202) Then
- CancelacionFecha = Now
-
- Select Case CvePACCancelacion
- Case 2
- Dim solicitud As New WSRVConsultas.Service1SoapClient
- Dim resp As New WSRVConsultas.resp_Acuse()
- resp = solicitud.ConsultarAcuseCancelacion(RFCEmisor, UsuarioServicio, ClaveServicio, FolioFiscal, CancelacionFecha.ToShortDateString)
- CancelacionMensaje = objCancel.Descripcion
-
- If (resp.Estado = 0) Then
-
- Dim xmlDoc As New System.Xml.XmlDocument()
- xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml)))
- Dim xpath As String = "Acuse/Folios"
- Dim nodes As XmlNodeList = xmlDoc.SelectNodes(xpath)
- CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
-
- xpath = "Acuse/Signature"
- nodes = xmlDoc.SelectNodes(xpath)
-
- CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText
- CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate
- Retorno.Verificado = True
- Retorno.CancelacionFecha = CancelacionFecha
- Retorno.CancelacionAcuse = CancelacionAcuse
- Else
- CancelacionAcuse = resp.MensajeDeError
- Retorno.Verificado = True
- Retorno.CancelacionFecha = CancelacionFecha
- Retorno.CancelacionAcuse = CancelacionAcuse
- End If
- solicitud = Nothing
- Case 4
-
- Dim solicitud As New WSGF.Service1SoapClient
- Dim resp As New WSGF.StructXml()
- resp = solicitud.GetAcuse(RFCEmisor, UsuarioServicio, ClaveServicio, FolioFiscal)
- CancelacionMensaje = objCancel.Descripcion
-
- If (resp.Estado = 0) Then
-
- Dim xmlDoc As New System.Xml.XmlDocument()
- xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resp.CfdiB64)))
- Dim xpath As String = "Acuse/Folios"
- Dim nodes As XmlNodeList = xmlDoc.SelectNodes(xpath)
- CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
-
- xpath = "Acuse/Signature"
- nodes = xmlDoc.SelectNodes(xpath)
-
- CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText
- CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate
- Retorno.Verificado = True
- Retorno.CancelacionFecha = CancelacionFecha
- Retorno.CancelacionAcuse = CancelacionAcuse
- Else
- CancelacionAcuse = resp.Descripcion
- Retorno.Verificado = True
- Retorno.CancelacionAcuse = CancelacionAcuse
- End If
- solicitud = Nothing
- End Select
-
-
- End If
- Catch ex As Exception
- CancelacionMensaje += $" | ex: {ex}"
- Retorno.Verificado = False
- End Try
-
- 'Libera memoria
- objWS.Dispose()
- objResponse = Nothing
- objAuthSoapHD = Nothing
- GC.Collect()
- End If
-
Case 3
MsgCancelacion.AppendFormat("3.1")
@@ -522,7 +273,6 @@ Public Class Timbrado
AmbienteProductivo = False
End If
-
#Region "Valida"
If Not File.Exists(ArchivoCertificado) Then
Alert("El archivo de certificado no existe", TipoMensaje.MsgError)
@@ -537,7 +287,6 @@ Public Class Timbrado
Retorno.Verificado = False
End If
#End Region
-
Dim conector As New Profact.TimbraCFDI40.Conector(AmbienteProductivo)
If Not AmbienteProductivo Then
@@ -545,16 +294,17 @@ Public Class Timbrado
Else
conector.EstableceCredenciales("vSGxMFWnNRy/nDoowxqrqw==|Sia123654")
End If
- MsgCancelacion.AppendFormat("-3.2")
- Dim resultadoCancelacion As Profact.TimbraCFDI.ResultadoCancelacion
- resultadoCancelacion = conector.CancelaCFDI40(RFCEmisor, FolioFiscal, CodigoSATMotivoCancelacion, FolioSustitucion)
- CancelacionFecha = Now
Dim resp As Profact.TimbraCFDI.ResultadoConsulta
+ MsgCancelacion.AppendFormat("-3.2")
+ Dim resultadoCancelacion As Profact.TimbraCFDI.ResultadoCancelacionAck
+ resultadoCancelacion = conector.CancelaCFDIAck40(RFCEmisor, FolioFiscal, CodigoSATMotivoCancelacion, FolioSustitucion)
+ CancelacionFecha = ClsPaginas.NowADS()
+
resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal)
MsgCancelacion.AppendFormat("-3.3")
'VERIFICA SI SE CANCELO O FUE CANCELADO PREVIAMENTE (CODIGO DE ERROR "330279")
- If resultadoCancelacion.Exitoso OrElse resultadoCancelacion.NumeroError.Contiene("202", "330279") Then
+ If resultadoCancelacion.Exitoso OrElse resultadoCancelacion.NumeroError.Contiene("202", "330279", "330280") Then
MsgCancelacion.AppendFormat("-3.4")
CancelacionMensaje = resultadoCancelacion.Descripcion
Retorno.CancelacionFecha = CancelacionFecha
@@ -563,7 +313,7 @@ Public Class Timbrado
MsgCancelacion.AppendFormat("-3.4.1")
Try
- xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml)))
+ xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resultadoCancelacion.Xml)))
Catch ex As Exception
If resp.NumeroError.ToEntero() > 0 Then
CancelacionMensaje = resp.Descripcion
@@ -592,13 +342,11 @@ Public Class Timbrado
Else
Retorno.Verificado = False
End If
-
-
Else
MsgCancelacion.AppendFormat("-3.5")
CancelacionAcuse = resp.NumeroError
CancelacionMensaje = resultadoCancelacion.Descripcion
- Retorno.Verificado = True
+ Retorno.Verificado = False
End If
Case 4
@@ -610,7 +358,6 @@ Public Class Timbrado
Dim Clave As String = Empresa.ContraseñaKey
Dim UrlServicio As String = "" ' Produccion
- 'UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
If Not Empresa.FacturaProduccion Then
@@ -620,9 +367,7 @@ Public Class Timbrado
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
'UrlServicio = "http://juancalderon-001-site6.ftempurl.com/cancelacion.asmx?WSDL"
-
End If
-
#Region "Valida"
If Not File.Exists(ArchivoCertificado) Then
Alert("El archivo de certificado no existe", TipoMensaje.MsgError)
@@ -644,8 +389,6 @@ Public Class Timbrado
Dim objCan As New GoFac.GoCfdi()
Dim complemento As String = ""
Dim complementoConcepto As String = ""
-
-
#End Region
#Region "Verifica"
@@ -656,8 +399,6 @@ Public Class Timbrado
Alert($"Error al leer la llave privada: {ex.Message}", TipoMensaje.MsgError)
Retorno.Verificado = False
End Try
-
-
Try
certByte = System.IO.File.ReadAllBytes(ArchivoCertificado)
certBase64 = Convert.ToBase64String(certByte)
@@ -667,7 +408,7 @@ Public Class Timbrado
End Try
#End Region
objCan.CancelacionCfdi = True
- objCan.FechaCancelacion = System.DateTime.Now.AddMinutes(-120) ' operación requerida para que no se presente problemas con fechas adelantadas del PAC
+ objCan.FechaCancelacion = ClsPaginas.NowADS().AddMinutes(-120) ' operación requerida para que no se presente problemas con fechas adelantadas del PAC
MsgCancelacion.AppendFormat("4.3-")
objCan.GeneraCancelacionB64(certBase64, llaveBase64, Clave, FolioFiscal, CodigoSATMotivoCancelacion, FolioSustitucion)
If (objCan.MensajeError = "") Then
@@ -759,11 +500,11 @@ Public Class Timbrado
If result IsNot Nothing Then
If result.statusOk Then
- Dim cancelacion = result.cancelaciones.First()
+ Dim cancelacion As PADECancelacion = result.cancelaciones.First()
If cancelacion IsNot Nothing Then
'EN PROCESO, CANCELABLE SIN ACEPTACION,CANCEALDO PREVIAMENTE
If cancelacion.codigo.Contiene("96", "201", "202") Then
- CancelacionFecha = Now
+ CancelacionFecha = ClsPaginas.NowADS()
CancelacionAcuse = result.acuseCancelBase64
Retorno.Verificado = True
@@ -1549,7 +1290,7 @@ Public Class Timbrado
Dim y As Integer = 0
- For Each Tras In ObjCFDITimbre.Traslados
+ For Each Tras As CFDITraslados In ObjCFDITimbre.Traslados
comprobante.Impuestos.Traslados(y) = New Profact.TimbraCFDI40.ComprobanteImpuestosTraslado()
comprobante.Impuestos.Traslados(y).Base = Tras.Base.RoundSQL(NumDecimalesImporte)
comprobante.Impuestos.Traslados(y).Impuesto = Tras.Impuesto
@@ -1588,7 +1329,7 @@ Public Class Timbrado
If ObjCFDITimbre.RetencionesLocales.Sum(Function(x) x.Importe) > 0 Then
- Dim Imp = New Profact.TimbraCFDI.Complementos.ImpuestoLocal.ImpuestosLocales()
+ Dim Imp As New Profact.TimbraCFDI.Complementos.ImpuestoLocal.ImpuestosLocales()
Imp.version = "1.0"
Imp.TotaldeRetenciones = ObjCFDITimbre.RetencionesLocales.Sum(Function(x) x.Importe).FormatoNumero().ToDecimal
Imp.TotaldeTraslados = 0
@@ -2064,7 +1805,7 @@ Public Class Timbrado
Dim j As Integer = 0
ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta = New ProfactCartaPorte.CartaPorteMercanciasMercanciaCantidadTransporta(Carta.Mercancias.Mercancias.Count - 1) {}
- For Each transp In concep.MercanciasCantidadTransporta
+ For Each transp As CFDICartaPorteMercanciaTransporta In concep.MercanciasCantidadTransporta
ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(j) = New ProfactCartaPorte.CartaPorteMercanciasMercanciaCantidadTransporta
ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(j).Cantidad = transp.Cantidad
ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(j).IDOrigen = transp.IDOrigen
@@ -2484,7 +2225,7 @@ Public Class Timbrado
If Not String.IsNullOrEmpty(resultadoTimbre.Detalle) Then
Try
- Dim Resultados = Newtonsoft.Json.Linq.JArray.Parse(resultadoTimbre.Detalle)
+ Dim Resultados As JArray = Newtonsoft.Json.Linq.JArray.Parse(resultadoTimbre.Detalle)
If Resultados.Count > 0 Then
If resultadoTimbre.Descripcion.Contains("RFC del receptor no existe") Then
@@ -2620,13 +2361,13 @@ Public Class Timbrado
If ObjCFDITimbre.Retenciones.Sum(Function(x) x.Importe) > 0 Then
''se acumulan los importes
- For Each Ret In ObjCFDITimbre.Retenciones
+ For Each Ret As CFDIRetenciones In ObjCFDITimbre.Retenciones
cfdi.Retencion(Ret.Impuesto, Ret.Importe)
Next
End If
''se acumulan los importes
- For Each Tras In ObjCFDITimbre.Traslados
+ For Each Tras As CFDITraslados In ObjCFDITimbre.Traslados
cfdi.Traslado(Tras.Base, Tras.Impuesto, Tras.TipoFactor, Tras.TasaOCuota, Tras.Importe)
Next
#End Region
@@ -2791,7 +2532,7 @@ Public Class Timbrado
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
If concep.ValorMercancia <= 0 Then concep.Moneda = ""
cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), If(concep.ClaveMaterialPeligroso <> "", concep.DescripEmbalaje, ""), concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
- For Each transp In concep.MercanciasCantidadTransporta
+ For Each transp As CFDICartaPorteMercanciaTransporta In concep.MercanciasCantidadTransporta
cfdi.CartaPorteCantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
Next
Next
@@ -3380,11 +3121,11 @@ Public Class Timbrado
#Region "Timbra"
If RespGeneracionXML = "" Then
'OBTENER EL XML DE LA VARIABLE PRIVADA "_xml" YA QUE NO ES ACCESIBLE POR MEDIO DE LA PROPIEDAD "XML" ANTES DE TIMBRAR
- Dim valorXML = ""
+ Dim valorXML As String = ""
Try
- Dim tipo = GetType(GoFac.Cfdi4)
- Dim info = tipo.GetField("_xml", BindingFlags.NonPublic Or BindingFlags.Instance)
+ Dim tipo As Type = GetType(GoFac.Cfdi4)
+ Dim info As FieldInfo = tipo.GetField("_xml", BindingFlags.NonPublic Or BindingFlags.Instance)
valorXML = info?.GetValue(cfdi).ToString()
Catch ex As Exception
valorXML = ""
@@ -3589,8 +3330,8 @@ Public Class Timbrado
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
- strLineaTMP = String.Format("{0}{1} .. PAC: {2} - {3} ..{4}:{5}", Chr(13), Chr(10), CvePAC, Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
+ ' strLineaTMP = Chr(13) & Chr(10) & Day(NowADS()) & "/" & Month(NowADS()) & "/" & Year(NowADS()) & " " & Hour(NowADS()) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
+ strLineaTMP = String.Format("{0}{1} .. PAC: {2} - {3} ..{4}:{5}", Chr(13), Chr(10), CvePAC, Str, ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\LogTimbrado.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb
index 70a2d5346..ceee944a6 100644
--- a/App_Code/Timbres.vb
+++ b/App_Code/Timbres.vb
@@ -56,9 +56,9 @@ Public Class Timbres
ObjFactura.TipoDocto = TipoDocto
ObjFactura.TipoComprobante = "T"
- ObjFactura.Fecha = Now
- ObjFactura.FechaPago = Now
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.Fecha = ClsPaginas.NowADS()
+ ObjFactura.FechaPago = ClsPaginas.NowADS()
+ ObjFactura.FechaEjecucion = ClsPaginas.NowADS()
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.TipoDocumento = "Traspaso"
diff --git a/App_Code/Usuario.vb b/App_Code/Usuario.vb
index 4cc510cf0..a0adb072c 100644
--- a/App_Code/Usuario.vb
+++ b/App_Code/Usuario.vb
@@ -71,9 +71,9 @@ Public Class Usuario
Public ReadOnly Property FechaActualCliente As DateTime
Get
If UTCOffset <> 0 Then
- FechaActualCliente = DateTime.Now.AddMinutes(UTCOffset + 10)
+ FechaActualCliente = ClsPaginas.NowADS().AddMinutes(UTCOffset + 10)
Else
- FechaActualCliente = DateTime.Now
+ FechaActualCliente = ClsPaginas.NowADS()
End If
End Get
End Property
@@ -256,10 +256,10 @@ Namespace ADSSession
If Not IsNothing(HttpContext.Current) AndAlso Not IsNothing(HttpContext.Current.Session) AndAlso Not IsNothing(HttpContext.Current.Session(strsessionid)) Then
obj = DirectCast(HttpContext.Current.Session(strsessionid), ADSSessionObj)
obj.Modulo = modulo
- obj.LastPostback = DateTime.Now
+ obj.LastPostback = ClsPaginas.NowADS()
If _dicSessionobj.TryGetValue(obj.SessionID, obj) Then
obj.Modulo = modulo
- obj.LastPostback = DateTime.Now
+ obj.LastPostback = ClsPaginas.NowADS()
End If
retorno = obj
End If
@@ -321,7 +321,7 @@ Namespace ADSSession
Public Sub New(CveUsuario As Integer, CveEmpresa As Integer)
Me.CveUsuario = CveUsuario
Me.CveEmpresa = CveEmpresa
- FechaLogin = DateTime.Now
+ FechaLogin = ClsPaginas.NowADS()
_SessionID = ""
_ipAdrres = ""
Try
diff --git a/App_Code/WS/WSSIGVentas.vb b/App_Code/WS/WSSIGVentas.vb
index 981381e7c..6aa25860c 100644
--- a/App_Code/WS/WSSIGVentas.vb
+++ b/App_Code/WS/WSSIGVentas.vb
@@ -24,8 +24,8 @@ Namespace SIG
Dim respuesta As Data.DataTable = Nothing 'New With {.Correcto = False, .Mensaje = "", .Datos = New JObject}
Dim CveCliente As Integer = -1
- Dim FechaI As DateTime = DateTime.Now
- Dim FechaF As DateTime = DateTime.Now
+ Dim FechaI As DateTime = ClsPaginas.NowADS()
+ Dim FechaF As DateTime = ClsPaginas.NowADS()
Dim CveIE As Integer = -1
Dim CveVenta As Integer = -1
Dim opcion As Integer = -1
@@ -67,7 +67,7 @@ Namespace SIG
respuesta.AcceptChanges()
Dim thencommit As Boolean = True
Banco.IniciaTransacSQL()
- If Banco.AddComplementoPagosSinc(CveUsuario, DateTime.Now.ToString("yyyy/MM/dd"), CveEmpresa) Then
+ If Banco.AddComplementoPagosSinc(CveUsuario, ClsPaginas.NowADS().ToString("yyyy/MM/dd"), CveEmpresa) Then
Dim CveComplementoPagoSinc As Integer = Banco.DtResultados.Rows(0)("CveComplementoPagoSinc").ToString().ToEntero()
For Each dr As System.Data.DataRow In respuesta.Select("CveVenta Is NULL")
'CveComplementoPagoTimbre = Banco.AddComplementoPago(dr("CveIE").ToString().ToEntero(), -1, Serie, Folio, Me.CveUsuario, CveEmpresa, CvePrePoliza:=-1, Estatus:=1)
diff --git a/App_Code/WS/WSUSer.vb b/App_Code/WS/WSUSer.vb
index c6a207031..9f8f2f502 100644
--- a/App_Code/WS/WSUSer.vb
+++ b/App_Code/WS/WSUSer.vb
@@ -25,7 +25,7 @@ Namespace SIG
DateTime.TryParseExact(String.Format("{0} {1}", dataArray(2), dataArray(3)), "ddMMyyyy HHmm", New Globalization.CultureInfo("es-MX"), Globalization.DateTimeStyles.None, FechaPeticion)
Dim CveEmpresa As Integer = dataArray(4).ToEntero()
- Dim diferencia As Double = (FechaPeticion - DateTime.Now).TotalMinutes
+ Dim diferencia As Double = (FechaPeticion - ClsPaginas.NowADS()).TotalMinutes
Token = diferencia.ToString("N0").ToEntero()
End If
End If
diff --git a/App_Code/WS/WsUtility.vb b/App_Code/WS/WsUtility.vb
index f5cd97649..df875f411 100644
--- a/App_Code/WS/WsUtility.vb
+++ b/App_Code/WS/WsUtility.vb
@@ -25,7 +25,7 @@
' FechaPeticion = FechaPeticion.AddMinutes(Token)
' Dim CveEmpresa As Integer = dataArray(4)
- ' Dim diferencia As Integer = Math.Abs((FechaPeticion - DateTime.Now).TotalMinutes)
+ ' Dim diferencia As Integer = Math.Abs((FechaPeticion - NowADS()).TotalMinutes)
' If diferencia < 30 Then
' noautorizado = False
' End If
diff --git a/App_Code/WsSIGWeb.vb b/App_Code/WsSIGWeb.vb
index cee8000b4..d2c3bfe73 100644
--- a/App_Code/WsSIGWeb.vb
+++ b/App_Code/WsSIGWeb.vb
@@ -19,7 +19,7 @@ Public Class WsSIGWeb
End Function
Private Function notcurrentdate(fecha As DateTime) As Boolean
- Return Not (fecha > (DateTime.Now).AddMinutes(-15) And fecha < (DateTime.Now).AddMinutes(15))
+ Return Not (fecha > (ClsPaginas.NowADS()).AddMinutes(-15) And fecha < (ClsPaginas.NowADS()).AddMinutes(15))
End Function
diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb
index 0f5df56a9..644e8ed38 100644
--- a/App_Code/modExtensiones.vb
+++ b/App_Code/modExtensiones.vb
@@ -297,8 +297,8 @@ Namespace Extensiones
End If
Catch
End Try
- ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
- strLineaTMP = String.Format("{0}{1}Log: {5}{2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, Urlstring)
+ ' strLineaTMP = Chr(13) & Chr(10) & Day(NowADS()) & "/" & Month(NowADS()) & "/" & Year(NowADS()) & " " & Hour(NowADS()) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
+ strLineaTMP = String.Format("{0}{1}Log: {5}{2}{3}:{4}", Chr(13), Chr(10), Str, ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString, Urlstring)
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\Log.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
@@ -326,7 +326,7 @@ Namespace Extensiones
Public Sub GuardaLogAD(Mensaje As String, Optional Archivo As String = "Log")
Dim ArchivoW As StreamWriter
- Dim MensajeFormato = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, Now.ToString("dd/MM/yyyy HH:mm"))
+ Dim MensajeFormato = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, ClsPaginas.NowADS().ToString("dd/MM/yyyy HH:mm"))
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\{1}.txt", AppDomain.CurrentDomain.BaseDirectory, Archivo), True, System.Text.Encoding.UTF8)
@@ -352,7 +352,7 @@ Namespace Extensiones
Dim strLineaTMP As String
- strLineaTMP = String.Format("{0} {0}{3}{2}:{1}{0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto)
+ strLineaTMP = String.Format("{0} {0}{3}{2}:{1}{0}", Chr(13), ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString, pTexto)
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\Log.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As Exception
@@ -372,7 +372,7 @@ Namespace Extensiones
Public Sub GuardaLogMail(pTexto As String)
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto)
+ strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString, pTexto)
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\LogMail.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As Exception
@@ -391,8 +391,8 @@ Namespace Extensiones
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
- strLineaTMP = String.Format("{0}{1} .. PAC: {2} - Modulo: {3} ..{4}:{5}", Chr(13), Chr(10), CvePAC, Modulo, Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
+ ' strLineaTMP = Chr(13) & Chr(10) & Day(NowADS()) & "/" & Month(NowADS()) & "/" & Year(NowADS()) & " " & Hour(NowADS()) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
+ strLineaTMP = String.Format("{0}{1} .. PAC: {2} - Modulo: {3} ..{4}:{5}", Chr(13), Chr(10), CvePAC, Modulo, Str, ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\LogTimbrado.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
@@ -414,7 +414,7 @@ Namespace Extensiones
Public Sub GuardaLogCancelacionSAT(pTexto As String)
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString, pTexto)
+ strLineaTMP = String.Format("{0} {1}:{2} {3} {0}", Chr(13), ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString, pTexto)
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\LogCancelacionSAT.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
@@ -458,7 +458,7 @@ Namespace Extensiones
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.CurrentHandler IsNot Nothing AndAlso System.Web.HttpContext.Current.CurrentHandler.GetType().IsSubclassOf(GetType(Page)) Then
Dim Titulo As String = ""
- Dim Plus As String = DateTime.Now.Ticks.ToString
+ Dim Plus As String = ClsPaginas.NowADS().Ticks.ToString
Dim headerclas As String = ""
Dim showalert = True
@@ -545,7 +545,7 @@ Namespace Extensiones
script = String.Format("alertatoast({3},'{0}',function(){{{1}}},{2});", Mensaje, JSBtnAceptar, TimeoutToast, DirectCast(pOpcion, Integer))
End If
- ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), String.Format("Alert{0}", (DateTime.Now.Ticks + 1).ToString()), script, True)
+ ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), String.Format("Alert{0}", (ClsPaginas.NowADS().Ticks + 1).ToString()), script, True)
Pag = Nothing
Catch ex As Exception
Mensaje.GuardaLog(String.Format("Error Alert : {0}", Mensaje))
@@ -561,7 +561,7 @@ Namespace Extensiones
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.CurrentHandler IsNot Nothing Then
Dim Img, Botones As String
Dim Titulo As String
- Dim Plus As String = DateTime.Now.Ticks.ToString
+ Dim Plus As String = ClsPaginas.NowADS().Ticks.ToString
Mensaje = Mensaje.Replace("'"c, "\'").Replace(vbCrLf, "")
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
@@ -587,8 +587,8 @@ Namespace Extensiones
Try
Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.CurrentHandler, Page)
- 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
- ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (DateTime.Now.Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
+ 'ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (NowADS().Ticks + 1).ToString(), "MuestraAlert('" & Alerta.ToString() & "', '" & Plus & "');", True)
+ ScriptManager.RegisterStartupScript(Pag, Pag.GetType(), (ClsPaginas.NowADS().Ticks + 1).ToString(), String.Format("MuestraAlerta('{0}','{1}','{2}','{3}','{4}');", Titulo, Mensaje, Img, Botones, JSBtnAceptar), True)
Pag = Nothing
Catch ex As Exception
@@ -1782,7 +1782,7 @@ Namespace Extensiones
Public Sub GeneraChequePDF(pCveIE As Integer, tEmpresa As Empresa, Optional IDPoliza As Integer = -1, Optional MuestraAlert As Boolean = True)
Dim Folio, Observacion, UsuarioRegistro, TextoImporte, PagueseA, Ruta, Banco, NumCuenta, AbonoCuenta, SubProyecto, NotificarA, RefCrediproveedor As String
- Dim FechaExpedicion As Date = Now
+ Dim FechaExpedicion As Date = ClsPaginas.NowADS()
Dim Importe As Double
Dim tCveEmpresa As Integer = tEmpresa.CveEmpresa
Dim CveTipoTransaccion, CveProveedor, CvePersonal As Integer
@@ -2100,7 +2100,7 @@ Namespace Extensiones
worksheet.Rows(IndexEndTable + 1).Cells(1).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(3).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(3).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(3).Value = ClsPaginas.NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
@@ -2430,7 +2430,7 @@ Namespace Extensiones
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(6).Value = ClsPaginas.NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo($"{Usuario.Empresa.Ruta}/Logo.png")
@@ -2523,7 +2523,7 @@ Namespace Extensiones
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(6).Value = ClsPaginas.NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo($"{Usuario.Empresa.Ruta}/Logo.png")
@@ -2889,7 +2889,7 @@ Namespace Extensiones
If fechaI IsNot Nothing Or fechaF IsNot Nothing Then
table.AddCell(New Element.Paragraph(String.Format("Inicio: {0} Fin: {1}", fechaI, fechaF)).SetFontSize(10))
Else
- table.AddCell(New Element.Paragraph(String.Format("Fecha: {0}", Now.ToString("dd/MM/yyyy HH:mm"))).SetFontSize(10))
+ table.AddCell(New Element.Paragraph(String.Format("Fecha: {0}", ClsPaginas.NowADS().ToString("dd/MM/yyyy HH:mm"))).SetFontSize(10))
End If
document.Add(Borderless(table))
'FIN ENCABEZADO
@@ -2905,7 +2905,7 @@ Namespace Extensiones
'SECCIÓN PIE REPORTE
table = New Element.Table(UnitValue.CreatePercentArray(New Single() {2, 1.25}))
table.AddCell(New Element.Paragraph("Usuario imprimió: " + usuario.Nombre).SetFontSize(9))
- table.AddCell(New Element.Paragraph("Fecha de impresión: " + Now.ToString("dd/MM/yyyy")).SetTextAlignment(TextAlignment.RIGHT).SetFontSize(9))
+ table.AddCell(New Element.Paragraph("Fecha de impresión: " + ClsPaginas.NowADS().ToString("dd/MM/yyyy")).SetTextAlignment(TextAlignment.RIGHT).SetFontSize(9))
document.Add(Borderless(table))
'FIN PIE
@@ -2915,7 +2915,7 @@ Namespace Extensiones
If fechaI IsNot Nothing Or fechaF IsNot Nothing Then
HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment;filename={0} {1} a {2}.pdf", nombreReporte, fechaI.ToDate.ToString("dd-MM-yyyy"), fechaF.ToDate.ToString("dd-MM-yyyy")))
Else
- HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment;filename={0} {1}.pdf", nombreReporte, Now.ToString("dd-MM-yyyy")))
+ HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment;filename={0} {1}.pdf", nombreReporte, ClsPaginas.NowADS().ToString("dd-MM-yyyy")))
End If
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache)
'HtmlConverter.ConvertToPdf(sw.ToString(), HttpContext.Current.Response.OutputStream)
@@ -3892,7 +3892,7 @@ Namespace Extensiones
FechaPeticion = FechaPeticion.AddMinutes(Token)
Dim CveEmpresa As Integer = dataArray(4).ToEntero()
- Dim diferencia As Double = (FechaPeticion - DateTime.Now).TotalMinutes
+ Dim diferencia As Double = (FechaPeticion - ClsPaginas.NowADS()).TotalMinutes
diferencia = Math.Abs(diferencia)
If diferencia < 5 Then 'si la fecha que me envía es de cuando menos hace cinco minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
diff --git a/App_Code/wsRedes.vb b/App_Code/wsRedes.vb
index 23b68792a..f2e9d9462 100644
--- a/App_Code/wsRedes.vb
+++ b/App_Code/wsRedes.vb
@@ -45,7 +45,7 @@ Public Class wsRedes
' 'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- ' If Fecha > Now.AddSeconds(TiempoValido) Then
+ ' If Fecha > NowADS().AddSeconds(TiempoValido) Then
' Str.Append("-----xwsRed:3")
' 'debemos de saccar la clave electoral
@@ -136,7 +136,7 @@ Public Class wsRedes
Dim Fecha As DateTime
Fecha = ArrCadena(0).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Tipo As New ClsProspectos
diff --git a/App_Code/wsSIG.vb b/App_Code/wsSIG.vb
index 7ca8b9f0e..1991e6c6b 100644
--- a/App_Code/wsSIG.vb
+++ b/App_Code/wsSIG.vb
@@ -37,7 +37,7 @@ Public Class wsSIG
Usuario = ArrCadena(0) : Contrasenia = ArrCadena(1) : IMEI = ArrCadena(2) : Version = ArrCadena(3) : Fecha = ArrCadena(4).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim ttDato As Usuario
Dim tUsuario As New ClsSisUsuarios
@@ -88,7 +88,7 @@ Public Class wsSIG
validatesubproyecto = True
End If
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim ttDato As Usuario = Nothing
Using tUsuario As New ClsSisUsuarios()
@@ -141,7 +141,7 @@ Public Class wsSIG
' IMEI = ArrCadena(0) : Tipo = ArrCadena(1).ToEntero : Fecha = ArrCadena(2).ToString.ToDate
' 'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- ' If Fecha > Now.Addseconds(TiempoValido) Then
+ ' If Fecha > NowADS().Addseconds(TiempoValido) Then
' Dim tUsuario As New ClsSisUsuarios
@@ -166,7 +166,7 @@ Public Class wsSIG
Dim Fecha, FechaColonias As DateTime
IMEI = ArrCadena(0) : FechaColonias = ArrCadena(1).ToString.ToDate : Fecha = ArrCadena(2).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
'Dim Tipo As New ClsCircuitos
'ds = Tipo.GetTablas(IMEI, FechaColonias)
'Tipo.Dispose()
@@ -188,7 +188,7 @@ Public Class wsSIG
Dim Fecha As DateTime
IMEI = ArrCadena(0) : CveEmpresa = ArrCadena(1).ToString.ToEntero : Fecha = ArrCadena(2).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Prosp As New ClsProspectos
ds = Prosp.GetProspectosTablas(IMEI, CveEmpresa)
@@ -211,7 +211,7 @@ Public Class wsSIG
Dim Fecha As DateTime
CveUsuario = ArrCadena(0).ToEntero : IMEI = ArrCadena(1) : CveEmpresa = ArrCadena(2).ToString.ToEntero : Fecha = ArrCadena(3).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Evento As New ClsOIEventos
If Evento.GetAgendas(CveUsuario, CveEmpresa) Then
@@ -248,7 +248,7 @@ Public Class wsSIG
CveUsuarioIng = ArrCadena(26).ToEntero : CveEmpresa = ArrCadena(27).ToString.ToEntero : FechaEnvio = ArrCadena(28).ToString.ToDate
FechaEnvio = ArrCadena(29).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If FechaEnvio > Now.AddSeconds(TiempoValido) Then
+ If FechaEnvio > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Evento As New ClsOIEventos
If Evento.AddEvento(CveTipoEvento, CveAgendaTipo, Asunto, Descripcion, Prioridad, CveUsuarioDe, CveUsuarioPara, FechaInicio, FechaFin, 0, CveRevision, Archivo, CveUsuarioIng, CveEmpresa,
@@ -278,7 +278,7 @@ Public Class wsSIG
FechaFin = ArrCadena(0).ToDate : CveEstatusEvento = ArrCadena(1).ToEntero : Geom = ArrCadena(2) : CveEvento = ArrCadena(3).ToEntero : Fecha = ArrCadena(4).ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Evento As New ClsOIEventos
Retorno = Evento.FinalizaEvento(FechaFin, CveEstatusEvento, Geom, CveEvento)
@@ -306,7 +306,7 @@ Public Class wsSIG
Imagen = ArrCadena(0) : TipoImagen = ArrCadena(1).ToEntero : Cve = ArrCadena(2).ToEntero : pCveUsuario = ArrCadena(3).ToEntero : pCveEmpresa = ArrCadena(4).ToEntero : pIMEI = ArrCadena(5)
Fecha = ArrCadena(6).ToString.ToDate
Fecha.ToShortDateString().GuardaLog()
- If Fecha > Now.AddSeconds(TiempoValido) Then
+ If Fecha > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Dir As String = String.Format("{0}Empresas\{1}\", ModExtensiones.DirectorioBaseEmpresas, pCveEmpresa)
Dim Ruta As String = ""
Dim RutaDB3 As String = ""
@@ -412,7 +412,7 @@ Public Class wsSIG
CveProspectoTipo = ArrCadena(34).ToEntero : Geom = ArrCadena(35) : CveVendedor = ArrCadena(36).ToEntero : CveUsuario = ArrCadena(37).ToEntero : CveEmpresa = ArrCadena(38).ToEntero : FechaCaptura = ArrCadena(39).ToString.ToDate : FechaEnvio = ArrCadena(40).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If FechaEnvio > Now.AddSeconds(TiempoValido) Then
+ If FechaEnvio > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Str.Append("-----xwsAdd:3")
@@ -478,7 +478,7 @@ Public Class wsSIG
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If FechaEnvio > Now.AddSeconds(TiempoValido) Then
+ If FechaEnvio > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Str.Append("-----xwsAdd:3")
@@ -524,7 +524,7 @@ Public Class wsSIG
CveProspecto = ArrCadena(0).ToEntero : Nombres = ArrCadena(1) : CveVendedor = ArrCadena(2).ToEntero() : CveEmpresa = ArrCadena(5).ToEntero : FechaEnvio = ArrCadena(6).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If FechaEnvio > Now.AddSeconds(TiempoValido) Then
+ If FechaEnvio > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Str.Append("-----xwsAdd:3")
@@ -579,7 +579,7 @@ Public Class wsSIG
CveProspecto = ArrCadena(0).ToEntero : CveEmpresa = ArrCadena(1).ToEntero : FechaEnvio = ArrCadena(2).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If FechaEnvio > Now.AddSeconds(TiempoValido) Then
+ If FechaEnvio > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Prosp As New ClsProspectos
@@ -616,7 +616,7 @@ Public Class wsSIG
CveContrato = ArrCadena(0).ToEntero : CveEmpresa = ArrCadena(1).ToEntero : FechaEnvio = ArrCadena(2).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If FechaEnvio > Now.AddSeconds(TiempoValido) Then
+ If FechaEnvio > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Cont As New ClsContratos
@@ -650,7 +650,7 @@ Public Class wsSIG
CveContratoSeccion = ArrCadena(0).ToEntero : Geom = ArrCadena(1) : FechaEnvio = ArrCadena(2).ToString.ToDate
'si la fecha que me envía es de cuando menos hace un minuto, se permite accesar, para que no se copie ese parámetro y se esté recuperando información "medida de seguridad"
- If FechaEnvio > Now.AddSeconds(TiempoValido) Then
+ If FechaEnvio > ClsPaginas.NowADS().AddSeconds(TiempoValido) Then
Dim Cont As New ClsContratos
Cadena.GuardaLog()
diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx
index 60ef44198..d40007c3b 100644
--- a/Ashx/CargaEventos.ashx
+++ b/Ashx/CargaEventos.ashx
@@ -238,7 +238,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
If Not cevent.recurrenciatipo > 0 Then
'AGREGAMOS CUANDO NO ES RECURRENTE
- Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, Date.Now)
+ Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS())
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
If dr("FechaFin").ToString.ToDateTime > tFecha Or dr("FechaInicio").ToString.ToDateTime > tFecha Then
events.Add(cevent)
@@ -319,7 +319,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
End If
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL Y/0 SI LA FECHA INICIAL DE LA RECURRENCIA ES MENOR A LA FECHA QUE SE CREO EL EVENTO NO LO AGREGA
- If FIT > DateAdd(DateInterval.Month, -6, Date.Now) And FIT >= dr("FechaInicio").ToString.ToDateTime Then
+ If FIT > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) And FIT >= dr("FechaInicio").ToString.ToDateTime Then
events.Add(cevent)
End If
Next
@@ -359,7 +359,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
End If
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
- If FI > DateAdd(DateInterval.Month, -6, Date.Now) Then
+ If FI > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) Then
events.Add(cevent)
End If
End If
diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx
index 1928e7701..0a53e84c6 100644
--- a/Ashx/E119.ashx
+++ b/Ashx/E119.ashx
@@ -55,8 +55,8 @@ Public Class E119 : Implements IHttpHandler
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetUsuarios(CveUsuario) Then
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
- Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
- Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
+ Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
+ Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa)
UsuarioActual.CveEmpresa = CveEmpresa
CreaObjetoEmpresa(UsuarioActual)
@@ -87,11 +87,11 @@ Public Class E119 : Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim retorno As String = ""
Try
- Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
+ Dim Metodo As String = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
If Metodo = "BASF_POG40" Then
context.Response.ContentType = "application/json"
- Dim Auth = ValidarSolicitud(context)
+ Dim Auth As AuthMessage = ValidarSolicitud(context)
If Auth.IsSucces Then
retorno = ConsultaDatos(context)
@@ -104,7 +104,7 @@ Public Class E119 : Implements IHttpHandler
If Metodo = "ConsultarProductos" Then
context.Response.ContentType = "application/json"
- Dim Auth = ValidarSolicitud(context)
+ Dim Auth As AuthMessage = ValidarSolicitud(context)
If Auth.IsSucces Then
retorno = ConsultaProductos(context)
@@ -116,7 +116,7 @@ Public Class E119 : Implements IHttpHandler
If Metodo = "ConsultarClasificaciones" Then
context.Response.ContentType = "application/json"
- Dim Auth = ValidarSolicitud(context)
+ Dim Auth As AuthMessage = ValidarSolicitud(context)
If Auth.IsSucces Then
retorno = ConsultaClasificaciones(context)
@@ -181,7 +181,7 @@ Public Class E119 : Implements IHttpHandler
Dim RespuestaError As New ResponseMsgError
Dim TieneError As Boolean = False
- Dim strFecha = If(context.Request("Fecha") = Nothing, "", context.Request("Fecha").ToString())
+ Dim strFecha As String = If(context.Request("Fecha") = Nothing, "", context.Request("Fecha").ToString())
If String.IsNullOrEmpty(strFecha) Then
RespuestaError.message = "Debe especificar una fecha"
@@ -238,7 +238,7 @@ Public Class E119 : Implements IHttpHandler
Dim RespuestaError As New ResponseMsgError
Dim TieneError As Boolean = False
- Dim CveClasificacion = If(context.Request("CveClasificacion") = Nothing, "", context.Request("CveClasificacion").ToString())
+ Dim CveClasificacion As String = If(context.Request("CveClasificacion") = Nothing, "", context.Request("CveClasificacion").ToString())
If String.IsNullOrEmpty(CveClasificacion) Then
CveClasificacion = "-1"
@@ -255,7 +255,7 @@ Public Class E119 : Implements IHttpHandler
End If
End Using
- Dim Msg As String = "Información día " & Now.ToShortDateString & If(RespuestaError.message <> "", " Error: " & RespuestaError.message, "")
+ Dim Msg As String = "Información día " & ClsPaginas.NowADS().ToShortDateString & If(RespuestaError.message <> "", " Error: " & RespuestaError.message, "")
Msg.GuardaLogAD("LogE119")
If TieneError Then
@@ -288,7 +288,7 @@ Public Class E119 : Implements IHttpHandler
TieneError = True
End Try
- Dim Msg As String = "Información día " & Now.ToShortDateString & If(RespuestaError.message <> "", " Error: " & RespuestaError.message, "")
+ Dim Msg As String = "Información día " & ClsPaginas.NowADS().ToShortDateString & If(RespuestaError.message <> "", " Error: " & RespuestaError.message, "")
Msg.GuardaLogAD("LogE119")
If TieneError Then
diff --git a/Ashx/E140.ashx b/Ashx/E140.ashx
index 464c49e33..25a99bd7f 100644
--- a/Ashx/E140.ashx
+++ b/Ashx/E140.ashx
@@ -139,7 +139,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
Dim RutaRDLC As String = If(File.Exists($"{RutaEmpresa}\Formatos\MetasVendedores.rdlc"), $"{RutaEmpresa}\Formatos\MetasVendedores.rdlc", $"{DirectorioBaseEmpresas}\Empresas\Grales\Formatos\MetasVendedores.rdlc")
- If ObjGen.GetRepMetasVendedores(DateTime.Now, CveEmpresa, -1, -1, -1, -1, -1, CveSubProyecto, -1, -1, 0) Then
+ If ObjGen.GetRepMetasVendedores(ClsPaginas.NowADS(), CveEmpresa, -1, -1, -1, -1, -1, CveSubProyecto, -1, -1, 0) Then
Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", RutaEmpresa))
@@ -153,7 +153,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
End If
parametros.Add(New ReportParameter("UsuarioImprimio", "Sistema"))
- parametros.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ parametros.Add(New ReportParameter("FechaImpresion", ClsPaginas.NowADS().ToString("dd/MM/yyyy")))
parametros.Add(New ReportParameter("SubProyecto", Sucursal))
parametros.Add(New ReportParameter("Agente", Vendedor))
@@ -216,7 +216,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState
End If
- MandaCorreo(CorreoSupervisor, $"Envió de estado de scorecard sucursal {Sucursal} a {Now.ToString("dd/MM/yyyy")}", bytes)
+ MandaCorreo(CorreoSupervisor, $"Envió de estado de scorecard sucursal {Sucursal} a {ClsPaginas.NowADS().ToString("dd/MM/yyyy")}", bytes)
bytes = Nothing
End If
diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx
index 648919343..493fb9767 100644
--- a/Ashx/E141.ashx
+++ b/Ashx/E141.ashx
@@ -797,11 +797,11 @@ Public Class E141 : Implements IHttpHandler
ObjFactura.TipoDocto = TipoDocto
ObjFactura.RefDocto = ""
'ObjFactura.CveMesa = -1
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = ClsPaginas.NowADS()
ObjFactura.CvePrePoliza = -1
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = ClsPaginas.NowADS()
ObjFactura.MotivoDescuento = ""
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = ClsPaginas.NowADS()
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CveCondicionEntrega = -1
ObjFactura.CondicionEntrega = ""
@@ -1236,7 +1236,7 @@ Public Class E141 : Implements IHttpHandler
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal))
'Para uso del módulo contable
- TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
+ TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
TmpDT.Columns.Add("Proyecto", GetType(String))
@@ -1780,9 +1780,9 @@ Public Class E141 : Implements IHttpHandler
Dim msg As String = ""
If sb.Length > 0 Then
- msg = $"Se enviaron los siguientes productos: {sb.ToString()} Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}"
+ msg = $"Se enviaron los siguientes productos: {sb.ToString()} Fecha y hora: {ClsPaginas.NowADS().ToString("dd/MM/yyyy hh:mm:ss tt")}"
Else
- msg = $"No se enviaron productos esta semana Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}"
+ msg = $"No se enviaron productos esta semana Fecha y hora: {ClsPaginas.NowADS().ToString("dd/MM/yyyy hh:mm:ss tt")}"
End If
EnviarCorreoNotificacion("SIG - Productos enviados en la semana", msg)
@@ -1873,7 +1873,7 @@ Public Class E141 : Implements IHttpHandler
End While
End If
If DtPS.Rows.Count > 0 Then
- EnviarCorreoNotificacion("SIG - Actualización de productos", $"Se ejecuto la tarea de actualización de productos. Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}")
+ EnviarCorreoNotificacion("SIG - Actualización de productos", $"Se ejecuto la tarea de actualización de productos. Fecha y hora: {ClsPaginas.NowADS().ToString("dd/MM/yyyy hh:mm:ss tt")}")
End If
End If
@@ -1957,7 +1957,7 @@ Public Class E141 : Implements IHttpHandler
Private Function ActualizarPrecios(Todos As Boolean) As Boolean
Dim Retorno As Boolean = False
'ENVIAR PRECIOS SOLO DE 8am a 7pm
- If Now.Hour < 7 OrElse Now.Hour > 21 Then
+ If ClsPaginas.NowADS().Hour < 7 OrElse ClsPaginas.NowADS().Hour > 21 Then
Retorno = True
Return Retorno
End If
@@ -2040,7 +2040,7 @@ Public Class E141 : Implements IHttpHandler
End If
If DtPS.Rows.Count > 0 Then
- EnviarCorreoNotificacion("SIG - Actualización de precios", $"Se ejecuto la tarea de actualización de precios. Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}")
+ EnviarCorreoNotificacion("SIG - Actualización de precios", $"Se ejecuto la tarea de actualización de precios. Fecha y hora: {ClsPaginas.NowADS().ToString("dd/MM/yyyy hh:mm:ss tt")}")
End If
End If
@@ -2097,7 +2097,7 @@ Public Class E141 : Implements IHttpHandler
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
'ENVIAR SOLO DE 8am a 8pm
- If Now.Hour < 7 OrElse Now.Hour > 21 Then
+ If ClsPaginas.NowADS().Hour < 7 OrElse ClsPaginas.NowADS().Hour > 21 Then
Retorno = True
Return Retorno
End If
@@ -2176,7 +2176,7 @@ Public Class E141 : Implements IHttpHandler
End If
If DtPS.Rows.Count > 0 Then
- EnviarCorreoNotificacion("SIG - Actualización de existencias", $"Se ejecuto la tarea de actualización de existencias. Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}")
+ EnviarCorreoNotificacion("SIG - Actualización de existencias", $"Se ejecuto la tarea de actualización de existencias. Fecha y hora: {ClsPaginas.NowADS().ToString("dd/MM/yyyy hh:mm:ss tt")}")
End If
End If
diff --git a/Ashx/E72.ashx b/Ashx/E72.ashx
index 4068c10cd..c662e25d1 100644
--- a/Ashx/E72.ashx
+++ b/Ashx/E72.ashx
@@ -30,10 +30,10 @@ Public Class E72 : Implements IHttpHandler, IRequiresSessionState
Dim ObjInv As New ClsInventarios
Try
Dim DtPS As DataTable = CreaDT()
- ObjInv.GetRepEntradasSalidasXContrato(72, -1, MinFecha, Date.Now, -1, -1, 17, -1, -1, 3, -1, 1158)
+ ObjInv.GetRepEntradasSalidasXContrato(72, -1, MinFecha, ClsPaginas.NowADS(), -1, -1, 17, -1, -1, 3, -1, 1158)
Dim DtRepEntradasSalidasXContrato As DataTable = ObjInv.DtResultados.FiltraParametros("CvePS > 0")
- ObjInv.ApartadosRep(-1, 70437, 259, 72, -1, MinFecha, Date.Now)
+ ObjInv.ApartadosRep(-1, 70437, 259, 72, -1, MinFecha, ClsPaginas.NowADS())
Dim DtApartados As DataTable = ObjInv.DtResultados.FiltraParametros("CvePS > 0", "", {"CvePS", "Codigo", "Cantidad"})
Dim asd As Integer = DtApartados.Rows.Count
diff --git a/Ashx/MHRedes.ashx b/Ashx/MHRedes.ashx
index 3a4cb5172..49649d0f9 100644
--- a/Ashx/MHRedes.ashx
+++ b/Ashx/MHRedes.ashx
@@ -62,7 +62,7 @@ Public Class MobileHandler : Implements IHttpHandler
If User IsNot Nothing Then
- Dim Token As String = String.Format("{0}*{1}*{2}", Now.ToString, IP, User.CveUsuario)
+ Dim Token As String = String.Format("{0}*{1}*{2}", ClsPaginas.NowADS().ToString, IP, User.CveUsuario)
Token = Encripta(Token)
json.AppendFormat("{{ ""CveUsuario"" : ""{0}"", ""Nombre"" : ""{1}"", ""Token"" : ""{2}"" }} ", User.CveUsuario, User.Nombre, Token)
Else
diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx
index 988214be8..70cfe6ec9 100644
--- a/Ashx/SIGFacturacion.ashx
+++ b/Ashx/SIGFacturacion.ashx
@@ -63,7 +63,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
'EnviarCorreoFactura(New Modelos.Factura(Usuario, 844966, 1, context.ModExtensiones.DirectorioBaseEmpresas), Usuario)
If String.IsNullOrEmpty(pFechaI) AndAlso String.IsNullOrEmpty(pFechaF) Then
- Dim FechaReferencia = Now
+ Dim FechaReferencia = ClsPaginas.NowADS()
If FechaReferencia.DayOfWeek = DayOfWeek.Sunday Then
Dim Sabado = FechaReferencia.AddDays(-1)
Dim DomingoAnterior = FechaReferencia.AddDays(-7)
@@ -290,11 +290,11 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
ObjFactura.TipoDocto = "Ing"
ObjFactura.RefDocto = ""
'ObjFactura.CveMesa = -1
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = ClsPaginas.NowADS()
ObjFactura.CvePrePoliza = -1
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = ClsPaginas.NowADS()
ObjFactura.MotivoDescuento = ""
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = ClsPaginas.NowADS()
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CveCondicionEntrega = -1
ObjFactura.CondicionEntrega = ""
@@ -384,7 +384,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjFactura.CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.GetPromocionesPS(-1, ClsPaginas.NowADS(), CveSubProyecto, ObjFactura.CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
ObjFactura.DtPromociones = ObjVentas.DtResultados.Copy()
End If
@@ -905,8 +905,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
- strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
+ ' strLineaTMP = Chr(13) & Chr(10) & Day(NowADS()) & "/" & Month(NowADS()) & "/" & Year(NowADS()) & " " & Hour(NowADS()) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
+ strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\LogFacturacion.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
diff --git a/Ashx/SIGFacturacionCiclica.ashx b/Ashx/SIGFacturacionCiclica.ashx
index 6f8b1e66e..8e5998a6a 100644
--- a/Ashx/SIGFacturacionCiclica.ashx
+++ b/Ashx/SIGFacturacionCiclica.ashx
@@ -94,7 +94,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
Private Function IniciaFacturacionMasiva() As Boolean
Dim Retorno As Boolean = True
- Dim FechaRef As DateTime = DateTime.Now
+ Dim FechaRef As DateTime = ClsPaginas.NowADS()
Dim DTCicloComercial As DataTable = Nothing
Using ObjContratos As New ClsContratos
@@ -123,11 +123,11 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
For Each Row As DataRow In DTCicloComercial.Rows
If Row("Observaciones").ToString().Contains("{DIA}") Then
- Row("Observaciones") = Row("Observaciones").ToString().Replace("{DIA}", DateTime.Now.Day.ToString())
+ Row("Observaciones") = Row("Observaciones").ToString().Replace("{DIA}", ClsPaginas.NowADS().Day.ToString())
End If
If Row("Observaciones").ToString().Contains("{MES}") Then
- Dim fecha As DateTime = DateTime.Now
+ Dim fecha As DateTime = ClsPaginas.NowADS()
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
@@ -135,11 +135,11 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
End If
If Row("Observaciones").ToString().Contains("{AÑO}") Then
- Row("Observaciones") = Row("Observaciones").ToString().Replace("{AÑO}", DateTime.Now.Year.ToString())
+ Row("Observaciones") = Row("Observaciones").ToString().Replace("{AÑO}", ClsPaginas.NowADS().Year.ToString())
End If
If Row("Observaciones").ToString().Contains("{TC}") Then
- Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", ClsPaginas.GlobalTipoCambio(Now).FormatoNumero)
+ Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS()).FormatoNumero)
End If
Dim Resp = EmitirImprimir(UsuarioActual, Row)
@@ -291,7 +291,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
ObjFactura.CveMoneda = DR("CveMoneda").ToString.ToEntero
ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
- ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(Now)).ToDecimal
+ ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS())).ToDecimal
ObjFactura.TipoDocto = "Ing"
ObjFactura.RefDocto = ""
ObjFactura.Folio = -1
diff --git a/Ashx/SIGPolizaVirtual.ashx b/Ashx/SIGPolizaVirtual.ashx
index 21d2372c7..f0d8daa67 100644
--- a/Ashx/SIGPolizaVirtual.ashx
+++ b/Ashx/SIGPolizaVirtual.ashx
@@ -468,7 +468,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState
obj.customer_car_year = ObjFactura.Fecha.Year
'DATOS DE VENTA
- obj.sale_date = Now
+ obj.sale_date = ClsPaginas.NowADS()
obj.sale_paidby = "01"
obj.sale_type = "01" 'PISO
obj.sale_type_service = "01" 'PARTICULAR
@@ -499,7 +499,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState
obj.customer_name = "JOSE ENRIQUE"
obj.customer_last_name1 = "VIZCARA"
obj.customer_last_name2 = "RENDON"
- obj.customer_birthday = Now
+ obj.customer_birthday = ClsPaginas.NowADS()
obj.customer_phone = "8186545256"
obj.customer_email = "mail@mail.com"
obj.customer_gender = "02"
@@ -509,7 +509,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState
obj.customer_car_year = 2015
'DATOS DE VENTA
- obj.sale_date = Now
+ obj.sale_date = ClsPaginas.NowADS()
obj.sale_paidby = "01"
obj.sale_type = "01"
obj.sale_type_service = "01"
@@ -527,7 +527,7 @@ Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState
obj.used_bci = "25"
obj.used_month = 1
obj.used_year = 2015
- obj.used_sale_date = Now
+ obj.used_sale_date = ClsPaginas.NowADS()
EnviarPolizaVentaLTHWSD(context, obj)
End Sub
diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx
index 4c09b06b8..b7689a08c 100644
--- a/Ashx/SIGWeb.ashx
+++ b/Ashx/SIGWeb.ashx
@@ -58,13 +58,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ActualizaPrePoliza(context)
Dim obj As New MResponseModel(Of Object)()
- obj.Result = DateTime.Now.ToString()
+ obj.Result = ClsPaginas.NowADS().ToString()
Dim retorno = JsonConvert.SerializeObject(obj).ToString()
context.Response.Write(retorno)
context.Response.StatusCode = 200
Case "RevisaConexion"
Dim obj As New MResponseModel(Of Object)()
- obj.Result = DateTime.Now.ToString()
+ obj.Result = ClsPaginas.NowADS().ToString()
Dim retorno = JsonConvert.SerializeObject(obj).ToString()
context.Response.Write(retorno)
context.Response.StatusCode = 200
@@ -282,7 +282,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim tokenDescriptor = New Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor With {
.Subject = New System.Security.Claims.ClaimsIdentity(New System.Security.Claims.Claim() {New System.Security.Claims.Claim("CvePlataforma", usuario.CvePlataforma.ToString()),
New System.Security.Claims.Claim("CveUsuario", usuario.CveUsuario.ToString()), New System.Security.Claims.Claim("CveEmpresa", usuario.CveEmpresa.ToString()),
- New System.Security.Claims.Claim("CveRol", usuario.CveRol.ToString()), New System.Security.Claims.Claim("Fecha", Date.Now.ToLongDateString())}),
+ New System.Security.Claims.Claim("CveRol", usuario.CveRol.ToString()), New System.Security.Claims.Claim("Fecha", ClsPaginas.NowADS().ToLongDateString())}),
.Expires = Date.UtcNow.AddHours(3),
.SigningCredentials = New Microsoft.IdentityModel.Tokens.SigningCredentials(
New Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(Encoding.ASCII.GetBytes("*_AsistenciaDesarrolloSistemas-SIGAPI_*17-06-2020")),
@@ -488,7 +488,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
savepath = context.Server.MapPath(tempPath)
Dim filename As String
Dim tick As String
- tick = (DateTime.Now.Ticks + 1).ToString()
+ tick = (ClsPaginas.NowADS().Ticks + 1).ToString()
If Not Directory.Exists(savepath) Then
Directory.CreateDirectory(savepath)
End If
diff --git a/Ashx/TareasProgramadas.ashx b/Ashx/TareasProgramadas.ashx
index 3e01ccf00..3334c5d08 100644
--- a/Ashx/TareasProgramadas.ashx
+++ b/Ashx/TareasProgramadas.ashx
@@ -70,7 +70,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim retorno As String = "no se encontro la variable"
Try
Dim metodo As String = ""
- Dim FechaActual As DateTime = Now
+ Dim FechaActual As DateTime = ClsPaginas.NowADS()
Dim FechaEnvio As DateTime = FechaActual
If context.Request("var") IsNot Nothing Then
@@ -387,7 +387,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim Json As New JObject(
New JProperty("Empresa", UsuarioActual.Empresa.Empresa),
New JProperty("Usuario", UsuarioActual.Usuario),
- New JProperty("Fecha", DateTime.Now.ToString("dd/MM/yyy HH:mm:ss"))
+ New JProperty("Fecha", ClsPaginas.NowADS().ToString("dd/MM/yyy HH:mm:ss"))
)
Dim DTClientes As DataTable = Nothing
Dim EnviarPendientes As Boolean = False
@@ -414,7 +414,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim Grupo As Integer = 5
Dim TipoCambio As Integer = 1
Dim TipoDocto As String = "Ing"
- Dim FechaCorte As DateTime = New DateTime(Now.Year, 12, 31)
+ Dim FechaCorte As DateTime = New DateTime(ClsPaginas.NowADS().Year, 12, 31)
If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte,
EstatusCliente:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=-1, TipoCliente:=-1, AplicaAnticiposPagados:=AplicaAnticipos) Then
@@ -677,7 +677,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
- lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString, FF)))
+ lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", ClsPaginas.NowADS().ToShortDateString, FF)))
lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre))
lista.Add(New CrystalParametro("DireccionCliente", String.Format("Calle {0} #{1} Colonia {2}", Cliente.Direccion, If(Cliente.NoExt = "", "S/N", Cliente.NoExt), Cliente.Colonia)))
lista.Add(New CrystalParametro("ClienteCP", Cliente.CP))
@@ -719,7 +719,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
- lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString, FF)))
+ lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", ClsPaginas.NowADS().ToShortDateString, FF)))
lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre))
lista.Add(New CrystalParametro("DireccionCliente", String.Format("Calle {0} #{1} Colonia {2}", Cliente.Direccion, If(Cliente.NoExt = "", "S/N", Cliente.NoExt), Cliente.Colonia)))
lista.Add(New CrystalParametro("ClienteCP", Cliente.CP))
@@ -870,8 +870,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
- strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
+ ' strLineaTMP = Chr(13) & Chr(10) & Day(NowADS()) & "/" & Month(NowADS()) & "/" & Year(NowADS()) & " " & Hour(NowADS()) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
+ strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, ClsPaginas.NowADS().ToShortDateString, ClsPaginas.NowADS().ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\LogEdoCuenta.txt", ModExtensiones.DirectorioBaseEmpresas), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
@@ -1066,7 +1066,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
If Not String.IsNullOrEmpty(Mail) Then
Try
- Dim Asunto As String = $"ScoreCard: {Now.ToString("dd/MM/yyyy")}"
+ Dim Asunto As String = $"ScoreCard: {ClsPaginas.NowADS().ToString("dd/MM/yyyy")}"
Dim Cuerpo As String = String.Empty
Dim ResultadoMail As Integer = 0
diff --git a/Bancos/CIF.aspx.vb b/Bancos/CIF.aspx.vb
index 2bcbfe125..1a47dfc6f 100644
--- a/Bancos/CIF.aspx.vb
+++ b/Bancos/CIF.aspx.vb
@@ -45,8 +45,8 @@ Partial Class Bancos_CIF
'For Each x As DataRow In GlobalDTContaPlantillasPolizasDetalle(DdlTipoMovimiento.SelectedValue.ToEntero).Rows
' TipoMovto = CBool(x("TipoMovto"))
- ' 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, TxtConcepto.Text, DdlTipoMovimiento.SelectedValue.ToEntero, TxtObservacion.Text, Now, 0, -1, CveIE) Then
- ' If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Importe, TxtConcepto.Text, 30, TxtObservacion.Text, Now, 0, -1, CveIE) Then
+ ' 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, TxtConcepto.Text, DdlTipoMovimiento.SelectedValue.ToEntero, TxtObservacion.Text, NowADS(), 0, -1, CveIE) Then
+ ' If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Importe, TxtConcepto.Text, 30, TxtObservacion.Text, NowADS(), 0, -1, CveIE) Then
' ''End If
' Else
' Alert("No se pudo insertar el Detalle de la Póliza", TipoMensaje.MsgAdvertencia)
diff --git a/Bancos/CargarConciliacionesBancarias.aspx.vb b/Bancos/CargarConciliacionesBancarias.aspx.vb
index e9b722155..3fd69f3ab 100644
--- a/Bancos/CargarConciliacionesBancarias.aspx.vb
+++ b/Bancos/CargarConciliacionesBancarias.aspx.vb
@@ -46,8 +46,8 @@ Partial Class Bancos_CargarConciliacionesBancarias
DdlCuentaModal.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCuentaModal.DataBind()
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
Modalidad = ""
End Sub
@@ -237,7 +237,7 @@ Partial Class Bancos_CargarConciliacionesBancarias
Protected Sub LnkAgregarMovimiento_Click(sender As Object, e As EventArgs)
Modalidad = "A"
TxtReferencia.Text = ""
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
TxtImporte.Text = ""
DdlTipo.SelectedIndex = 0
DdlCuentaModal.SelectedIndex = 0
diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb
index 584d740c0..a52804d80 100644
--- a/Bancos/ConciliacionesBancarias.aspx.vb
+++ b/Bancos/ConciliacionesBancarias.aspx.vb
@@ -78,8 +78,8 @@ Partial Class Bancos_ConciliacionesBancariasaspx
DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1"))
DdlCuenta.DataBind()
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
ModalidadConciliacion = ""
ModalidadDesconciliar = ""
@@ -398,7 +398,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Protected Sub LnkDesconciliarTodos_Click(sender As Object, e As EventArgs)
ModalidadDesconciliar = "DT"
- TxtFechaDesconciliado.Text = Now.ToShortDateString
+ TxtFechaDesconciliado.Text = NowADS().ToShortDateString
CveIEDesconciliar = 0
UpDesconciliar.Update()
RegistraScript("$('#DModalDesconciliar').modal()")
@@ -563,7 +563,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Dim params As New List(Of ReportParameter)()
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString()))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString()))
Dim FormatoFecha As DateTimeFormatInfo = CultureInfo.CurrentCulture.DateTimeFormat
Dim NombreMes As String = FormatoFecha.GetMonthName(txtFechaI.Text.ToDate.Month).ToUpper
params.Add(New ReportParameter("Encabezado", $"{DdlCuenta.SelectedItem.Text} {NombreMes} {txtFechaI.Text.ToDate.Year}"))
diff --git a/Bancos/Creditos.aspx.vb b/Bancos/Creditos.aspx.vb
index e7a644c22..57f66289e 100644
--- a/Bancos/Creditos.aspx.vb
+++ b/Bancos/Creditos.aspx.vb
@@ -160,7 +160,7 @@ Partial Class Bancos_Creditos
RegeneraTablaAmortizacion = False
'Fecha Default
- TxtFechaInicio.Text = DateTime.Now().ToString("dd/MM/yyyy")
+ TxtFechaInicio.Text = NowADS().ToString("dd/MM/yyyy")
'Carga Proveedores | Entidad Financiera
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
@@ -688,7 +688,7 @@ Partial Class Bancos_Creditos
' If CveIE < 0 Then
' ErrorCredito = True
' End If
- ' 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtCSTotalCredito.Text.ToString.ToDouble, "Crédito", 50, "", Now, 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToString.ToDouble) Then
+ ' 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtCSTotalCredito.Text.ToString.ToDouble, "Crédito", 50, "", NowADS(), 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToString.ToDouble) Then
' ' ErrorCredito = True
' 'End If
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtCSTotalCredito.Text.ToDecimal, TxtCSTotalCredito.Text.ToDecimal, 30, "Crédito", "", CveIE:=CveIE) Then
@@ -878,19 +878,19 @@ Partial Class Bancos_Creditos
'If Not ErrorCredito AndAlso CveIE > 0 Then
' If CvePrePoliza > 0 Then
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtVehiculoAnticipo.Text.ToDouble, "Enganche", 53, "", Now, 0, -1, CveIE) Then
+ ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtVehiculoAnticipo.Text.ToDouble, "Enganche", 53, "", NowADS(), 0, -1, CveIE) Then
' ErrorCredito = True
' End If
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtComisionAnticipo.Text.ToDouble, "Comisión", 54, "", Now, 0, -1, CveIE) Then
+ ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtComisionAnticipo.Text.ToDouble, "Comisión", 54, "", NowADS(), 0, -1, CveIE) Then
' ErrorCredito = True
' End If
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtSeguroAnticipo.Text.ToDouble, "Seguro", 55, "", Now, 0, -1, CveIE) Then
+ ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtSeguroAnticipo.Text.ToDouble, "Seguro", 55, "", NowADS(), 0, -1, CveIE) Then
' ErrorCredito = True
' End If
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtFondoGarantia.Text.ToDouble, "Fondo en Garantía", 58, "", Now, 0, -1, CveIE) Then
+ ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtFondoGarantia.Text.ToDouble, "Fondo en Garantía", 58, "", NowADS(), 0, -1, CveIE) Then
' ErrorCredito = True
' End If
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TotalAnticipo, "Banco", 30, "", Now, 0, -1, CveIE) Then
+ ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TotalAnticipo, "Banco", 30, "", NowADS(), 0, -1, CveIE) Then
' ErrorCredito = True
' End If
' Else
@@ -1573,7 +1573,7 @@ Partial Class Bancos_Creditos
Dim TipoMovimiento As Boolean = False
Dim Concepto As String = ""
Dim Referencia As String = $"Crédito: {TxtReferencia.Text}"
- Dim FechaMovimiento As Date = Now.ToDate
+ Dim FechaMovimiento As Date = NowADS().ToDate
Dim MsgError As String = ""
CvePrePoliza = ObjContabilidad.AddPrePolizas("Creditos/RegistrodeRegistro", 69, TxtCSTotalCredito.Text.ToDouble, TxtCSTotalCredito.Text.ToDouble, DdlCSTipoMoneda.SelectedValue.ToEntero, FechaMovimiento, $"Crédito: {TxtReferencia.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
@@ -1585,7 +1585,7 @@ Partial Class Bancos_Creditos
importeMovimiento = TxtVehiculoValor.Text.ToDecimal - TxtVehiculoAnticipo.Text.ToDecimal 'importe financiado
Concepto = $"Crédito: {TxtReferencia.Text}"
Dim Pago As New CompraPago
- Pago.Fecha = Now
+ Pago.Fecha = NowADS()
Pago.CveIE = CveIE
Dim ObjCompra As New ClsCompras
diff --git a/Bancos/CreditosPagoMultiple.aspx.vb b/Bancos/CreditosPagoMultiple.aspx.vb
index 815b6f688..7efd21e80 100644
--- a/Bancos/CreditosPagoMultiple.aspx.vb
+++ b/Bancos/CreditosPagoMultiple.aspx.vb
@@ -28,7 +28,7 @@ Partial Class Bancos_CreditosPagoMultiple
CveMoneda = 1
CargaTipoTransaccion()
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
- TxtFechaDocumento.Text = Now.ToShortDateString
+ TxtFechaDocumento.Text = NowADS().ToShortDateString
CargaProveedores() ' CveProveedor = 19994
TxtPagueseA.Enabled = False
diff --git a/Bancos/CuentasBancariasDetalle.aspx.vb b/Bancos/CuentasBancariasDetalle.aspx.vb
index 3d5b641a6..f6a001b2e 100644
--- a/Bancos/CuentasBancariasDetalle.aspx.vb
+++ b/Bancos/CuentasBancariasDetalle.aspx.vb
@@ -59,7 +59,7 @@ Partial Class Bancos_CuentasBancariasDetalle
InicializaConvenio()
Else
'Configuración de Modalidad Insert
- LblFecha.Text = Now.ToShortDateString()
+ LblFecha.Text = NowADS().ToShortDateString()
LtlTitulo.Text = "Agregar Nueva Cuenta Bancaria"
ViewState("CveCuenta") = -1
BtnEliminar.Visible = False
diff --git a/Bancos/DepositoTerminal.aspx.vb b/Bancos/DepositoTerminal.aspx.vb
index 555cba4c2..db7dfa7ec 100644
--- a/Bancos/DepositoTerminal.aspx.vb
+++ b/Bancos/DepositoTerminal.aspx.vb
@@ -20,7 +20,7 @@ Partial Class Bancos_DepositoTerminal
Private Sub Bancos_DepositoTerminal_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
CargaCuentas()
If UsuarioActual.CveEmpresa.Contiene(1, 4, 7, 11, 12, 72, 80, 119) Then
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index e6f789a9d..b3150609e 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -18,9 +18,9 @@ Partial Class Bancos_DepositosCaja
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
FacturasCheckadas = 0
- TxtFecha.Text = Now.ToShortDateString
- txtFechaI.Text = Now.AddDays(-1).ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
+ txtFechaI.Text = NowADS().AddDays(-1).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
TxtComision.Attributes.Add("onKeyUp", "txtSuma(this);")
TxtDescuento.Attributes.Add("onKeyUp", "txtSumaDescuento(this);")
TxtIVA.Attributes.Add("onKeyUp", "txtSumaIVA(this);")
diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs
index 18763f816..3155be9f3 100644
--- a/Bancos/Devoluciones.aspx.cs
+++ b/Bancos/Devoluciones.aspx.cs
@@ -199,7 +199,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
ClsMovimientos ObjMov = new ClsMovimientos();
ClsClientes clsClientes = new ClsClientes();
- if (ObjMov.GetMovimientosIE(1, CveCliente, DdlCuenta.SelectedValue.ToEntero(), MinFecha, DateTime.Now, 1, -1, UsuarioActual.CveEmpresa))
+ if (ObjMov.GetMovimientosIE(1, CveCliente, DdlCuenta.SelectedValue.ToEntero(), MinFecha, NowADS(), 1, -1, UsuarioActual.CveEmpresa))
{
GvDevoluciones.DataSource = ObjMov.DtResultados.FiltraParametros("Saldo > 0 ");
GvDevoluciones.DataBind();
@@ -419,7 +419,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
int vecesAplicar = TxtVecesAplicar.Text.ToEntero();
decimal montoLimite = 0;
- string fechaInicioAplicacion = DateTime.Now.ToString("yyyy/MM/dd");
+ string fechaInicioAplicacion = NowADS().ToString("yyyy/MM/dd");
bool estatus = true;
int CveCuenta = -1;
int CveMovtoPermanente = ObjNom.AddMovtoPermanente(cveConcepto, cvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta);
diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb
index 7a4eb6aee..b356bd7b9 100644
--- a/Bancos/FluctuacionCambiaria.aspx.vb
+++ b/Bancos/FluctuacionCambiaria.aspx.vb
@@ -47,9 +47,9 @@ Partial Class Bancos_FluctuacionCambiaria
#Region "CARGAS"
Private Sub CargaFechas()
'Año actual
- DdlAnio.Items.Add(New ListItem(Now.Year.ToString(), Now.Year.ToString()))
+ DdlAnio.Items.Add(New ListItem(NowADS().Year.ToString(), NowADS().Year.ToString()))
'Año Anterior
- DdlAnio.Items.Add(New ListItem(Now.AddYears(-1).Year.ToString(), Now.AddYears(-1).Year.ToString()))
+ DdlAnio.Items.Add(New ListItem(NowADS().AddYears(-1).Year.ToString(), NowADS().AddYears(-1).Year.ToString()))
For i As Integer = 1 To 12
Dim fecha As DateTime = New DateTime(DdlAnio.SelectedValue.ToEntero(), i, 1)
@@ -59,7 +59,7 @@ Partial Class Bancos_FluctuacionCambiaria
DdlMes.Items.Add(New ListItem(mesStr, i.ToString()))
Next
- Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
+ Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(NowADS())
If UltimaFluctuacion IsNot Nothing Then
DdlMes.SelectedValueExist(UltimaFluctuacion.FechaFluctuacion.Month)
DdlMes.SelectedValueExist(UltimaFluctuacion.FechaFluctuacion.Year)
@@ -98,17 +98,17 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaUltimaFluctuacion()
- Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
+ Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(NowADS())
If UltimaFluctuacion IsNot Nothing Then
LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", UltimaFluctuacion.FechaFluctuacion.ToShortDateString)
'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual
- If UltimaFluctuacion.FechaFluctuacion >= Now.AddMonths(-1).LastDayOfMonth Then
- DdlMes.SelectedValueExist(Now.Month)
- DdlAnio.SelectedValueExist(Now.Year)
+ If UltimaFluctuacion.FechaFluctuacion >= NowADS().AddMonths(-1).LastDayOfMonth Then
+ DdlMes.SelectedValueExist(NowADS().Month)
+ DdlAnio.SelectedValueExist(NowADS().Year)
Else
- DdlMes.SelectedValueExist(Now.AddMonths(-1).Month)
- DdlAnio.SelectedValueExist(Now.AddMonths(-1).Year)
+ DdlMes.SelectedValueExist(NowADS().AddMonths(-1).Month)
+ DdlAnio.SelectedValueExist(NowADS().AddMonths(-1).Year)
End If
End If
@@ -1238,7 +1238,7 @@ Partial Class Bancos_FluctuacionCambiaria
StrFiltro.AppendFormat("TC: {0}", LtTipoCambioActual.Text)
If (T.ActiveTabIndex = 0) Then
- 'GvProveedores.ExportToExcelGembox("FluctuacionCambiariaProveedores_" & Now.ToShortDateString)
+ 'GvProveedores.ExportToExcelGembox("FluctuacionCambiariaProveedores_" & NowADS().ToShortDateString)
GvProveedores.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Proveedores", DatosFiltros:=StrFiltro.ToString())
ElseIf (T.ActiveTabIndex = 1) Then
GvProveedoresAnt.ExportToExcelGembox("Fluctuacion." + T.ActiveTab.HeaderText + "." + DdlMes.SelectedItem.ToString + "." + DdlAnio.SelectedValue, UsuarioActual, "Fluctuación Cambiaria - Proveedores Anticipos", DatosFiltros:=StrFiltro.ToString())
diff --git a/Bancos/FlujoDiario.aspx.vb b/Bancos/FlujoDiario.aspx.vb
index 0b80f2f92..23aa78957 100644
--- a/Bancos/FlujoDiario.aspx.vb
+++ b/Bancos/FlujoDiario.aspx.vb
@@ -44,7 +44,7 @@ Partial Class Bancos_FlujoDiario
Private Sub Bancos_FlujoDiario_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
- TxtFecha.Text = Now.ToString
+ TxtFecha.Text = NowADS().ToString
End If
End Sub
@@ -55,7 +55,7 @@ Partial Class Bancos_FlujoDiario
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Fecha", TxtFecha.Text.ToDate.ToLongDateString))
If Imagen.Exists Then
diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx
index d9a7799a7..9106c2511 100644
--- a/Bancos/IE.aspx
+++ b/Bancos/IE.aspx
@@ -269,8 +269,8 @@
-
-
+
+
$
@@ -512,7 +512,7 @@
-
@@ -1784,6 +1784,17 @@
if ($get('TxtImporte')) $get('TxtImporte').value = ToDouble($get('TxtDevolución').value) + Ot;
}
+ function ValidarCantidadDevCompras() {
+ var Ot = 0.00;
+ var Dev = 0.00;
+ debugger; //valida importe
+ //if ($get('TxtDevolución') && (ToDouble($get('TxtDevolución').value) > s)) $get('TxtDevolución').value = s;
+ FCSumaTotalesNotas();
+ // considera importe de OT ingresos, para que se peuda exceder
+ if ($get('TxtOtrosIngresosEgresos')) { Ot = ToDouble($get('TxtOtrosIngresosEgresos').value); }
+ if ($get('TxtImporte')) $get('TxtImporte').value = ToDouble($get('TxtImporte').value) + Ot;
+ }
+
var TipoCambioActual = 0.0;
function CambiaTC(txt) {
let TipoCambioTxt = ToDouble(txt.value)
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 972139eaa..1746f7e3f 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -582,7 +582,7 @@ Partial Class Bancos_IE
Folio = ""
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
TxtImporte.Attributes.Add("onblur", "upIE(this);FncImporteCuenta(this);")
- 'Calendario.StartDate = Now.AddMonths(-2).FirstDayOfMonth()
+ 'Calendario.StartDate = NowADS().AddMonths(-2).FirstDayOfMonth()
ViewState("IDPoliza") = "-1"
CveIEDeposito = -1
CveIEDeposito2 = -1
@@ -591,8 +591,8 @@ Partial Class Bancos_IE
CvePrePoliza = -1
CveSolicitudViatico = -1
ComplementoSerieFolio = ""
- 'TxtFechaDevuelto.Text = Now.ToShortDateString
- TxtFechaCancelacion.Text = Now.ToShortDateString
+ 'TxtFechaDevuelto.Text = NowADS().ToShortDateString
+ TxtFechaCancelacion.Text = NowADS().ToShortDateString
CveCompraDeCDin = -1
'If UsuarioActual.CveEmpresa.Contiene(66) Then trNotificar.Visible = True
@@ -638,7 +638,9 @@ Partial Class Bancos_IE
'CargaNotas()
DVDevolucion.Visible = True
HdnCveProveedor.Value = Request("CveProveedor")
- DivOtrosIngresosEgresos.Visible = False
+ DivOtrosIngresosEgresos.Visible = True
+ TxtOtrosIngresosEgresos.Attributes.Add("onkeyup", $"ValidarCantidadDevCompras();")
+
End If
TxtImporte.Attributes.Add("onkeypress", "javascript: return false;")
End If
@@ -647,10 +649,8 @@ Partial Class Bancos_IE
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
DivOtrosIngresosEgresos.Visible = True
End If
-
End If
-
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then
LblPagueseA.Text = ""
LblPagueseA.Visible = False
@@ -736,7 +736,7 @@ Partial Class Bancos_IE
'Configuración de Modalidad Insert
ImgAddObs.Visible = False
CveIE = -1
- TxtFechaDocumento.Text = Now.ToShortDateString
+ TxtFechaDocumento.Text = NowADS().ToShortDateString
ImgUpdateCuentaDeposito.Visible = False
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
End If
@@ -1177,43 +1177,8 @@ Partial Class Bancos_IE
If ObjIE.CveIECancelacion > 0 Then
CveIECancelacion = ObjIE.CveIECancelacion
End If
-
UpCancelacion.Update()
- 'OTROS DATOS - DATOS COMPLEMENTO SUSTITUCION
- 'Dim CveIESustitucion As Integer = ObjIE.DtResultados(0)("CveIESustitucion").ToString.ToEntero
- 'If CveIESustitucion > 0 Then
- ' TRComplementoSustitucion.Visible = True
-
- ' If ObjIE.GetBancosIE(CveIESustitucion, UsuarioActual.CveEmpresa) And ObjIE.DtResultados.Rows.Count > 0 Then
- ' ARefIESustitucion.HRef = String.Format("/Bancos/IE.aspx?CveIE={0}", CveIESustitucion)
- ' ARefIESustitucion.InnerText = ObjIE.Folio
- ' End If
-
- 'End If
-
- ' codigo se reubicó a linea 969
- ''DETALLES - MOVIMIENTOS
- 'If ObjIE.GetBancosIEMovimientos(CveIE, UsuarioActual.CveEmpresa) Then
- ' GvM.DataSource = ObjIE.DtResultados.FiltraParametros("CveConceptoContable <> 30")
-
- ' If UsuarioActual.TienePermisoProceso(277) AndAlso Not TabCancelacion.Visible Then
- ' GvM.Columns(8).Visible = True
- ' End If
-
- ' If ObjIE.DtResultados.FiltraParametros("TCPago > 1").Rows.Count.ToEntero() > 0 Then
- ' GvM.Columns(7).Visible = True
- ' End If
-
- ' If ObjIE.DtResultados.FiltraParametros("CveMonedaIE <> CveMoneda").Rows.Count.ToEntero > 0 Then
- ' GvM.Columns(5).Visible = True
- ' GvM.Columns(6).Visible = True
- ' End If
-
- ' GvM.DataBind()
-
- 'End If
-
'Movimientos Relacionados Padre
If ObjIE.GetBancosIEMovimientosPadre(CveIE, UsuarioActual.CveEmpresa) Then
If ObjIE.DtResultados.FiltraParametros("TCPago > 1").Rows.Count.ToEntero() > 0 Then
@@ -1358,26 +1323,20 @@ Partial Class Bancos_IE
End Sub
#End Region
-
-
Private Sub CargaNotas(CvemonedaInterna As Integer)
Dim ObjMovtos As New ClsMovimientos()
If CvemonedaInterna > 0 Then
- If ObjMovtos.GetAnticiposProveedor(CveProveedor, -1, CvemonedaInterna, -1) AndAlso ObjMovtos.DtResultados.FiltraParametros("TipoDocto = 'NC'").Rows.Count > 0 Then
+ If ObjMovtos.GetAnticiposProveedor(CveProveedor, UsuarioActual.CveEmpresa, CveMoneda:=CvemonedaInterna, TipoDocto:="NC") AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then
GvA.DataSource = ObjMovtos.DtResultados.FiltraParametros("TipoDocto = 'NC' and Saldo > 0 and CveCompra > 0")
-
Else
GvA.DataSource = Nothing
End If
Else
GvA.DataSource = Nothing
End If
-
-
ObjMovtos.Dispose()
-
GvA.DataBind()
UpGvNotas.Update()
End Sub
@@ -2108,7 +2067,7 @@ Partial Class Bancos_IE
If CveCliente > 0 AndAlso Not DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDouble = 0 Then
'RMF- CASO DONDE HAY UNA DEVOLUCION Y TENGO QUE AFECTAR LAS FACTURAS QUE SE HABIAN MARCADO COMO PAGADAS TENGO QUE REGRESARLAS A PENDIENTES
Dim Mov As New ClsMovimientos
- If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, Now, Now, 1, 0, UsuarioActual.CveEmpresa) Then
+ If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, NowADS(), NowADS(), 1, 0, UsuarioActual.CveEmpresa) Then
Dim DtIE As DataTable = Mov.DtResultados
For Each dr As DataRow In DtIE.Rows
@@ -2154,7 +2113,7 @@ Partial Class Bancos_IE
Dim ConceptoContable As Integer
Dim TipoMovimiento As Boolean
Dim importeMovimiento As Decimal
- Dim FechaMovimiento As Date = Now
+ Dim FechaMovimiento As Date = NowADS()
Dim Concepto As String = ""
Dim Referencia As String = PagueseA
@@ -2413,15 +2372,10 @@ Partial Class Bancos_IE
Dim FechaCompraNota As Date = GvRow.DataKey("Fecha").ToDate
If tCveMoneda > 1 Then
- TCCompra = GlobalTipoCambio(FechaCompraNota).ToDecimal
+ TCCompra = GvRow.DataKey("TipoCambio").ToDecimal
TCDocumento = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToDecimal
-
- If TCCompra <= 0 Then
- Alert("No se pudo obtener el tipo de cambio de la nota de crédito.", TipoMensaje.MsgAdvertencia)
- End If
-
If TCDocumento <= 0 Then
- Alert("No se pudo obtener el tipo de cambio del documentpo.", TipoMensaje.MsgAdvertencia)
+ Alert("No se pudo obtener el tipo de cambio del documento.", TipoMensaje.MsgAdvertencia)
End If
End If
ImporteAplicar = GvRow.DataKey("Saldo").ToDecimal
@@ -2433,23 +2387,9 @@ Partial Class Bancos_IE
Else
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL()
End If
-
- If tCveMoneda > 1 Then
-
- TCCompra = GlobalTipoCambio(GvRow.DataKey("Fecha").ToDate).ToDecimal
- TCDocumento = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToDecimal
-
- If TCCompra <= 0 Then
- Alert("No se pudo obtener el tipo de cambio de la nota de crédito.", TipoMensaje.MsgAdvertencia)
- End If
-
- If TCDocumento <= 0 Then
- Alert("No se pudo obtener el tipo de cambio del documentpo.", TipoMensaje.MsgAdvertencia)
- End If
- End If
-
ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {ImporteAplicar} NC:{GvRow.DataKey("SerieFolio")}"
CveCompraDeCDin = GvRow.DataKey("CveCompra").ToEntero
+ Dim tCveTipoConcepto As Integer = GvRow.DataKey("CveTipoConcepto").ToEntero
'BANCOS COMPLEMENTARIA
If tCveMoneda > 1 Then
@@ -2462,22 +2402,19 @@ Partial Class Bancos_IE
'CANCELA NC
ImporteAplicar = ImporteAplicar '- TxtOtrosIngresosEgresos.Text.ToDecimal
ImporteAplicarMN = ImporteAplicar ' (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL()
+ Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(15, tCveMoneda, False, tCveTipoConcepto)
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), (ImporteAplicarMN), 18, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=ImporteAplicarME, TipoCambio:=TCCompra) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), (ImporteAplicarMN), ConPreP.CveConcepto, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=ImporteAplicarME, TipoCambio:=TCCompra) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
Exit Select
End If
-
-
-
-
'NC COMPLEMENTARIA
If tCveMoneda > 1 Then
ImporteAplicarMN = ((ImporteAplicar * If(tCveMoneda = 1, 1, TCCompra)) - ImporteAplicar).RoundSQL()
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -(ImporteAplicar), -(ImporteAplicarMN), 201, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-(ImporteAplicarME), TipoCambio:=TCCompra) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -(ImporteAplicar), -(ImporteAplicarMN), ConPreP.CveConceptoComplementario, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-(ImporteAplicarME), TipoCambio:=TCCompra) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
End If
@@ -2508,72 +2445,79 @@ Partial Class Bancos_IE
'IMPUESTOS
Dim PorcentajePagoDevDin As Decimal = (ImporteAplicar / ImporteAplicar).RoundSQL(6)
- Dim CveConceptoContableAplciar As Integer = -1
- 'Dim TipoMovtoAplicar = False
+ Dim CveConceptoContableAplicar As Integer = -1
+ Dim CveMonedaDev As Integer = GvRow.DataKey("CveMoneda").ToEntero
+ Dim TotalCompraDev As Decimal = GvRow.DataKey("Original").ToDecimal
+ Dim IVADev As Decimal = GvRow.DataKey("IVA").ToDecimal
+ Dim IEPSDev As Decimal = GvRow.DataKey("IEPS").ToDecimal
+ PorcentajeCompraDevDinC = GvRow.DataKey("PorcentajeIVA").ToDecimal
- Dim ObjCompras As New ClsCompras()
- If ObjCompras.GetCompras(CveCompraDeCDin, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
+ Dim IVADevMN As Decimal = 0
+ Dim IEPSDevMN As Decimal = 0
+ Dim PorcentajeDevolucion As Decimal = ((ImporteAplicar * 100D / TotalCompraDev) / 100).RoundSQL(2)
- Dim dr As DataRow = ObjCompras.DtResultados.Rows(0)
- If dr IsNot Nothing Then
+ IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2)
+ IEPSDev = Math.Round(IEPSDev * PorcentajeDevolucion, 2)
- Dim CveMonedaDev As Integer = dr("CveMoneda").ToString.ToEntero
- Dim TotalCompraDev As Decimal = dr("Total").ToString.ToDecimal
+ If tCveMoneda > 1 Then
+ IVADevMN = IVADev
+ IEPSDevMN = IEPSDev
+ Else
+ IVADevMN = (IVADev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2)
+ IEPSDevMN = (IEPSDev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2)
+ End If
- Dim IVADev As Decimal = dr("IVA").ToString.ToDecimal
- Dim IEPSDev As Decimal = dr("IEPS").ToString.ToDecimal
- PorcentajeCompraDevDinC = ObjCompras.DtResultados.Rows(0)("PorcentajeIVA").ToString.ToDecimal
+ Dim ErrorDevolucionImpuestos As Boolean = False
+ If IVADev > 0 Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IVADev, -IVADevMN, 14, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then
- Dim IVADevMN As Decimal = 0
- Dim IEPSDevMN As Decimal = 0
- Dim PorcentajeDevolucion As Decimal = ((ImporteAplicar * 100D / TotalCompraDev) / 100).RoundSQL(2)
-
- IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2)
- IEPSDev = Math.Round(IEPSDev * PorcentajeDevolucion, 2)
-
- If tCveMoneda > 1 Then
- IVADevMN = IVADev
- IEPSDevMN = IEPSDev
- Else
- IVADevMN = (IVADev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2)
- IEPSDevMN = (IEPSDev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2)
- End If
-
- Dim ErrorDevolucionImpuestos As Boolean = False
-
- If IVADev > 0 Then
-
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IVADev, -IVADevMN, 14, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then
-
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, -IVADevMN, 19, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then
- MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
- ErrorDevolucionImpuestos = True
- End If
- Else
- MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
- ErrorDevolucionImpuestos = True
- End If
- End If
-
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IEPSDev, -IEPSDevMN, 25, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IEPSDev) Then
-
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IEPSDev, -IEPSDevMN, 26, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IEPSDev) Then
- MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
- ErrorDevolucionImpuestos = True
- End If
- Else
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IVADev, -IVADevMN, 19, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IVADev, PorcentajeImpuesto:=PorcentajeCompraDevDinC) Then
MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
ErrorDevolucionImpuestos = True
End If
-
- If ErrorDevolucionImpuestos Then
- MsgError = MsgError & " Error en devolución compra."
- End If
+ Else
+ MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
+ ErrorDevolucionImpuestos = True
End If
End If
+ If IEPSDevMN <> 0 Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -IEPSDev, -IEPSDevMN, 25, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IEPSDev) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -IEPSDev, -IEPSDevMN, 26, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=-IEPSDev) Then
+ MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
+ ErrorDevolucionImpuestos = True
+ End If
+ Else
+ MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución"
+ ErrorDevolucionImpuestos = True
+ End If
+ End If
+ If ErrorDevolucionImpuestos Then
+ MsgError = MsgError & " Error en devolución compra."
+ End If
+
+
End If
Next
+ If TxtOtrosIngresosEgresos.Text.ToDecimal <> 0 Then
+ Dim Impo As Decimal = TxtOtrosIngresosEgresos.Text.ToDecimal
+ Dim TipoMovtoIE As Boolean
+ Dim CveConcIE As Integer
+ If Impo > 0 Then
+ TipoMovtoIE = True
+ Impo = Math.Abs(Impo)
+ CveConcIE = 78
+ Else
+ TipoMovtoIE = False
+ Impo = Math.Abs(Impo)
+ CveConcIE = 211
+ End If
+
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, Impo, CveConcIE, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=0, TipoCambio:=TCDocumento, CveSubProyecto:=CveSubProyecto) Then
+ MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
+ Exit Select
+ End If
+ End If
Else
If tCveMoneda > 1 Then
@@ -2624,6 +2568,7 @@ Partial Class Bancos_IE
'CANCELA NC
ImporteAplicar = ImporteAplicar - TxtOtrosIngresosEgresos.Text.ToDecimal
ImporteAplicarMN = ImporteAplicar ' (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL()
+ Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(15, tCveMoneda, False, 1)
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), (ImporteAplicarMN), 18, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteME:=ImporteAplicarME, TipoCambio:=TCCompra) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
@@ -2664,9 +2609,7 @@ Partial Class Bancos_IE
End If
'IMPUESTOS
- Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6)
- Dim CveConceptoContableAplciar = -1
-
+ Dim PorcentajePagoDevDin As Decimal = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6)
Dim ObjCompras As New ClsCompras()
If ObjCompras.GetCompras(CveCompraDeCDin, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
@@ -2737,7 +2680,7 @@ Partial Class Bancos_IE
Dim ConceptoContable As Integer
Dim TipoMovimiento As Boolean
Dim importeMovimiento As Decimal = TxtImporte.Text.ToDecimal
- Dim FechaMovimiento As Date = Now
+ Dim FechaMovimiento As Date = NowADS()
Dim Concepto As String = ""
Dim Referencia As String = PagueseA
Dim CveCredito As Integer
@@ -3563,7 +3506,7 @@ Partial Class Bancos_IE
Dim ObjCancelacion As New Timbrado
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
- If Banc.UpdateComplementoPagoCancelado(CveComplementoPagoCancelar, 2, CvePACCancelacion, UsuarioActual.CveEmpresa, Date.Now, "", 1) Then
+ If Banc.UpdateComplementoPagoCancelado(CveComplementoPagoCancelar, 2, CvePACCancelacion, UsuarioActual.CveEmpresa, NowADS(), "", 1) Then
CargaComplementosPago()
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
ErrorCancelarComplemento = False
@@ -3571,9 +3514,8 @@ Partial Class Bancos_IE
Else
ErrorCancelarComplemento = True
End If
-
Else
- Dim respCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion)
+ Dim respCancelacion As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion)
If respCancelacion.Verificado Then
If Banc.UpdateComplementoPagoCancelado(CveComplementoPagoCancelar, 2, CvePACCancelacion, UsuarioActual.CveEmpresa, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
@@ -3582,7 +3524,6 @@ Partial Class Bancos_IE
ErrorCancelarComplemento = False
Alert("El complemento se cancelo correctamente.")
End If
-
Else
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
ErrorCancelarComplemento = True
@@ -3852,7 +3793,7 @@ Partial Class Bancos_IE
End Sub
Protected Sub BtnDescontabilizar_Click(sender As Object, e As EventArgs)
Dim ObjConta As New ClsContabilidad
- Dim Movimientos = ObjConta.GetMovimientosPoliza(IDPoliza, UsuarioActual.CveEmpresa)
+ Dim Movimientos As Integer = ObjConta.GetMovimientosPoliza(IDPoliza, UsuarioActual.CveEmpresa)
'Verifica que solo exista 1 compra asociada
If Movimientos = 1 Then
@@ -3892,7 +3833,7 @@ Partial Class Bancos_IE
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
- Dim ErrorCompra = False
+ Dim ErrorCompra As Boolean = False
'Elimina la poliza
If (UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then
@@ -3937,15 +3878,15 @@ Partial Class Bancos_IE
#Region " CARGAR - COMPROBANTE "
Protected Sub BtnConfirmaComprobante_Click(sender As Object, e As EventArgs)
- Dim DirectorioGuardar = String.Format("{0}IE", UsuarioActual.Empresa.Ruta)
- Dim ArchivoTemporal = String.Format("{0}Temp\{1}", UsuarioActual.Empresa.Ruta, Session("FileUpload").ToString)
+ Dim DirectorioGuardar As String = String.Format("{0}IE", UsuarioActual.Empresa.Ruta)
+ Dim ArchivoTemporal As String = String.Format("{0}Temp\{1}", UsuarioActual.Empresa.Ruta, Session("FileUpload").ToString)
If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ArchivoTemporal) Then
Dim Extension As String = Path.GetExtension(ArchivoTemporal)
Dim ObjIE As New ClsBancos
ObjIE.IniciaTransacSQL()
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If ObjIE.UpdateComprobanteIE(Extension.Replace("."c, ""), CveIE) Then
If Not Directory.Exists(DirectorioGuardar) Then Directory.CreateDirectory(DirectorioGuardar)
@@ -4055,7 +3996,7 @@ Partial Class Bancos_IE
If HdnCveCliente.Value.ToEntero > 0 Then
trIEDevolucion.Visible = True
- If ObjMov.GetMovimientosIE(1, HdnCveCliente.Value.ToEntero, DdlCuenta.SelectedValue.ToEntero, Now.AddMonths(-24), Now, CveMoneda, -1, UsuarioActual.CveEmpresa) Then
+ If ObjMov.GetMovimientosIE(1, HdnCveCliente.Value.ToEntero, DdlCuenta.SelectedValue.ToEntero, NowADS().AddMonths(-24), NowADS(), CveMoneda, -1, UsuarioActual.CveEmpresa) Then
DtIEDevolucion = ObjMov.DtResultados.FiltraParametros("Saldo > 0 ")
Else
Alert("Ocurrió un error al cargar los Egresos del Proveedor seleccionado. Por favor vuelva a intetar.", TipoMensaje.MsgError)
@@ -4098,8 +4039,6 @@ Partial Class Bancos_IE
#Region "PAGO ACREEDORES"
Private Sub CargaIEIngresos()
Dim ObjMov As New ClsMovimientos
-
-
If HdnCveProveedor.Value.ToEntero > 0 Then
DivIEAcreedor.Visible = True
DdlIEDevolucion.Items.Clear()
@@ -4258,8 +4197,6 @@ Partial Class Bancos_IE
If DdlCuentaDeposito.SelectedValue.ToEntero > 0 Then
If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCuentaDeposito:=DdlCuentaDeposito.SelectedValue.ToEntero) AndAlso Dep.DtResultados.Rows.Count = 1 Then
-
-
If Dep.DtResultados.Rows.Count > 0 Then
If Dep.DtResultados.Rows(0)("TieneCIE").ToString.ToEntero = 1 Then
@@ -4270,41 +4207,28 @@ Partial Class Bancos_IE
OriReferenciaCIE = Dep.DtResultados.Rows(0)("Referencia").ToString
OriConceptoCIE = Dep.DtResultados.Rows(0)("ConceptoCIE").ToString
-
-
Else
TrReferenciaCIE.Visible = False
End If
-
-
If Boolean.Parse(Dep.DtResultados.Rows(0)("EstatusPagoElectronicoGrupos").ToString) AndAlso Dep.DtResultados.Rows(0)("CveSATBanco").ToString.ToEntero <= 0 Then
Alert("Es necesario establecer el banco de la cuenta deposito", TipoMensaje.MsgAdvertencia)
BtnGuardar.Enabled = False
Else
BtnGuardar.Enabled = True
End If
-
Else
TrReferenciaCIE.Visible = False
End If
-
Else
TrReferenciaCIE.Visible = False
End If
-
-
Else
TrReferenciaCIE.Visible = False
End If
-
-
-
Dep.Dispose()
UpCuentaDeposito.Update()
UpGuardar.Update()
-
-
End Sub
#End Region
@@ -4322,15 +4246,12 @@ Partial Class Bancos_IE
Private Sub BtnRemove_Click(sender As Object, e As EventArgs) Handles BtnRemove.Click
-
-
If Not TxtDescripcion.Text = "" Then
If ChkConciliado.Checked Then
Alert("El documento seleccionado no se puede eliminar porque se encuentra conciliado.", TipoMensaje.MsgError)
Exit Sub
End If
-
Dim ObjAC As ClsContPAQi = Nothing
Dim Banc As New ClsBancos
Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL())
@@ -4360,7 +4281,7 @@ Partial Class Bancos_IE
End If
If Borrar = True Then
- Dim ErrorCompra = False
+ Dim ErrorCompra As Boolean = False
Dim MsgEliminar As String = ""
'VERIFICA SI EL IES ESTA VINCULADO A UNA SOLICITUD VIATICO
@@ -4452,7 +4373,7 @@ Partial Class Bancos_IE
If ObjOC.GetSolicitudAnticipo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then
- Dim DrOC = ObjOC.DtResultados.FiltroPrimero("")
+ Dim DrOC As DataRow = ObjOC.DtResultados.FiltroPrimero("")
If DrOC("TipoTermino").ToString.ToEntero.Contiene(0, 3) Then
TxtObservaciones.Text = DrOC("Descripcion").ToString
@@ -4836,6 +4757,8 @@ Partial Class Bancos_IE
ImporteOriginalDevDin = UrlParametros("ORIGINAL").ToString.ToDecimal.RoundSQL(6)
TxtImporte.Text = UrlParametros("SALDO").ToString.FormatoNumero()
TxtDevolución.Text = UrlParametros("SALDO").ToString.FormatoNumero()
+ divTxtDevolucion.Visible = True
+ lblDevolucion.Visible = True
'TxtImporte.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidad(this,{UrlParametros("SALDO").ToString});")
TxtDevolución.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidadDev( {UrlParametros("SALDO").ToString});")
TxtOtrosIngresosEgresos.Attributes.Add("onkeyup", $"ValidarCantidadDev();")
@@ -4909,7 +4832,7 @@ Partial Class Bancos_IE
Protected Sub LnkCancelar_Click(sender As Object, e As EventArgs)
If ChkConciliado.Checked AndAlso UsuarioActual.CveEmpresa = 119 Then
- 'TxtFechaDesconciliado.Text = Now.ToShortDateString
+ 'TxtFechaDesconciliado.Text = NowADS().ToShortDateString
'UpDesconciliar.Update()
'RegistraScript("$('#DModalDesconciliar').modal()")
Dim fechaCancelacion As String = TxtFechaAplicado.Text.ToDate.AddMonths(1).FirstDayOfMonth.ToShortDateString
@@ -4958,7 +4881,7 @@ Partial Class Bancos_IE
Dim Banco As New ClsBancos
- If Banco.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then
+ If Banco.GetComplementoPagosRep(-1, NowADS().AddYears(-2), NowADS(), CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then
If Not Banco.DtResultados.Rows.Count > 0 Then
Banco.Dispose()
Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia)
@@ -5045,10 +4968,9 @@ Partial Class Bancos_IE
End Try
End Sub
-
Protected Sub LnkEliminaMovComprobacion_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If GvRH.Rows(gvRow.RowIndex).DataKey("CveIE").ToEntero > 0 Then
Dim ObjBancos As New ClsBancos
ObjBancos.IniciaTransacSQL()
@@ -5424,13 +5346,13 @@ Partial Class Bancos_IE
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
- If ObjBanco.UpdateComplementoPagoCancelado(CveComplementoPagoCancelar, 2, CvePACCancelacion, UsuarioActual.CveEmpresa, Date.Now, "", 1) Then
+ If ObjBanco.UpdateComplementoPagoCancelado(CveComplementoPagoCancelar, 2, CvePACCancelacion, UsuarioActual.CveEmpresa, NowADS(), "", 1) Then
CargaComplementosPago()
Alert("El complemento se cancelo correctamente.")
End If
Else
- Dim resp = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion)
+ Dim resp As RespuestaCancelacionSAT = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion)
If resp.Verificado Then
If ObjBanco.UpdateComplementoPagoCancelado(CveComplementoPagoCancelar, 2, CvePACCancelacion, UsuarioActual.CveEmpresa, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then
@@ -5598,7 +5520,7 @@ Partial Class Bancos_IE
Dim respuesta As Boolean = False
- Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, RFCDe, RFCReceptor, "0", True)
+ Dim Vigencia As Timbrado.AcuseCancelacionSAT = Timbrado.VerificarVigenciaSAT(FolioFiscal, RFCDe, RFCReceptor, "0", True)
If Vigencia IsNot Nothing Then
If Vigencia.Estado.ToUpper = "CANCELADO" Then
@@ -5655,8 +5577,8 @@ Partial Class Bancos_IE
UpEliminarCotizacion.Update()
End Sub
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
- RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
- Calendario.EndDate = DateTime.Now
+ RVTxtFechaDocumento.MaximumValue = NowADS().ToShortDateString
+ Calendario.EndDate = NowADS()
End Sub
Private Sub CargaOCRelacionadas()
diff --git a/Bancos/IE2.aspx.vb b/Bancos/IE2.aspx.vb
index c8a8bba77..caf5f55d1 100644
--- a/Bancos/IE2.aspx.vb
+++ b/Bancos/IE2.aspx.vb
@@ -94,7 +94,7 @@ Partial Class Bancos_IE
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
TxtImporte.Attributes.Add("onblur", "upIE(this);")
- Calendario.StartDate = Now.AddMonths(-1)
+ Calendario.StartDate = NowADS().AddMonths(-1)
' rbPagueseA.Attributes.Add("onchange", "upPagueseA(this);")
'If UsuarioActual.CveRol = 1 Then
'rbPagueseAFuncionarioEmpleado.Visible = True : lblPagueseAFuncionarioEmpleado.Visible = True : rbPagueseAProveedor.Visible = True : lblPagueseAProveedor.Visible = True
@@ -210,7 +210,7 @@ Partial Class Bancos_IE
'Configuración de Modalidad Insert
ImgAddObs.Visible = False
CveIE = -1
- TxtFechaDocumento.Text = Now.ToShortDateString
+ TxtFechaDocumento.Text = NowADS().ToShortDateString
End If
@@ -889,14 +889,14 @@ Partial Class Bancos_IE
If Not Opcion.Contiene("DEV", "ANTC") AndAlso MsgError = "" Then
'MOVIMIENTOS EGRESOS
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoContable, TxtObservaciones.Text, Now, 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoContable, TxtObservaciones.Text, NowADS(), 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
Dim IVA As Double = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble - IVA - CIF, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, Now, 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
- If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, TxtObservaciones.Text, 19, TxtObservaciones.Text, Now, 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble - IVA - CIF, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, NowADS(), 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
+ If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, TxtObservaciones.Text, 19, TxtObservaciones.Text, NowADS(), 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
MsgError = "Detalle"
End If
'intereses pagados
- If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, TxtObservaciones.Text, 46, TxtObservaciones.Text, Now, 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
+ If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, TxtObservaciones.Text, 46, TxtObservaciones.Text, NowADS(), 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
MsgError = "Detalle"
End If
Else
@@ -910,8 +910,8 @@ Partial Class Bancos_IE
'MOVIMIENTOS INGRESOS - DEVOLUCIONES
ElseIf Opcion.Contiene("DEV", "ANTC") AndAlso MsgError = "" Then
- 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoContable, TxtObservaciones.Text, Now, 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCliente:=CveCliente, CveCreditoDetalle:=CveCreditoDetalle) Then
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, Now, 0, -1, If(CveProveedor > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCliente:=CveCliente, CveCreditoDetalle:=CveCreditoDetalle) Then
+ 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoContable, TxtObservaciones.Text, NowADS(), 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCliente:=CveCliente, CveCreditoDetalle:=CveCreditoDetalle) Then
+ ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, NowADS(), 0, -1, If(CveProveedor > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCliente:=CveCliente, CveCreditoDetalle:=CveCreditoDetalle) Then
' MsgError = "no se pudo insertar el detalle de la póliza 2"
' End If
'Else
@@ -922,7 +922,7 @@ Partial Class Bancos_IE
Dim tipoCambio As Decimal
If DdlMoneda.SelectedValue.ToString.ToEntero = 2 Then
- tipoCambio = GlobalTipoCambio(Now).ToString.ToDecimal
+ tipoCambio = GlobalTipoCambio(NowADS()).ToString.ToDecimal
Else
tipoCambio = 1
End If
@@ -958,8 +958,8 @@ Partial Class Bancos_IE
Else 'EMpresa Prueba
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoContable, TxtObservaciones.Text, Now, 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, Now, 0, -1, If(CveProveedor > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
+ If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoContable, TxtObservaciones.Text, NowADS(), 0, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, NowADS(), 0, -1, If(CveProveedor > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle) Then
MsgError = "no se pudo insertar el detalle de la póliza 2"
End If
Else
diff --git a/Bancos/MovimientosBancarios.aspx.vb b/Bancos/MovimientosBancarios.aspx.vb
index ff1c36c07..e12ee58a9 100644
--- a/Bancos/MovimientosBancarios.aspx.vb
+++ b/Bancos/MovimientosBancarios.aspx.vb
@@ -178,9 +178,9 @@ Partial Class Bancos_MovimientosBancarios
'''''' LLENADO HEADER
Dim convenio As String = "000775770"
'Campos #1-4 del Header
- HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), DateTime.Now().ToString("yyyy-MM-dd"))
+ HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), NowADS().ToString("yyyy-MM-dd"))
'Campo #5 del Header
- HeaderTexto &= String.Format("{0}{1}", DTProveedorActual(0)("CveProveedor"), DateTime.Now().ToString("yyyyMMdd")).PadRight(20)
+ HeaderTexto &= String.Format("{0}{1}", DTProveedorActual(0)("CveProveedor"), NowADS().ToString("yyyyMMdd")).PadRight(20)
'Campos #6-8 del Header
HeaderTexto &= String.Format("00").PadRight(586)
Dim HeaderLength = HeaderTexto.Length
@@ -209,7 +209,7 @@ Partial Class Bancos_MovimientosBancarios
'Llenamos en blanco datos de otros bancos
'Campos 8-17 del detalle --- 64 de otros bancos y 45 para FILLER --- Fecha de Alta
- DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), DateTime.Now().ToString("yyyy-MM-dd"))
+ DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), NowADS().ToString("yyyy-MM-dd"))
'Otros Bancos NACIONAL!!
Else
@@ -218,7 +218,7 @@ Partial Class Bancos_MovimientosBancarios
'Llenamos datos de otros bancos
'Campos 8- 17 del detalle --- 44 de otros bancos --- 20 de internacional --- 45 Filler -- Fecha de Alta
- DetalleTexto &= String.Format("MXP40{0}0014{1}{2}{3}", RowBanco("CLABE").ToString.PadLeft(35, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), DateTime.Now().ToString("yyyy-MM-dd"))
+ DetalleTexto &= String.Format("MXP40{0}0014{1}{2}{3}", RowBanco("CLABE").ToString.PadLeft(35, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), NowADS().ToString("yyyy-MM-dd"))
End If
'Llenamos datos de Tipo de Persona - Fisica o Moral
@@ -282,7 +282,7 @@ Partial Class Bancos_MovimientosBancarios
' 'Campos 19-21 --- 60 Tipo Persona Moral y 10 FILLER
' DetalleTexto &= Vacio.PadLeft(70)
' 'Campos 22-26 --- Tipo Persona Fisica y #26 RFC
- ' DetalleTexto &= String.Format("{0}{1}{2}{3}{4}", TxtNombrePF.Text.ToUpper.PadRight(20), TxtApellidoPPF.Text.ToUpper.PadRight(20), TxtApellidoMPF.Text.ToUpper.PadRight(20), DateTime.Now().ToString("yyyy-MM-dd"), TxtRFC.Text.ToUpper.PadRight(14))
+ ' DetalleTexto &= String.Format("{0}{1}{2}{3}{4}", TxtNombrePF.Text.ToUpper.PadRight(20), TxtApellidoPPF.Text.ToUpper.PadRight(20), TxtApellidoMPF.Text.ToUpper.PadRight(20), NowADS().ToString("yyyy-MM-dd"), TxtRFC.Text.ToUpper.PadRight(14))
' End If
'End Sub
@@ -337,9 +337,9 @@ Partial Class Bancos_MovimientosBancarios
'''''' LLENADO HEADER
'Campos #1-4 del Header
- HeaderTexto = String.Format("H{0}{1}01", convenio.PadLeft(9, PadCeros), DateTime.Now().ToString("yyyy-MM-dd"))
+ HeaderTexto = String.Format("H{0}{1}01", convenio.PadLeft(9, PadCeros), NowADS().ToString("yyyy-MM-dd"))
'Campo #5 del Header
- HeaderTexto &= String.Format("P{0}{1}", DateTime.Now().ToString("s").Replace("-", "").Replace(":", ""), Vacio.PadRight(14))
+ HeaderTexto &= String.Format("P{0}{1}", NowADS().ToString("s").Replace("-", "").Replace(":", ""), Vacio.PadRight(14))
'Campos #6-11 del Header
HeaderTexto &= String.Format("00").PadRight(1314)
@@ -377,7 +377,7 @@ Partial Class Bancos_MovimientosBancarios
End If
'Campos 24-50 del Detalle 0 1 2 3 4 5 6 7 8 9
- DetalleTexto &= String.Format("{0}{1}FA{2}{3}01{4}N{5}{6}{7}{7}{7}{6}N {7}700{8}{9}{7}", Divisa, Vacio.PadLeft(20), Importe.FormatoNumero.Replace(",", "").Replace(".", "").PadLeft(15, PadCeros), Vacio.PadRight(15, PadCeros), Vacio.PadRight(50), Vacio.PadRight(12, PadCeros), DateTime.Now.ToString("yyyy-MM-dd"), "0001-01-01", Datos.PadRight(700), Vacio.PadRight(52))
+ DetalleTexto &= String.Format("{0}{1}FA{2}{3}01{4}N{5}{6}{7}{7}{7}{6}N {7}700{8}{9}{7}", Divisa, Vacio.PadLeft(20), Importe.FormatoNumero.Replace(",", "").Replace(".", "").PadLeft(15, PadCeros), Vacio.PadRight(15, PadCeros), Vacio.PadRight(50), Vacio.PadRight(12, PadCeros), NowADS().ToString("yyyy-MM-dd"), "0001-01-01", Datos.PadRight(700), Vacio.PadRight(52))
TotalAcumulado += Importe.ToEntero
End Sub
#End Region
diff --git a/Bancos/NotificacionCheques.aspx.vb b/Bancos/NotificacionCheques.aspx.vb
index 76f991f84..4273f09c5 100644
--- a/Bancos/NotificacionCheques.aspx.vb
+++ b/Bancos/NotificacionCheques.aspx.vb
@@ -31,8 +31,8 @@ Partial Class Bancos_NotificacionCheques
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaI.Text = Now.AddMonths(-1).FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().AddMonths(-1).FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargaTipoTransaccion("Egs")
CargaPorNotificar()
CargaPorEntregar()
@@ -470,7 +470,7 @@ Partial Class Bancos_NotificacionCheques
Dim objIE As New ClsBancos
- If objIE.UpdateBancos_IENotificaciones(2, Now.ToString("dd/MM/yyyy"), gvr.FCTextBox("txtObservacionEntrega").Text, gvr.DataKey("CveIE").ToEntero) Then
+ If objIE.UpdateBancos_IENotificaciones(2, NowADS().ToString("dd/MM/yyyy"), gvr.FCTextBox("txtObservacionEntrega").Text, gvr.DataKey("CveIE").ToEntero) Then
Alert("Cheque marcado como Entregado")
End If
diff --git a/Bancos/OtrosIE.aspx.vb b/Bancos/OtrosIE.aspx.vb
index 263f9eff2..36f7c0632 100644
--- a/Bancos/OtrosIE.aspx.vb
+++ b/Bancos/OtrosIE.aspx.vb
@@ -565,7 +565,7 @@ Partial Class Bancos_OtrosIE
End If
If TipoBeneficiario > 0 And TipoBeneficiario < 7 Then
- If ObjColectiva.GetColectivas(CveColectiva, "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
+ If ObjColectiva.GetColectivas(UsuarioActual.CveEmpresa, CveColectiva:=CveColectiva) Then
If ObjColectiva.DtResultados.Rows.Count > 0 Then
TxtPagueseA.Text = ObjColectiva.Colectiva
Else
diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs
index b8b2856c6..42b3d4f01 100644
--- a/Bancos/PagoAcreedor.aspx.cs
+++ b/Bancos/PagoAcreedor.aspx.cs
@@ -44,10 +44,10 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
CargaProveedores();
CargaReporte();
CargaSubproyectos();
- TxtFechaDocumento.Text = DateTime.Now.ToShortDateString();
- TxtFechaPrestamo.Text = DateTime.Now.ToShortDateString();
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.ToShortDateString();
+ TxtFechaDocumento.Text = NowADS().ToShortDateString();
+ TxtFechaPrestamo.Text = NowADS().ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().ToShortDateString();
TxtImporte.Attributes.Add("disabled", "disabled");
}
diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs
index 0330a0c2e..6bd3aeda1 100644
--- a/Bancos/PagoDeudor.aspx.cs
+++ b/Bancos/PagoDeudor.aspx.cs
@@ -47,10 +47,10 @@ public partial class Bancos_PagoDeudor : ClsPaginas
CveMonedaPrestamo = 1;
UsaComplementaria = false;
if (UsuarioActual.CveEmpresa.Contiene(1, 119)) { UsaComplementaria = true; }
- TxtFechaDocumento.Text = DateTime.Now.ToShortDateString();
- TxtFechaPrestamo.Text = DateTime.Now.ToShortDateString();
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.ToShortDateString();
+ TxtFechaDocumento.Text = NowADS().ToShortDateString();
+ TxtFechaPrestamo.Text = NowADS().ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().ToShortDateString();
TxtTCDolaresPrestamo.Text = get_GlobalTipoCambio(TxtFechaPrestamo.Text.ToDateTime()).FormatoNumero(4);
TxtTCDolaresPago.Text = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDateTime()).FormatoNumero(4);
TxtImporte.Attributes.Add("disabled", "disabled");
diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb
index 5288e77e4..707da915e 100644
--- a/Bancos/PagoElectronico.aspx.vb
+++ b/Bancos/PagoElectronico.aspx.vb
@@ -174,8 +174,8 @@ Partial Class Bancos_PagoElectronico
CveCuenta = -1
TipoMasiva = 1
- txtFechaI.Text = Date.Now.ToShortDateString
- txtFechaF.Text = Date.Now.ToShortDateString
+ txtFechaI.Text = NowADS().ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargaCuentas()
CargaProveedores()
@@ -309,7 +309,7 @@ Partial Class Bancos_PagoElectronico
.Clear()
.Buffer = True
.ContentType = "textplain"
- .AddHeader("Content-Disposition", String.Format("attachment;filename={0}{1}.txt", NombreArchivo, Date.Now.ToString("ddMMyyyy")))
+ .AddHeader("Content-Disposition", String.Format("attachment;filename={0}{1}.txt", NombreArchivo, NowADS().ToString("ddMMyyyy")))
.Charset = "UTF-8"
.ContentEncoding = Encoding.Default
.Write(TextoCompleto)
@@ -337,7 +337,7 @@ Partial Class Bancos_PagoElectronico
DirectoryExistsCreate(String.Format("{0}Layout", UsuarioActual.Empresa.Ruta))
- NombreArchivo = String.Format("{2}{1}{0}.txt", UsuarioActual.CveUsuario, Date.Now.ToString("yyyyMMdd-HH-mm"), If(Tipo = 1, "LAYOUTPAGO", "LAYOUTALTA"))
+ NombreArchivo = String.Format("{2}{1}{0}.txt", UsuarioActual.CveUsuario, NowADS().ToString("yyyyMMdd-HH-mm"), If(Tipo = 1, "LAYOUTPAGO", "LAYOUTALTA"))
Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
Dim fs As FileStream = File.Create(path)
@@ -350,9 +350,9 @@ Partial Class Bancos_PagoElectronico
Return True
End Function
Private Function GuardaTXT() As Boolean
- Dim Retorno = True
+ Dim Retorno As Boolean = True
Try
- Dim Ruta = ""
+ Dim Ruta As String = ""
Dim FileName As String = Path.GetFileName(FUTxt.PostedFile.FileName)
NombreArchivo = FileName
Dim Extension As String = Path.GetExtension(FUTxt.PostedFile.FileName)
@@ -412,7 +412,7 @@ Partial Class Bancos_PagoElectronico
'Si la fecha de generacion del archivo es diferente de hoy activamos el boton REGENERAR
- 'If e.Row.DBCampo("Fecha").ToDate.ToShortDateString <> Date.Now.ToShortDateString Then
+ 'If e.Row.DBCampo("Fecha").ToDate.ToShortDateString <> NowADS().ToShortDateString Then
' e.Row.FCLinkButton("LBRegenerar").Visible = True
'End If
If DTEnviadas.MAX("FueConciliado", String.Format("CveLayoutEnvio = {0}", e.Row.DBCampo("CveLayoutEnvio"))).ToEntero > 0 Then
@@ -438,7 +438,7 @@ Partial Class Bancos_PagoElectronico
End If
End Sub
Protected Sub LBRegenerar_Click(sender As Object, e As EventArgs)
- Dim CveBLE = CType(sender, LinkButton).CommandArgument.ToEntero
+ Dim CveBLE As Integer = CType(sender, LinkButton).CommandArgument.ToEntero
Dim DtRegenerar As New DataTable
Dim ObjBancos As New ClsBancos
@@ -523,11 +523,11 @@ Partial Class Bancos_PagoElectronico
TotalAcumulado = 0
''VALIDA CUENTAS DEPOSITOS
- Dim ErrorCuenta = False
+ Dim ErrorCuenta As Boolean = False
Dim ProveedoresError As StringBuilder = New StringBuilder
ProveedoresError.AppendFormat("
Proveedor
Cuenta
Error
")
Dim TotalDetalles As Integer = 0
- Dim EsBancomer = False
+ Dim EsBancomer As Boolean = False
For Each gvr As DataRow In DtTemp.Rows
If gvr("CveCuentaDeposito").ToString <> "" AndAlso gvr("EstatusPagoElectronico").ToString <> "True" AndAlso gvr("AltaCuenta").ToString = "1" Then
DTPendienteActual = DtTemp.FiltraParametros(String.Format("CveCuentaDeposito = {0}", gvr("CveCuentaDeposito").ToString))
@@ -626,7 +626,7 @@ Partial Class Bancos_PagoElectronico
Descargas.AppendFormat("
", NombreArchivo)
- Dim TextoErrorProveedores = ""
+ Dim TextoErrorProveedores As String = ""
If ProveedoresError.Length > 160 Then TextoErrorProveedores = String.Format("
", ProveedoresError.ToString)
Alert(String.Format(" El Layout fue creado satisfactoriamente.{1} Descargas:
{0}
", Descargas, TextoErrorProveedores), TipoMensaje.MsgInformacion)
@@ -639,7 +639,7 @@ Partial Class Bancos_PagoElectronico
End Sub
Protected Sub CrearDetalle()
- Dim Resultado = True
+ Dim Resultado As Boolean = True
Dim CuentaDeposito As String = ""
Dim TipoCuentaDeposito As String = ""
Dim TipoCuenta As String = ""
@@ -673,7 +673,7 @@ Partial Class Bancos_PagoElectronico
'Llenamos en blanco datos de otros bancos
'Campos 8-17 del detalle --- 64 de otros bancos y 45 para FILLER --- Fecha de Alta
- DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), DateTime.Now().ToString("yyyy-MM-dd"))
+ DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), NowADS().ToString("yyyy-MM-dd"))
'Otros Bancos NACIONAL!!
@@ -687,7 +687,7 @@ Partial Class Bancos_PagoElectronico
'Llenamos datos de otros bancos
'Campos 8- 17 del detalle --- 44 de otros bancos --- 20 de internacional --- 45 Filler -- Fecha de Alta
- DetalleTexto &= String.Format("{0}40{1}{2}{3}{4}{5}", DTPendienteActual(0)("Abreviatura").ToString, DTPendienteActual(0)("CLABE").ToString.PadLeft(35, PadCeros), DTPendienteActual(0)("CLABE").ToString.Substring(0, 3).PadLeft(4, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), DateTime.Now().ToString("yyyy-MM-dd"))
+ DetalleTexto &= String.Format("{0}40{1}{2}{3}{4}{5}", DTPendienteActual(0)("Abreviatura").ToString, DTPendienteActual(0)("CLABE").ToString.PadLeft(35, PadCeros), DTPendienteActual(0)("CLABE").ToString.Substring(0, 3).PadLeft(4, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), NowADS().ToString("yyyy-MM-dd"))
End If
'Llenamos datos de Tipo de Persona - Fisica o Moral
@@ -710,7 +710,7 @@ Partial Class Bancos_PagoElectronico
''LLENA DT PARA REPORTE
- Dim Row = DtAlta.NewRow()
+ Dim Row As DataRow = DtAlta.NewRow()
Row("Proveedor") = DTPendienteActual(0)("RazonSocial").ToString
Row("Banco") = DTPendienteActual(0)("BancoNombre").ToString
Row("TipoCuenta") = TipoCuentaDeposito
@@ -722,7 +722,7 @@ Partial Class Bancos_PagoElectronico
'Persona Moral
If DTPendienteActual(0)("RFC").ToString.Length = 12 Then
Dim fecha As String = DTPendienteActual(0)("FechaIng").ToString
- Dim NombreProveedor = DTPendienteActual(0)("RazonSocial").ToString.Replace("‚"c, Vacio).Replace("‚"c, Vacio).ToUpper.PadRight(50)
+ Dim NombreProveedor As String = DTPendienteActual(0)("RazonSocial").ToString.Replace("‚"c, Vacio).Replace("‚"c, Vacio).ToUpper.PadRight(50)
NombreProveedor = If(NombreProveedor.Length > 50, NombreProveedor.Substring(0, 50), NombreProveedor)
'Campo 18-20 del detalle
@@ -759,7 +759,7 @@ Partial Class Bancos_PagoElectronico
Dim NombreComplejo As New List(Of String)
'ignoramos cualquier palabra del nombre que tenga un length igual o menor a 2
- For index = 0 To Nombre.Length - 1
+ For index As Integer = 0 To Nombre.Length - 1
If Nombre(index).Length > 2 Then
NombreComplejo.Add(Nombre(index))
End If
@@ -772,10 +772,10 @@ Partial Class Bancos_PagoElectronico
ElseIf NombreComplejo.Count = 4 Then
DetalleTexto &= String.Format("F{0}{1}{2}{3}", Vacio.PadRight(70), (NombreComplejo.Item(0) & " " & NombreComplejo.Item(1)).PadRight(20).Substring(0, 20), NombreComplejo.Item(2).PadRight(20).Substring(0, 20), NombreComplejo.Item(3).PadRight(20).Substring(0, 20))
ElseIf NombreComplejo.Count > 4 Then
- Dim Nombres = ""
+ Dim Nombres As String = ""
'todas las palabras menos las 2 ultimas forman parte del nombre
- For index = 0 To NombreComplejo.Count - 3
+ For index As Integer = 0 To NombreComplejo.Count - 3
If Nombres <> "" Then Nombres += " "
Nombres += NombreComplejo.Item(index)
Next
@@ -800,17 +800,17 @@ Partial Class Bancos_PagoElectronico
'''''' LLENADO HEADER
Dim convenio As String = DTPendienteActual(0)("ConvenioPagoElectronico").ToString
'Campos #1-4 del Header
- HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), DateTime.Now().ToString("yyyy-MM-dd"))
+ HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), NowADS().ToString("yyyy-MM-dd"))
'Campo #5 del Header
Dim IdentificadoUsuario As String = UsuarioActual.Usuario.Replace(" ", "").Replace(".", "").Replace("@", "").Replace("/", "").Replace("\", "").Replace("-", "").Replace("&", "").Replace(",", "").Replace("+", "").Replace("_", "").ToUpper.Trim
IdentificadoUsuario = If(IdentificadoUsuario.Length > 12, IdentificadoUsuario.Substring(0, 12), IdentificadoUsuario)
- ' Dim Identificado As String = String.Format("{0}{1}", UsuarioActual.Usuario, DateTime.Now().ToString("yyyyMMdd")))
+ ' Dim Identificado As String = String.Format("{0}{1}", UsuarioActual.Usuario, NowADS().ToString("yyyyMMdd")))
- HeaderTexto &= String.Format("{0}{1}", IdentificadoUsuario, DateTime.Now().ToString("yyyyMMdd")).PadRight(20)
+ HeaderTexto &= String.Format("{0}{1}", IdentificadoUsuario, NowADS().ToString("yyyyMMdd")).PadRight(20)
'Campos #6-8 del Header
HeaderTexto &= String.Format("00").PadRight(586)
- Dim HeaderLength = HeaderTexto.Length
+ Dim HeaderLength As Integer = HeaderTexto.Length
''''' LLENADO DE TRAILER
TrailerTexto = String.Format("T{0}{1}{2}", Registros.ToString.PadLeft(10, PadCeros), Vacio.PadRight(50, PadCeros), Vacio.PadRight(575))
@@ -873,18 +873,18 @@ Partial Class Bancos_PagoElectronico
'Insertar en LayoutEnvios
Dim ObjBancos As New ClsBancos
ObjBancos.IniciaTransacSQL()
- Dim ErrorLayout = False
+ Dim ErrorLayout As Boolean = False
Dim TotalDetalles As Integer = 0
'CREA CARPETA SI NO EXISTE
Dim path As String = Server.MapPath(String.Format("~/Empresas/{0}/Layout/", UsuarioActual.CveEmpresa))
- Dim exists = System.IO.Directory.Exists(path)
+ Dim exists As Boolean = System.IO.Directory.Exists(path)
If Not exists Then
System.IO.Directory.CreateDirectory(path)
End If
- Dim CveIEs = ""
+ Dim CveIEs As String = ""
CreaDtPago()
For Each gvr As DataRow In DTTemp.Rows
@@ -893,7 +893,7 @@ Partial Class Bancos_PagoElectronico
'ACTUALIZA FECHADOCUMENTO DEL IE
'If CveBLE > 0 Then
- ' ObjBancos.UpdateBancos_IE(Date.Now, Date.Now, DTPendienteActual(0)("CveIE").ToString.ToEntero)
+ ' ObjBancos.UpdateBancos_IE(NowADS(), NowADS(), DTPendienteActual(0)("CveIE").ToString.ToEntero)
'End If
If TotalDetalles > 0 Then
@@ -909,13 +909,13 @@ Partial Class Bancos_PagoElectronico
If CveBLE > 0 Then
'ACTUALIZAMOS EL ENVIO SI ES REGENERACION
- If Not ObjBancos.UpdateLayoutEnvios(CveBLE, Date.Now) Then
+ If Not ObjBancos.UpdateLayoutEnvios(CveBLE, NowADS()) Then
ErrorLayout = True
End If
'GUARDAMOS EL ENVIO SI NO ES REGENERACION
Else
- Dim CveLayoutEnvio = ObjBancos.AddLayoutEnvios(NombreArchivo, Date.Now, CveCuenta)
+ Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta)
If CveLayoutEnvio > 0 Then
For Each dr As DataRow In DTTemp.Rows
@@ -937,7 +937,7 @@ Partial Class Bancos_PagoElectronico
ObjBancos.Dispose()
- Dim Des = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
+ Dim Des As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
Dim Descargas As New StringBuilder()
Descargas.AppendFormat("
", NombreArchivo)
@@ -978,7 +978,7 @@ Partial Class Bancos_PagoElectronico
''CLAVE DE REGISTRO PARA CONTROL PROPIO ADSISTEMAS -- orita se esta guardando en el campo #9
- Dim Cve = String.Format("CVEIE{0}", DTPendienteActual(0)("CveIE").ToString).ToUpper 'cveIE
+ Dim Cve As String = String.Format("CVEIE{0}", DTPendienteActual(0)("CveIE").ToString).ToUpper 'cveIE
''''' LLENADO DE DETALLE
@@ -1002,17 +1002,15 @@ Partial Class Bancos_PagoElectronico
End If
'OBTENEMOS EL CORREO DEL PROVEEDOR
- Dim Correo = CorreoNotificacionesEmpresa.ToUpper.PadRight(50)
+ Dim Correo As String = CorreoNotificacionesEmpresa.ToUpper.PadRight(50)
'Correo = If(Correo.Length > 0, Correo.ToUpper.PadRight(50), Vacio.PadRight(50))
'Campos 24-50 del Detalle 0 1 2 3 4 5 6 7 8 9
- DetalleTexto &= String.Format("{0}{1}FA{2}{3}01{4}N{5}{6}{7}{7}{7}{6}N {7}700{8}{9}{7}", Divisa, Vacio.PadLeft(20), Importe.FormatoNumero.Replace(",", "").Replace(".", "").PadLeft(15, PadCeros), Vacio.PadRight(15, PadCeros), Correo, Vacio.PadRight(12, PadCeros), DateTime.Now.ToString("yyyy-MM-dd"), "0001-01-01", Observaciones.PadRight(700), Vacio.PadRight(52))
+ DetalleTexto &= String.Format("{0}{1}FA{2}{3}01{4}N{5}{6}{7}{7}{7}{6}N {7}700{8}{9}{7}", Divisa, Vacio.PadLeft(20), Importe.FormatoNumero.Replace(",", "").Replace(".", "").PadLeft(15, PadCeros), Vacio.PadRight(15, PadCeros), Correo, Vacio.PadRight(12, PadCeros), NowADS().ToString("yyyy-MM-dd"), "0001-01-01", Observaciones.PadRight(700), Vacio.PadRight(52))
TotalAcumulado += Importe.ToDouble
-
-
''LLENA DTPAGOS PARA REPORTE
- Dim Row = DtPago.NewRow()
+ Dim Row As DataRow = DtPago.NewRow()
Row("Proveedor") = DTPendienteActual(0)("RazonSocial").ToString
If DTPendienteActual(0)("CIE").ToString <> "" Then
@@ -1034,9 +1032,9 @@ Partial Class Bancos_PagoElectronico
'''''' LLENADO HEADER
'Campos #1-4 del Header
- HeaderTexto = String.Format("H{0}{1}01", convenio.PadLeft(9, PadCeros), DateTime.Now().ToString("yyyy-MM-dd"))
+ HeaderTexto = String.Format("H{0}{1}01", convenio.PadLeft(9, PadCeros), NowADS().ToString("yyyy-MM-dd"))
'Campo #5 del Header
- HeaderTexto &= String.Format("P{0}{1}", DateTime.Now().ToString("s").Replace("-", "").Replace(":", ""), Vacio.PadRight(14))
+ HeaderTexto &= String.Format("P{0}{1}", NowADS().ToString("s").Replace("-", "").Replace(":", ""), Vacio.PadRight(14))
'Campos #6-11 del Header
HeaderTexto &= String.Format("00").PadRight(1314)
@@ -1070,7 +1068,7 @@ Partial Class Bancos_PagoElectronico
Protected Sub BtnCargarAlta_Click(sender As Object, e As EventArgs)
- Dim ErrorArchivo = False
+ Dim ErrorArchivo As Boolean = False
If FUTxt.HasFile Then
If Not GuardaTXT() Then
@@ -1090,18 +1088,18 @@ Partial Class Bancos_PagoElectronico
Texto = sr.ReadToEnd()
sr.Close()
- Dim TextoArreglo() = Texto.Split(CChar(vbCrLf))
+ Dim TextoArreglo As String() = Texto.Split(CChar(vbCrLf))
'Alert(TextoArreglo.Length.ToString)
'LEE LINEA POR LINEA
- Dim RespuestaHeader = "", RespuestaDetalle = "", RespuestaTrailer = "", CveCuentasDeposito = ""
+ Dim RespuestaHeader As String = "", RespuestaDetalle As String = "", RespuestaTrailer As String = "", CveCuentasDeposito As String = ""
CreaDtAlta()
Dim ObjGrales As New ClsGenerales
Dim Row As DataRow = Nothing
- Dim TipoCuentaDeposito = ""
+ Dim TipoCuentaDeposito As String = ""
- For i = 0 To TextoArreglo.Length - 1 Step 1
+ For i As Integer = 0 To TextoArreglo.Length - 1 Step 1
'Valida que el primer renglon sea el HEADER
If i = 0 Then
If TextoArreglo(i).Substring(0, 1) <> "H" Then
@@ -1211,10 +1209,10 @@ Partial Class Bancos_PagoElectronico
End If
'DIVIDE DETALLE
- Dim Detalle() = RespuestaDetalle.Split(CChar(vbCrLf))
+ Dim Detalle As String() = RespuestaDetalle.Split(CChar(vbCrLf))
'DIVIDE TRAILER
- Dim Trailer() = RespuestaTrailer.Split(CChar(vbCrLf))
+ Dim Trailer As String() = RespuestaTrailer.Split(CChar(vbCrLf))
'ARMADO DE RESPUESTA
Respuesta.AppendFormat(" Resumen de respuesta: {0} ", RespuestaHeader)
@@ -1225,9 +1223,9 @@ Partial Class Bancos_PagoElectronico
'For i = 0 To Detalle.Length - 1
' Respuesta.AppendFormat("
{0}
{1}
", i + 1, Detalle(i).Trim)
'Next
- Dim i = 1
- Dim Style = ""
- Dim TotalExitos = 0, TotalFracasos = 0
+ Dim i As Integer = 1
+ Dim Style As String = ""
+ Dim TotalExitos As Integer = 0, TotalFracasos As Integer = 0
For Each dr As DataRow In DtAlta.Rows
If dr("estatus").ToString.Trim.Contiene("OPERACION EXITOSA", "ALTA TERCERO EXITOSO") Then
@@ -1258,11 +1256,11 @@ Partial Class Bancos_PagoElectronico
If CveCuentasDeposito <> "" Then
Dim ObjIE As New ClsBancos
- Dim ErrorDB = False
+ Dim ErrorDB As Boolean = False
ObjIE.IniciaTransacSQL()
- Dim ArrayCuentasDeposito() = CveCuentasDeposito.Split(","c)
+ Dim ArrayCuentasDeposito As String() = CveCuentasDeposito.Split(","c)
- For index = 0 To ArrayCuentasDeposito.Length - 1
+ For index As Integer = 0 To ArrayCuentasDeposito.Length - 1
If Not ObjIE.UpdateCuentaDepositoPagoElectronico(ArrayCuentasDeposito(index).ToEntero) Then
ErrorDB = True
End If
@@ -1323,8 +1321,8 @@ Partial Class Bancos_PagoElectronico
Protected Sub BtnCargarPago_Click(sender As Object, e As System.EventArgs)
- Dim ErrorArchivo = False
- Dim TextoErrorArchivo = "Ocurrió un problema al leer el archivo, por favor revise que el archivo sea el correcto e intente de nuevo."
+ Dim ErrorArchivo As Boolean = False
+ Dim TextoErrorArchivo As String = "Ocurrió un problema al leer el archivo, por favor revise que el archivo sea el correcto e intente de nuevo."
If FUTxt.HasFile Then
If Not GuardaTXT() Then
@@ -1342,17 +1340,17 @@ Partial Class Bancos_PagoElectronico
Dim sr As New System.IO.StreamReader(NombreArchivo)
Texto = sr.ReadToEnd()
sr.Close()
- Dim TextoArreglo() = Texto.Split(CChar(vbCrLf))
+ Dim TextoArreglo As String() = Texto.Split(CChar(vbCrLf))
'INICIALIZA VARIABLES
Dim ObjBancos As New ClsBancos
- Dim RespuestaHeader = "", RespuestaDetalle = "", RespuestaTrailer = "", Proveedor = "", CuentaAbono = "", Estatus = "", CveIEs = "", EstatusIEs = "", FechaMovto = "", Correos = ""
+ Dim RespuestaHeader As String = "", RespuestaDetalle As String = "", RespuestaTrailer As String = "", Proveedor As String = "", CuentaAbono As String = "", Estatus As String = "", CveIEs As String = "", EstatusIEs As String = "", FechaMovto As String = "", Correos As String = ""
Dim Row As DataRow = Nothing
- Dim Convenio = ""
+ Dim Convenio As String = ""
CreaDtPago()
'LEE LINEA POR LINEA
- For i = 0 To TextoArreglo.Length - 1
+ For i As Integer = 0 To TextoArreglo.Length - 1
'Valida que el primer renglon sea el HEADER
If i = 0 Then
If TextoArreglo(i).Substring(0, 1) <> "H" Then
@@ -1504,7 +1502,7 @@ Partial Class Bancos_PagoElectronico
If Not ErrorArchivo Then
'DIVIDE HEADER
- Dim Header() = RespuestaHeader.Split(CChar("|"))
+ Dim Header As String() = RespuestaHeader.Split(CChar("|"))
'TRADUCE CODIGO RESPUESTA HEADER
If Header(0) = "01" Then
RespuestaHeader = "ACEPTADO TOTAL"
@@ -1516,14 +1514,14 @@ Partial Class Bancos_PagoElectronico
RespuestaHeader += String.Format(" Cuenta Cargo: {0}", Header(1))
'DIVIDE DETALLE
- Dim Detalle() = RespuestaDetalle.Split(CChar(vbCrLf))
+ Dim Detalle As String() = RespuestaDetalle.Split(CChar(vbCrLf))
'ARMADO DE RESPUESTA
Respuesta.AppendFormat(" Resumen de respuesta: {0} ", RespuestaHeader)
Respuesta.AppendFormat("Numero de movimientos: {0}
", Detalle.Length.ToString)
Respuesta.Append("----------------------------------------------------- Detalle de los movimientos -------------------------------------------------- ")
Respuesta.Append("
#
Proveedor
Importe($)
Moneda
Estatus
")
- For i = 0 To Detalle.Length - 1
+ For i As Integer = 0 To Detalle.Length - 1
Respuesta.AppendFormat("
{0}
{1}
", i + 1, Detalle(i).Trim)
Next
Respuesta.Append("
---------------------------------------------------------------------------------------------------------------------- ")
@@ -1535,17 +1533,17 @@ Partial Class Bancos_PagoElectronico
If Not ErrorArchivo Then
If CveIEs <> "" Then
Dim ObjIE As New ClsBancos
- Dim ErrorDB = False
+ Dim ErrorDB As Boolean = False
ObjIE.IniciaTransacSQL()
- Dim ArrayCveIEs() = CveIEs.Split(","c)
- Dim ArrayEstatusIEs() = EstatusIEs.Split(","c)
- Dim ArrayFechasMovto() = FechaMovto.Split(","c)
- Dim ArrayCorreos() = Correos.Split("|"c)
+ Dim ArrayCveIEs As String() = CveIEs.Split(","c)
+ Dim ArrayEstatusIEs As String() = EstatusIEs.Split(","c)
+ Dim ArrayFechasMovto As String() = FechaMovto.Split(","c)
+ Dim ArrayCorreos As String() = Correos.Split("|"c)
Dim ArregloHilos As New Generic.List(Of System.Threading.Thread)
Dim ArregloParametros As New Generic.List(Of List(Of String))
- For index = 0 To ArrayCveIEs.Length - 1
+ For index As Integer = 0 To ArrayCveIEs.Length - 1
If ObjIE.UpdatePagoElectronicoCarga(ArrayCveIEs(index).ToEntero, ArrayEstatusIEs(index).ToEntero) Then
'Cuando salio exitoso actualizamos el IE
@@ -1613,11 +1611,6 @@ Partial Class Bancos_PagoElectronico
EnviarCorreoNotificacion(CveIENotificar, NotificarA, "", UsuarioActual, False)
Next
-
-
-
-
-
Respuesta.Append("
NOTA: El archivo se analizo correctamente y se efectuaron todos los cambios en el sistema.")
Alert(Respuesta.ToString, TipoMensaje.MsgInformacion)
@@ -1679,12 +1672,12 @@ Partial Class Bancos_PagoElectronico
DtTemp = DTFyE
''VALIDA CUENTAS DEPOSITOS
- Dim ErrorCuenta = False
+ Dim ErrorCuenta As Boolean = False
Dim FyEError As StringBuilder = New StringBuilder
FyEError.AppendFormat("
Personal
Cuenta
Error
")
Dim TotalDetalles As Integer = 0
- Dim EsBancomer = False
+ Dim EsBancomer As Boolean = False
For Each gvr As DataRow In DtTemp.Rows
If gvr("CvePersonal").ToString <> "" AndAlso gvr("EstatusPagoElectronico").ToString <> "True" AndAlso gvr("AltaCuenta").ToString = "1" Then
DTPendienteActual = DtTemp.FiltraParametros(String.Format("CveCuentaDeposito = {0}", gvr("CveCuentaDeposito").ToString))
@@ -1758,7 +1751,7 @@ Partial Class Bancos_PagoElectronico
Descargas.AppendFormat("
", NombreArchivo)
- Dim TextoErrorProveedores = ""
+ Dim TextoErrorProveedores As String = ""
If FyEError.Length > 160 Then TextoErrorProveedores = String.Format("
", FyEError.ToString)
Alert(String.Format(" El Layout fue creado satisfactoriamente.{1} Descargas:
{0}
", Descargas, TextoErrorProveedores), TipoMensaje.MsgInformacion)
@@ -1772,7 +1765,7 @@ Partial Class Bancos_PagoElectronico
End Sub
Private Sub GeneraAltaDetalleFyE()
- Dim Resultado = True
+ Dim Resultado As Boolean = True
Dim CuentaDeposito As String = ""
Dim TipoCuentaDeposito As String = ""
Dim TipoCuenta As String = ""
@@ -1806,7 +1799,7 @@ Partial Class Bancos_PagoElectronico
'Llenamos en blanco datos de otros bancos
'Campos 8-17 del detalle --- 64 de otros bancos y 45 para FILLER --- Fecha de Alta
- DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), DateTime.Now().ToString("yyyy-MM-dd"))
+ DetalleTexto &= String.Format("{0}{1}", Vacio.PadLeft(109), NowADS().ToString("yyyy-MM-dd"))
'Otros Bancos NACIONAL!!
@@ -1820,7 +1813,7 @@ Partial Class Bancos_PagoElectronico
'Llenamos datos de otros bancos
'Campos 8- 17 del detalle --- 44 de otros bancos --- 20 de internacional --- 45 Filler -- Fecha de Alta
- DetalleTexto &= String.Format("{0}40{1}{2}{3}{4}{5}", DTPendienteActual(0)("Abreviatura").ToString, DTPendienteActual(0)("CLABE").ToString.PadLeft(35, PadCeros), DTPendienteActual(0)("CLABE").ToString.Substring(0, 3).PadLeft(4, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), DateTime.Now().ToString("yyyy-MM-dd"))
+ DetalleTexto &= String.Format("{0}40{1}{2}{3}{4}{5}", DTPendienteActual(0)("Abreviatura").ToString, DTPendienteActual(0)("CLABE").ToString.PadLeft(35, PadCeros), DTPendienteActual(0)("CLABE").ToString.Substring(0, 3).PadLeft(4, PadCeros), Vacio.PadRight(20), Vacio.PadRight(45), NowADS().ToString("yyyy-MM-dd"))
End If
'Llenamos datos de Tipo de Persona - Fisica
@@ -1845,9 +1838,8 @@ Partial Class Bancos_PagoElectronico
'Campos 37-39 -- FILLER
DetalleTexto &= String.Format("00{0}", Vacio.PadRight(38))
-
''LLENA DT PARA REPORTE
- Dim Row = DtAlta.NewRow()
+ Dim Row As DataRow = DtAlta.NewRow()
Row("Proveedor") = DTPendienteActual(0)("RazonSocial").ToString
Row("Banco") = DTPendienteActual(0)("BancoNombre").ToString
Row("TipoCuenta") = TipoCuentaDeposito
@@ -1858,12 +1850,12 @@ Partial Class Bancos_PagoElectronico
'''''' LLENADO HEADER
Dim convenio As String = DTPendienteActual(0)("ConvenioPagoElectronico").ToString
'Campos #1-4 del Header
- HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), DateTime.Now().ToString("yyyy-MM-dd"))
+ HeaderTexto = String.Format("H{0}{1}GRUPO01 ", convenio.PadLeft(9, PadCeros), NowADS().ToString("yyyy-MM-dd"))
'Campo #5 del Header
- HeaderTexto &= String.Format("{0}{1}", UsuarioActual.CveUsuario, DateTime.Now().ToString("yyyyMMdd")).PadRight(20)
+ HeaderTexto &= String.Format("{0}{1}", UsuarioActual.CveUsuario, NowADS().ToString("yyyyMMdd")).PadRight(20)
'Campos #6-8 del Header
HeaderTexto &= String.Format("00").PadRight(586)
- Dim HeaderLength = HeaderTexto.Length
+ Dim HeaderLength As Integer = HeaderTexto.Length
''''' LLENADO DE TRAILER
TrailerTexto = String.Format("T{0}{1}{2}", Registros.ToString.PadLeft(10, PadCeros), Vacio.PadRight(50, PadCeros), Vacio.PadRight(575))
@@ -1883,8 +1875,8 @@ Partial Class Bancos_PagoElectronico
Private Sub CargaReporte()
Dim ObjBancos As New ClsBancos
- Dim FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
- Dim FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
+ Dim FechaI As String = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
+ Dim FechaF As String = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
If ObjBancos.GetLayoutPagosEnviados(DdlCuentaReportes.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, DdlTipoReportes.SelectedValue, FechaI, DateAdd(DateInterval.Day, 1, FechaF.ToDate).ToShortDateString) Then
DTReportes = ObjBancos.DtResultados
@@ -2297,7 +2289,7 @@ Partial Class Bancos_PagoElectronico
' strBody.Append("
", UsuarioActual.CveEmpresa, CveIE, NowADS().Ticks)
End If
Alert(Str.ToString, TipoMensaje.MsgInformacion)
@@ -936,7 +936,7 @@ Partial Class Bancos_Reembolsos
TxtObservaciones.Text = ""
TxtImporte.Text = ""
TxtImporteVinculado.Text = ""
- TxtFechaDocumento.Text = Date.Now.ToShortDateString
+ TxtFechaDocumento.Text = NowADS().ToShortDateString
'DdlCuenta.SelectedValue = "-1"
DdlTipoTransaccion.SelectedValue = "-1"
DdlTipoTransaccionDiferencia_SelectedIndexChanged(DdlTipoTransaccion, EventArgs.Empty)
@@ -1046,7 +1046,7 @@ Partial Class Bancos_Reembolsos
DDlCheques_SelectedIndexChanged(DDlCheques, EventArgs.Empty)
If GvCxP.Rows.Count > 0 Then
- TxtFechaDocumento.Text = Now.ToShortDateString
+ TxtFechaDocumento.Text = NowADS().ToShortDateString
'BtnIEGuardar.Enabled = True
If Not DdlPersonal.SelectedValue = "-2" Then
diff --git a/Bancos/RegistroPagoIntermediario.aspx.vb b/Bancos/RegistroPagoIntermediario.aspx.vb
index 939ade0a5..b36642082 100644
--- a/Bancos/RegistroPagoIntermediario.aspx.vb
+++ b/Bancos/RegistroPagoIntermediario.aspx.vb
@@ -27,7 +27,7 @@ Partial Class Bancos_PagosIntermediarios
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
FacturasCheckadas = 0
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
CargaCuentas()
CargaFiltros()
End If
@@ -193,7 +193,7 @@ Partial Class Bancos_PagosIntermediarios
TxtObservaciones.Text = ""
TxtTotalBancos.Text = ""
TxtTotalComisiones.Text = ""
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
CargaDatos()
Alert(String.Format("El Depósito se ha registrado correctamente."), TipoMensaje.MsgInformacion)
Else
diff --git a/Bancos/RepClientesAnticipo.aspx.vb b/Bancos/RepClientesAnticipo.aspx.vb
index d39a7f328..1a3d2eaff 100644
--- a/Bancos/RepClientesAnticipo.aspx.vb
+++ b/Bancos/RepClientesAnticipo.aspx.vb
@@ -167,7 +167,7 @@ Partial Class Bancos_RepClientesAnticipo
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
diff --git a/Bancos/RepCobrado.aspx.vb b/Bancos/RepCobrado.aspx.vb
index c6e43162a..5acea6733 100644
--- a/Bancos/RepCobrado.aspx.vb
+++ b/Bancos/RepCobrado.aspx.vb
@@ -52,8 +52,8 @@ Partial Class Ventas_RepRecuperacion
DdlBanco.Items.Insert(0, New ListItem("Todos", "-1"))
DdlBanco.DataBind()
- txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = $"01/{NowADS().Month}/{NowADS().Year}"
+ txtFechaF.Text = NowADS().ToShortDateString
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
@@ -148,10 +148,10 @@ Partial Class Ventas_RepRecuperacion
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF(RutaPDF, DtDatos, params, "RepRecuperacion" & Now.ToString("yyyyMMddhhmmss"), Formato)
+ ImprimirPDF(RutaPDF, DtDatos, params, "RepRecuperacion" & NowADS().ToString("yyyyMMddhhmmss"), Formato)
End Sub
End Class
diff --git a/Bancos/RepCobradoDetalle.aspx.vb b/Bancos/RepCobradoDetalle.aspx.vb
index e70927ee4..52ee35b89 100644
--- a/Bancos/RepCobradoDetalle.aspx.vb
+++ b/Bancos/RepCobradoDetalle.aspx.vb
@@ -71,8 +71,8 @@ Partial Class Ventas_RepRecuperacionDetalle
DdlBanco.Items.Insert(0, New ListItem("Todos", "-1"))
DdlBanco.DataBind()
- txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = $"01/{NowADS().Month}/{NowADS().Year}"
+ txtFechaF.Text = NowADS().ToShortDateString
'Cargamos las fechas
@@ -204,9 +204,9 @@ Partial Class Ventas_RepRecuperacionDetalle
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF(RutaPDF, DtDatos, params, "RepRecuperacionDetalle" & Now.ToString("yyyyMMddhhmmss"), Formato)
+ ImprimirPDF(RutaPDF, DtDatos, params, "RepRecuperacionDetalle" & NowADS().ToString("yyyyMMddhhmmss"), Formato)
End Sub
End Class
diff --git a/Bancos/RepCobradoPagado.aspx.vb b/Bancos/RepCobradoPagado.aspx.vb
index 1c18b9c41..a9a301a3a 100644
--- a/Bancos/RepCobradoPagado.aspx.vb
+++ b/Bancos/RepCobradoPagado.aspx.vb
@@ -50,8 +50,8 @@ Partial Class Bancos_RepCobradoPagado
#Region "CARGA DATOS"
Private Sub CargaCombos()
DdlGrupo.Items.Clear()
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = DateTime.Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
If DdlModalidad.SelectedValue = "2" Then
DdlGrupo.Items.Insert(0, New ListItem("Año", "1"))
DdlGrupo.Items.Insert(1, New ListItem("Año/Mes", "2"))
@@ -91,7 +91,7 @@ Partial Class Bancos_RepCobradoPagado
If ObjBancos.GetCobradoPagado(DdlModalidad.SelectedValue.ToEntero, DdlGrupo.SelectedValue.ToEntero,
If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", MinFecha, txtFechaI.Text.ToDate),
- If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", Now, txtFechaF.Text.ToDate),
+ If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", NowADS(), txtFechaF.Text.ToDate),
DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico) Then
DtDatos = ObjBancos.DtResultados
If DtDatos.Rows.Count > 0 Then
@@ -128,13 +128,13 @@ Partial Class Bancos_RepCobradoPagado
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'If PrendeLink Then
- ' e.Row.FCLiteral("Gpo").Text = $"{e.Row.DBCampo("GPO")}"
+ ' e.Row.FCLiteral("Gpo").Text = $"{e.Row.DBCampo("GPO")}"
'End If
If e.Row.DBCampo("Orden") = "" Then
e.Row.CssClass = "Totales"
Else
- e.Row.FCLiteral("Gpo").Text = $"{e.Row.DBCampo("GPO")}"
+ e.Row.FCLiteral("Gpo").Text = $"{e.Row.DBCampo("GPO")}"
End If
If e.Row.DBCampo("Grupo") = "10" Then
If e.Row.DBCampo("CveSubProyecto") <> "" AndAlso e.Row.DBCampo("CveClasificacion") = "" Then
@@ -157,7 +157,7 @@ Partial Class Bancos_RepCobradoPagado
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
Dim TipoCambio As Double
LiEspecifico.Visible = True
- TipoCambio = GlobalTipoCambio(Now)
+ TipoCambio = GlobalTipoCambio(NowADS())
TxtEspecifico.Text = TipoCambio.ToString
Else
LiEspecifico.Visible = False
@@ -171,7 +171,7 @@ Partial Class Bancos_RepCobradoPagado
#Region "I M P R I M I R "
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
- GvDatos.ExportToExcel("ReporteCobrado-Pagado" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteCobrado-Pagado" & NowADS().ToShortDateString)
End Sub
Private Sub GenerarPDF()
@@ -197,7 +197,7 @@ Partial Class Bancos_RepCobradoPagado
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString))
params.Add(New ReportParameter("AgrupadoPor", $"Agrupado Por: {Grupo}{Moneda}{FechaIn}{FechaFn}"))
params.Add(New ReportParameter("FUltimaSemana", FUltimaSemana))
params.Add(New ReportParameter("FUltimoMes", FUltimoMes))
diff --git a/Bancos/RepComplementoPago.aspx.vb b/Bancos/RepComplementoPago.aspx.vb
index 603e2c53b..a22070ac6 100644
--- a/Bancos/RepComplementoPago.aspx.vb
+++ b/Bancos/RepComplementoPago.aspx.vb
@@ -80,8 +80,8 @@ Partial Class Bancos_RepComplementoPago
If Not Page.IsPostBack Then
- txtFechaI.Text = $"{New DateTime(Now.Year, Now.Month, 1).ToString("dd/MM/yyyy")}"
- txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy")
+ txtFechaI.Text = $"{New DateTime(NowADS().Year, NowADS().Month, 1).ToString("dd/MM/yyyy")}"
+ txtFechaF.Text = NowADS().ToString("dd/MM/yyyy")
DdlCliente.setEsWebService(True)
DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion = 2 or CveSATMotivoCancelacion = 3 ")
@@ -139,11 +139,11 @@ Partial Class Bancos_RepComplementoPago
For Each gvr As GridViewRow In GvD.Rows
If gvr.FCCheckBox("Chk").Checked Then
- Dim FechaTimbrado As DateTime = DateTime.Now
+ Dim FechaTimbrado As DateTime = NowADS()
Dim UTCOffset As Integer = 0
- If Now.EsHorarioVerano Then
+ If NowADS().EsHorarioVerano Then
If gvr.DataKey("UTCOffsetVerano").ToEntero() <> 0 Then
UTCOffset = gvr.DataKey("UTCOffsetVerano").ToEntero()
End If
@@ -218,6 +218,7 @@ Partial Class Bancos_RepComplementoPago
e.Row.ForeColor = Drawing.Color.Red
e.Row.FCCheckBox("Chk").Enabled = False
e.Row.FCCheckBox("Chk").ToolTip = Mensaje
+ e.Row.Attributes.Add("title", Mensaje)
End If
Else
@@ -341,57 +342,58 @@ Partial Class Bancos_RepComplementoPago
' no tiene restricciones
Case "2"
If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(11, 18) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = "La cuenta ordenante no cumple con el formato esperado. El tamaño debe de ser de 11 o 18 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado. El tamaño debe de ser de 10, 11, 15, 16, 18 o 50 caracteres."
End If
Case "3"
- If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(10, 16, 18) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(10, 16, 18) Then
+
+ Mensaje = "La cuenta ordenante no cumple con el formato esperado. El tamaño debe de ser de caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 18)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado. El tamaño debe de ser de 10 o 18 caracteres."
End If
Case "4"
If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(16) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = "La cuenta ordenante no cumple con el formato esperado. El tamaño debe de ser de 16 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado. El tamaño debe de ser de 10, 11, 15, 16, 18 o 50 caracteres."
End If
Case "5"
If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(10, 11, 15, 16, 18, 50) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = "La cuenta ordenante no cumple con el formato esperado. El tamaño debe de ser de 10, 11, 15, 16, 18 o 50 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado. El tamaño debe de ser de 10, 11, 15, 16, 18 o 50 caracteres."
End If
Case "6"
If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(10) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = "La cuenta ordenante no cumple con el formato esperado. El tamaño debe de ser de 10 caracteres."
End If
CuentaBeneficiario = ""
Case "28"
If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(16) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = "La cuenta ordenante no cumple con el formato esperado. El tamaño debe de ser de 16 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado. El tamaño debe de ser de 10, 11, 15, 16, 18 o 50 caracteres."
End If
Case "29"
If CuentaPago <> "" AndAlso Not CuentaPago.Length.Contiene(15, 16) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = "La cuenta ordenante no cumple con el formato esperado. El tamaño debe de ser de 15 o 16 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado. El tamaño debe de ser de 10, 11, 15, 16, 18 o 50 caracteres."
End If
Case Else
Mensaje = "Forma de Pago no valida, no tiene una forma de pago SAT"
@@ -543,7 +545,7 @@ Partial Class Bancos_RepComplementoPago
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(6).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(6).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(6).Value = NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
@@ -590,7 +592,7 @@ Partial Class Bancos_RepComplementoPago
If EstatusSATCancelado(Can_FolioFiscalCancelar, UsuarioActual.Empresa.RFC, Can_RFCReceptorCancelar) Then
- If ObjBanco.UpdateComplementoPagoCancelado(Can_CveComplementoPagoCancelar, 2, UsuarioActual.CveEmpresa, Can_CvePACCancelacion, Date.Now, "", CveSATMotivoCancelacion) Then
+ If ObjBanco.UpdateComplementoPagoCancelado(Can_CveComplementoPagoCancelar, 2, UsuarioActual.CveEmpresa, Can_CvePACCancelacion, NowADS(), "", CveSATMotivoCancelacion) Then
Alert("El complemento se cancelo correctamente.")
ErrorProceso = False
End If
diff --git a/Bancos/RepComprobaciones.aspx.cs b/Bancos/RepComprobaciones.aspx.cs
index b71a3d400..9c8cb4dc8 100644
--- a/Bancos/RepComprobaciones.aspx.cs
+++ b/Bancos/RepComprobaciones.aspx.cs
@@ -81,7 +81,7 @@ public partial class Bancos_RepComprobaciones : ClsPaginas
@params.Add(new ReportParameter("FechaInicio", TxtFechaInicio.Text));
@params.Add(new ReportParameter("FechaFin", TxtFechaFin.Text));
@params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- @params.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ @params.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
@params.Add(new ReportParameter("Cuenta", DdlCuentas.SelectedItem.Text));
@params.Add(new ReportParameter("LogoPath", Imagen.Exists ? $"file://{Imagen.FullName}" : ""));
diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb
index b6ba10c25..f5e4ccba6 100644
--- a/Bancos/RepCortes.aspx.vb
+++ b/Bancos/RepCortes.aspx.vb
@@ -63,8 +63,8 @@ Partial Class Bancos_RepCortes
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaVI.Text = Now.ToShortDateString
- txtFechaVF.Text = Now.ToShortDateString
+ txtFechaVI.Text = NowADS().ToShortDateString
+ txtFechaVF.Text = NowADS().ToShortDateString
Me.Form.DefaultButton = BtnConsultar.UniqueID
CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
End If
diff --git a/Bancos/RepCreditos.aspx.vb b/Bancos/RepCreditos.aspx.vb
index 3ada99106..dc011d19c 100644
--- a/Bancos/RepCreditos.aspx.vb
+++ b/Bancos/RepCreditos.aspx.vb
@@ -270,7 +270,7 @@ Partial Class Bancos_RepCreditos
e.Row.Cells(1).Text = e.Row.DBCampo("Contador")
End If
- If e.Row.DBCampo("FechaVencimiento") <> "" AndAlso e.Row.DBCampo("FechaVencimiento").ToDate <= Now Then
+ If e.Row.DBCampo("FechaVencimiento") <> "" AndAlso e.Row.DBCampo("FechaVencimiento").ToDate <= NowADS() Then
e.Row.ForeColor = System.Drawing.Color.Red
e.Row.ToolTip = "Fecha Vencida"
End If
@@ -309,7 +309,7 @@ Partial Class Bancos_RepCreditos
''Exportar Excel
'Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
- ' GvDatos.ExportToExcel("RepClientes_" & Now.ToShortDateString)
+ ' GvDatos.ExportToExcel("RepClientes_" & NowADS().ToShortDateString)
'End Sub
#Region "A C T U A L I Z A R - E X C E L"
@@ -614,7 +614,7 @@ Partial Class Bancos_RepCreditos
fs = File.Create(path)
'NombreArchivo = "hola.excel"
' Add text to the file.
- Dim info As Byte() = New UTF8Encoding(True).GetBytes(String.Format("{0}|{1}", NombreArchivo, Date.Now.ToShortDateString))
+ Dim info As Byte() = New UTF8Encoding(True).GetBytes(String.Format("{0}|{1}", NombreArchivo, NowADS().ToShortDateString))
fs.Write(info, 0, info.Length)
fs.Close()
Catch ex As Exception
diff --git a/Bancos/RepCxCCliente.aspx.vb b/Bancos/RepCxCCliente.aspx.vb
index c977428fc..87d5a678c 100644
--- a/Bancos/RepCxCCliente.aspx.vb
+++ b/Bancos/RepCxCCliente.aspx.vb
@@ -158,7 +158,7 @@ Partial Class Bancos_RepCxCCliente
params.Add(New ReportParameter("FechaInicio", FI))
params.Add(New ReportParameter("FechaFin", FF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
ImprimirPDF("Empresas/Grales/Formatos/RepPagoClientes.rdlc", DTpp, params, "ReportePagoClientes")
@@ -172,7 +172,7 @@ Partial Class Bancos_RepCxCCliente
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
- GvCxC.ExportToExcel("CxC Cliente" & Now.ToShortDateString)
+ GvCxC.ExportToExcel("CxC Cliente" & NowADS().ToShortDateString)
End Sub
diff --git a/Bancos/RepEgresosSinComprobante.aspx.vb b/Bancos/RepEgresosSinComprobante.aspx.vb
index fbf30577c..decc73eb3 100644
--- a/Bancos/RepEgresosSinComprobante.aspx.vb
+++ b/Bancos/RepEgresosSinComprobante.aspx.vb
@@ -168,7 +168,7 @@ Partial Class Bancos_RepEgresosSinComprobante
Next
TxtConcepto.Text = "Saldado de Egresos por comprobar"
- TxtFechaSaldar.Text = Now.ToShortDateString
+ TxtFechaSaldar.Text = NowADS().ToShortDateString
DVSaldar.Visible = True
UpSaldar.Update()
@@ -319,7 +319,7 @@ Partial Class Bancos_RepEgresosSinComprobante
CveConceptoContable = 37
End Select
- CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now,
+ CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepEgresosSinComprobante", 6, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, NowADS(),
"Saldo de ExC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoConcepto, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, CveConceptoContable, "", "Saldo de ExC por Sistema",
@@ -379,10 +379,10 @@ Partial Class Bancos_RepEgresosSinComprobante
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF($"Empresas/Grales/Formatos/{Archivo}", DtDatos, params, String.Format("EgresosSinComprovante-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
+ ImprimirPDF($"Empresas/Grales/Formatos/{Archivo}", DtDatos, params, String.Format("EgresosSinComprovante-{0}", NowADS().ToDateTime.ToShortDateString), Formato:=Formato)
End If
End Sub
diff --git a/Bancos/RepIE.aspx.vb b/Bancos/RepIE.aspx.vb
index 15ad4ecba..f594d28de 100644
--- a/Bancos/RepIE.aspx.vb
+++ b/Bancos/RepIE.aspx.vb
@@ -46,8 +46,8 @@ Partial Class Bancos_RepIE
If Not Page.IsPostBack Then
GvDatos.DataBind()
Me.Form.DefaultButton = BtnConsultar.UniqueID
- txtFechaI.Text = Now.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargaGvBitacora()
TipoPagina = ""
ViewState("Orden") = ""
@@ -84,8 +84,8 @@ Partial Class Bancos_RepIE
GvDatos.Columns(15).Visible = True
GvDatos.Columns(18).Visible = False
- txtFechaI.Text = DateSerial(Year(Date.Now), Month(Date.Now), 1).ToShortDateString
- txtFechaF.Text = Date.Now.ToShortDateString
+ txtFechaI.Text = DateSerial(Year(NowADS()), Month(NowADS()), 1).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
ImgConciliacion.Visible = True
LblTitulo.Text = "Conciliación Bancaria"
End If
@@ -99,7 +99,7 @@ Partial Class Bancos_RepIE
CargaUsuarioConcilio()
DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", DistinctColumns:={"Nombre", "CveUsuario"})
DdlUsuarioRegistro.databind
- txtFechaI.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().ToShortDateString
DivDdlTarjeta.Visible = False
DivLabelTarjeta.Visible = False
@@ -159,7 +159,7 @@ Partial Class Bancos_RepIE
End If
If ChkTotalizar.Checked Then
- Dim SaldoDolares As Decimal = DtDatos.SUMD("Importe", "CveMoneda = 2") * GlobalTipoCambio(Now).ToDecimal
+ Dim SaldoDolares As Decimal = DtDatos.SUMD("Importe", "CveMoneda = 2") * GlobalTipoCambio(NowADS()).ToDecimal
SaldoTotal.Text = DtDatos.SUM("ImporteMN").ToString.FormatoNumero '(DtDatos.SUM("Importe") + SaldoDolares).ToString.FormatoNumero
LtlSaldo.Text = DtDatos.SUM("Importe", "CveMoneda = 1").ToString.FormatoNumero
LtlSaldoDolares.Text = DtDatos.SUM("Importe", "CveMoneda = 2").ToString.FormatoNumero
@@ -176,7 +176,7 @@ Partial Class Bancos_RepIE
If GvDatos.Rows.Count > 0 AndAlso TipoPagina = "Conciliaciones" Then
BtnGuardar.Visible = True
- GvDatos.HeaderRow.FCTextBox("TxtFechaAplicadoHeader").Text = DateAdd("d", -1, Date.Now).ToShortDateString
+ GvDatos.HeaderRow.FCTextBox("TxtFechaAplicadoHeader").Text = DateAdd("d", -1, NowADS()).ToShortDateString
If AceptaOtrosIngresos Then
Dim ObjProveedores As New ClsCompProveedores
@@ -214,7 +214,7 @@ Partial Class Bancos_RepIE
If Row.FCCheckBox("ChkFueConciliado").Checked <> CBool(Row.FCHiddenField("HdnConciliado").Value) Then
If Not CBool(Row.FCHiddenField("HdnConciliado").Value) Then
- If Row.FCTextBox("TxtFechaAplicado").Text.Trim.ToDate >= Row.FCLiteral("LtlFechaDocumento").Text.Trim.ToDate AndAlso Row.FCTextBox("TxtFechaAplicado").Text.Trim.ToDate < Date.Now Then '
+ If Row.FCTextBox("TxtFechaAplicado").Text.Trim.ToDate >= Row.FCLiteral("LtlFechaDocumento").Text.Trim.ToDate AndAlso Row.FCTextBox("TxtFechaAplicado").Text.Trim.ToDate < NowADS() Then '
Fecha = Row.FCTextBox("TxtFechaAplicado").Text.Trim.ToDate
Else
FolioError = Row.DataKey("Folio").ToString
@@ -348,7 +348,7 @@ Partial Class Bancos_RepIE
e.Row.Cells(13).Style.Add("background-color", "#dddddd")
e.Row.Cells(15).Style.Add("background-color", "#dddddd")
If Not CBool(e.Row.DBCampo("FueConciliado").ToString) Then
- e.Row.FCTextBox("TxtFechaAplicado").Text = If(TipoTrasaccion, e.Row.DBCampo("FechaDocumento"), DateAdd("d", -1, Date.Now).ToShortDateString)
+ e.Row.FCTextBox("TxtFechaAplicado").Text = If(TipoTrasaccion, e.Row.DBCampo("FechaDocumento"), DateAdd("d", -1, NowADS()).ToShortDateString)
e.Row.FCTextBox("TxtFechaAplicado").Style.Add("display", "none")
If AceptaOtrosIngresos Then e.Row.FCTextBox("TxtOtIng").Style.Add("display", "none")
e.Row.FCCalendarExtender("Calendario").StartDate = e.Row.DBCampo("FechaDocumento").ToDate
@@ -451,7 +451,7 @@ Partial Class Bancos_RepIE
GvDatos.Columns(14).Visible = True 'visualizo la columna oculta de fecha aplicacion cuando es conciliacion
GvDatos.Columns(15).Visible = False 'oculto columna de fecha de aplicacion, en modo de registro
- GvDatos.ExportToExcel("ReporteSaldos" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteSaldos" & NowADS().ToShortDateString)
'Imprimir("EXCEL")
GvDatos.Columns(13).Visible = True
GvDatos.Columns(14).Visible = False
@@ -545,7 +545,7 @@ Partial Class Bancos_RepIE
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
Dim ParametrosReporte As String = "Caja chica: " & DdlCuenta.SelectedItem.Text & " Fecha inicio: " & txtFechaI.Text & " Fecha fin: " & txtFechaF.Text
diff --git a/Bancos/RepIngresosPorComprobar.aspx.vb b/Bancos/RepIngresosPorComprobar.aspx.vb
index 9644a1792..7f88b0a8e 100644
--- a/Bancos/RepIngresosPorComprobar.aspx.vb
+++ b/Bancos/RepIngresosPorComprobar.aspx.vb
@@ -53,7 +53,7 @@ Partial Class Bancos_RepIngresosPorComprobar
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
CargaDatos()
diff --git a/Bancos/RepProgramaciones.aspx.vb b/Bancos/RepProgramaciones.aspx.vb
index 0a7d19d3d..77b92bd02 100644
--- a/Bancos/RepProgramaciones.aspx.vb
+++ b/Bancos/RepProgramaciones.aspx.vb
@@ -44,10 +44,10 @@ Partial Class Bancos_RepProgramaciones
Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7")
If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero
- Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0, -1, Gvr.DataKey("Total").ToDouble, 0, 0, -1, Gvr.DataKey("CveProveedor").ToEntero, 1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, NowADS(), NowADS(), 0, 0, 0.16, 0, -1, Gvr.DataKey("Total").ToDouble, 0, 0, -1, Gvr.DataKey("CveProveedor").ToEntero, 1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveCredito > 0 Then
- If Not ObjCredito.AddCreditosDetalle(CveCredito, Now,
+ If Not ObjCredito.AddCreditosDetalle(CveCredito, NowADS(),
Gvr.DataKey("Total").ToDouble, 0, 0.0, 0, 0.0, 0.0, 101) Then
ErrorCompra = True
End If
@@ -99,11 +99,11 @@ Partial Class Bancos_RepProgramaciones
Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7")
If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero
- Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0,
+ Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, NowADS(), NowADS(), 0, 0, 0.16, 0,
-1, Gvr.DataKey("Total").ToDouble, 0, 0, -1, Gvr.DataKey("CveProveedor").ToEntero, 1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveCredito > 0 Then
- If Not ObjCredito.AddCreditosDetalle(CveCredito, Now,
+ If Not ObjCredito.AddCreditosDetalle(CveCredito, NowADS(),
Gvr.DataKey("Total").ToDouble, 0, 0.0, 0, 0.0, 0.0, 101) Then
ErrorCompra = True
End If
@@ -152,11 +152,11 @@ Partial Class Bancos_RepProgramaciones
Dim drBC As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveTipoCuenta = 7")
If drBC IsNot Nothing Then CveCuenta = drBC("CveCuenta").ToString.ToEntero
- Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, Now, Now, 0, 0, 0.16, 0,
+ Dim CveCredito As Integer = ObjCredito.AddCreditos(1, Gvr.DataKey("Folio"), "", CveCuenta, Gvr.DataKey("CveCompra").ToEntero, -1, 1, NowADS(), NowADS(), 0, 0, 0.16, 0,
-1, Gvr.DataKey("Total").ToDouble, 0, 0, -1, Gvr.DataKey("CveProveedor").ToEntero, 1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveCredito > 0 Then
- If Not ObjCredito.AddCreditosDetalle(CveCredito, Now,
+ If Not ObjCredito.AddCreditosDetalle(CveCredito, NowADS(),
Gvr.DataKey("Total").ToDouble, 0, 0.0, 0, 0.0, 0.0, 101) Then
ErrorCompra = True
End If
diff --git a/Bancos/RepProgramarRecursos.aspx.vb b/Bancos/RepProgramarRecursos.aspx.vb
index 1b4313d6a..a64e834f9 100644
--- a/Bancos/RepProgramarRecursos.aspx.vb
+++ b/Bancos/RepProgramarRecursos.aspx.vb
@@ -795,7 +795,7 @@ Partial Class Bancos_RepProgramarRecursos
'params.Add(New ReportParameter("Agrupador", DdlAgrupador.SelectedValue))
'params.Add(New ReportParameter("LogoUrl", String.Format("{0}/Empresas/{1}/Logo.png", Request.Url.AbsoluteUri.Replace(Request.Url.AbsolutePath, ""), UsuarioActual.CveEmpresa)))
'params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- 'params.Add(New ReportParameter("FechaImpresion", Now.ToShortDateString))
+ 'params.Add(New ReportParameter("FechaImpresion", NowADS().ToShortDateString))
'params.Add(New ReportParameter("AgrupadoPor", $"{Programo} {Proveedor} {Registro} {Responsable} {Clasificacion} {Moneda} {Estatus} {SubProyecto} {FechaIn} {FechaFn}"))
'ImprimirPDF("Empresas/Grales/Formatos/ProgramarRecursos.rdlc", DtDatos, params, "Programación de Recursos")
End Sub
@@ -868,7 +868,7 @@ Partial Class Bancos_RepProgramarRecursos
params.Add(New ReportParameter("LogoUrl", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToShortDateString))
params.Add(New ReportParameter("AgrupadoPor", $"{Programo}{Proveedor}{Clasificacion}{AplicaNC}{TipoProv}{FechaIn}{FechaFn}{FechaInV}{FechaFnV}{Moneda}{Registro}{Responsable}{Estatus}{Proyecto}{SubProyecto}{Comprobacion}"))
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\ProgramarRecursos.rdlc", UsuarioActual.Empresa.Ruta))
diff --git a/Bancos/RepProveedoresPagos.aspx.vb b/Bancos/RepProveedoresPagos.aspx.vb
index 210523456..c753e1c40 100644
--- a/Bancos/RepProveedoresPagos.aspx.vb
+++ b/Bancos/RepProveedoresPagos.aspx.vb
@@ -306,7 +306,7 @@ Partial Class Bancos_RepProveedoresPagos
params.Add(New ReportParameter("FechaInicio", FI))
params.Add(New ReportParameter("FechaFin", FF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("AgrupadoPor", $"{Programo} {Proveedor} {Registro} {Responsable} {Clasificacion} {Moneda} {Estatus} {SubProyecto} {FechaIn} {FechaFn}{FVI}{FVF}"))
params.Add(New ReportParameter("Programadas", If(ChkProgramadas.Checked, "1", "0")))
diff --git a/Bancos/RepSaldos.aspx.vb b/Bancos/RepSaldos.aspx.vb
index 7e182632d..5cc179836 100644
--- a/Bancos/RepSaldos.aspx.vb
+++ b/Bancos/RepSaldos.aspx.vb
@@ -21,8 +21,8 @@ Partial Class Bancos_RepSaldos
'CargaBanco()
CargaCuenta()
DdlCuenta.Items.Insert(0, New ListItem("Todas", "-1"))
- txtFechaI.Text = Now.FirstDayOfMonth().ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth().ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth().ToShortDateString
CargaMoneda()
CargaDatos()
@@ -139,7 +139,7 @@ Partial Class Bancos_RepSaldos
#Region " EXPORTA EXCEL "
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
- ' GvS.ExportToExcel("ReporteSaldos" & Now.ToShortDateString)
+ ' GvS.ExportToExcel("ReporteSaldos" & NowADS().ToShortDateString)
ImprimirReportePdf("Excel")
End Sub
@@ -191,7 +191,7 @@ Partial Class Bancos_RepSaldos
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
params.Add(New ReportParameter("DireccionEmpresa", UsuarioActual.Empresa.Direccion))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString()))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString()))
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
diff --git a/Bancos/RepSaldosDetalle.aspx.vb b/Bancos/RepSaldosDetalle.aspx.vb
index 1be4ef330..6a67ea3b1 100644
--- a/Bancos/RepSaldosDetalle.aspx.vb
+++ b/Bancos/RepSaldosDetalle.aspx.vb
@@ -206,7 +206,7 @@ Partial Class Bancos_RepSaldosDetalle
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
params.Add(New ReportParameter("DireccionEmpresa", UsuarioActual.Empresa.Direccion))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString()))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString()))
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
@@ -251,8 +251,8 @@ Partial Class Bancos_RepSaldosDetalle
'End Sub
'Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
- ' 'GvS.ExportToExcel("ReporteSaldos" & Now.ToShortDateString)
- ' 'GvRepConciliaciones.ExportToExcel("ReporteConciliacionBancaria" & Now.ToShortDateString)
+ ' 'GvS.ExportToExcel("ReporteSaldos" & NowADS().ToShortDateString)
+ ' 'GvRepConciliaciones.ExportToExcel("ReporteConciliacionBancaria" & NowADS().ToShortDateString)
' ExportExcel()
'End Sub
@@ -273,7 +273,7 @@ Partial Class Bancos_RepSaldosDetalle
' Excel.ScreenUpdating = True
' Excel.DisplayAlerts = True
- ' Dim NombreArchivo = String.Format("Conciliacion-{0}-{1}", Cuenta, Date.Now.ToShortDateString.Replace("/", ""))
+ ' Dim NombreArchivo = String.Format("Conciliacion-{0}-{1}", Cuenta, NowADS().ToShortDateString.Replace("/", ""))
' Dim ArchivoBase As New System.IO.FileInfo(String.Format("{0}Formatos\ReporteConciliaciones.xlsm", UsuarioActual.Empresa.Ruta))
' ArchivoBase.CopyTo(String.Format("{0}Formatos\{1}.xlsm", UsuarioActual.Empresa.Ruta, NombreArchivo), True)
@@ -346,7 +346,7 @@ Partial Class Bancos_RepSaldosDetalle
' ArchivoTemp.Delete()
' Dim Descargas As New StringBuilder()
- ' Descargas.AppendFormat("
-
+
diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs
index 3b5dcd835..d6304d5f2 100644
--- a/CRM/EmpresaCRM.aspx.cs
+++ b/CRM/EmpresaCRM.aspx.cs
@@ -1224,7 +1224,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
rowContacto["Celular"] = TxtCelular.Text;
rowContacto["Correo"] = TxtCorreo.Text;
rowContacto["CveUsuarioIng"] = UsuarioActual.CveUsuario;
- rowContacto["FechaIng"] = DateTime.Now;
+ rowContacto["FechaIng"] = NowADS();
if (EsEditarContacto)
TempDTContactos.Rows.RemoveAt(IndexDTContacto);
@@ -1427,7 +1427,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
DdlPrioridadAgenda.SelectedValueExist("1");
TxtAsuntoAgenda.Text = "";
TxtDescripcionAgenda.Text = "";
- TxtFechaInicioAgenda.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm");
+ TxtFechaInicioAgenda.Text = NowADS().ToString("dd/MM/yyyy HH:mm");
UpModalAgenda.Update();
}
@@ -1642,11 +1642,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas
protected void LimitaFechasAcercamiento()
{
//ACTIVAMOS RANGO DE FECHAS PARA CAPTURA DE ACERCAMIENTO
- CETxtFechaApertura.StartDate = DateTime.Now.AddDays(-1);
- CETxtFechaApertura.EndDate = DateTime.Now;
+ CETxtFechaApertura.StartDate = NowADS().AddDays(-1);
+ CETxtFechaApertura.EndDate = NowADS();
- RVFechaApertura.MinimumValue = DateTime.Now.AddDays(-1).ToShortDateString();
- RVFechaApertura.MaximumValue = DateTime.Now.ToShortDateString();
+ RVFechaApertura.MinimumValue = NowADS().AddDays(-1).ToShortDateString();
+ RVFechaApertura.MaximumValue = NowADS().ToShortDateString();
}
protected void InicializaAcercamientos()
@@ -1703,7 +1703,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
{
TxtAcercamiento.Text = "";
TxtDescripcionAcercamiento.Text = "";
- TxtFechaApertura.Text = DateTime.Now.ToShortDateString();
+ TxtFechaApertura.Text = NowADS().ToShortDateString();
TxtFechaCierre.Text = "";
TxtImporte.Text = "0.00";
TxtComision.Text = "0.00";
diff --git a/CRM/RepAcercamientos.aspx.cs b/CRM/RepAcercamientos.aspx.cs
index 59bc658e8..d1459a74e 100644
--- a/CRM/RepAcercamientos.aspx.cs
+++ b/CRM/RepAcercamientos.aspx.cs
@@ -101,8 +101,8 @@ public partial class CRM_RepAcercamientos : ClsPaginas
DdlVendedor.SelectedValueExist(CveVendedor);
//CALCULAMOS EL INTERVALO DE LA SEMANA ACTUAL
- TxtFechaInicio.Text = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek) + 1).ToShortDateString();
- TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString();
+ TxtFechaInicio.Text = NowADS().AddDays(-((int)NowADS().DayOfWeek) + 1).ToShortDateString();
+ TxtFechaFin.Text = NowADS().AddDays((7 - (int)NowADS().DayOfWeek)).ToShortDateString();
DdlPS.setEsWebService(true);
DdlPS.SelectedValue = "-1";
DdlPS.SelectedText = "Todos";
diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx.cs b/CRM/RepAcercamientosProcesosDetalle.aspx.cs
index 4ab577c0a..4c21beba7 100644
--- a/CRM/RepAcercamientosProcesosDetalle.aspx.cs
+++ b/CRM/RepAcercamientosProcesosDetalle.aspx.cs
@@ -378,7 +378,7 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
parametros.Add(new ReportParameter("FechaFin", FechaF));
parametros.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
parametros.Add(new ReportParameter("Filtros", StrFiltro.ToString()));
- parametros.Add(new ReportParameter("FechaImprimio", DateTime.Now.ToShortDateString()));
+ parametros.Add(new ReportParameter("FechaImprimio", NowADS().ToShortDateString()));
if (Imagen.Exists)
{
@@ -391,7 +391,7 @@ public partial class CRM_RepAcercamientosProcesosDetalle : ClsPaginas
}
- ImprimirPDF("Empresas/Grales/Formatos/RepAcercamientoProcesoDetalle.rdlc", DTRepAcercamientosDetalle, parametros, String.Format("RepTraspasoAlmacen-{0}", DateTime.Now.ToShortDateString()), formato);
+ ImprimirPDF("Empresas/Grales/Formatos/RepAcercamientoProcesoDetalle.rdlc", DTRepAcercamientosDetalle, parametros, String.Format("RepTraspasoAlmacen-{0}", NowADS().ToShortDateString()), formato);
}
else
diff --git a/CRM/RepAgendasBitacoras.aspx.cs b/CRM/RepAgendasBitacoras.aspx.cs
index 8b725b80c..7c0a5ab22 100644
--- a/CRM/RepAgendasBitacoras.aspx.cs
+++ b/CRM/RepAgendasBitacoras.aspx.cs
@@ -69,8 +69,8 @@ public partial class CRM_AgendasBitacoras : ClsPaginas
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor);
//CALCULAMOS EL INTERVALO DE LA SEMANA ACTUAL
- TxtFechaInicio.Text = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek) + 1).ToShortDateString();
- TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString();
+ TxtFechaInicio.Text = NowADS().AddDays(-((int)NowADS().DayOfWeek) + 1).ToShortDateString();
+ TxtFechaFin.Text = NowADS().AddDays((7 - (int)NowADS().DayOfWeek)).ToShortDateString();
//DdlPS.setEsWebService(true);
//DdlPS.SelectedValue = "-1";
//DdlPS.SelectedText = "Todos";
diff --git a/Compras/CatEstatusFactura.aspx.vb b/Compras/CatEstatusFactura.aspx.vb
index 12668a36e..14a1e8361 100644
--- a/Compras/CatEstatusFactura.aspx.vb
+++ b/Compras/CatEstatusFactura.aspx.vb
@@ -153,7 +153,7 @@ Partial Class Compras_CatEstatusFactura
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
diff --git a/Compras/CatProveedores.aspx.vb b/Compras/CatProveedores.aspx.vb
index 1d3b0b87c..3d70e4a42 100644
--- a/Compras/CatProveedores.aspx.vb
+++ b/Compras/CatProveedores.aspx.vb
@@ -213,7 +213,7 @@ Partial Class Compras_CatProveedores
#End Region
Private Sub ImgExcel2_Click(sender As Object, e As EventArgs) Handles ImgExcel2.Click
- GvDatos.ExportToExcel("RepProveedores_" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("RepProveedores_" & NowADS().ToShortDateString)
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
Dim ObjProveedores As New ClsCompProveedores
diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs
index 37dfc5d8f..a14663c5f 100644
--- a/Compras/CatTipoGasto.aspx.cs
+++ b/Compras/CatTipoGasto.aspx.cs
@@ -87,7 +87,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas
ClsCompras ObjCompras = new ClsCompras();
if (BtnAgregarTipoGasto.Text == "Agregar")
{
- if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,DateTime.Now.ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa))
+ if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,NowADS().ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa))
{
Alert("Se agregó el Tipo de Gasto correctamente");
}
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 5180079d9..64e8b39ec 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -245,6 +245,7 @@
+
@@ -3505,7 +3506,7 @@
-
+
@@ -3519,7 +3520,7 @@
-
+
@@ -6180,10 +6181,11 @@
//ORDENES DE COMPRA --- OC
- function VinculaOC(CveOC, Folio, CveEstatus) {
+ function VinculaOC(CveOC, Folio, CveEstatus, CveProveedor) {
$get("TxtOC").value = Folio;
$get("HdnVCveOC").value = CveOC;
$get("HdnCveEstatusOC").value = CveEstatus;
+ $get("HdnCveProveedorOC").value = CveProveedor;
$get("BtnVOC").click();
}
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 812832042..e80e88a24 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1161,8 +1161,8 @@ Partial Class Compras_Compras
ArrIE = New ArrayList()
ArrIEFuncionariosEmpleados = New ArrayList()
ClavesBorradas = New ArrayList()
- TxtFecha.Text = Now.ToShortDateString
- TxtFechaEjecucion.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
+ TxtFechaEjecucion.Text = NowADS().ToShortDateString
ViewState("CveFactura") = "0"
ViewState("IdPoliza") = "0"
ViewState("CveCompra") = -1
@@ -1348,6 +1348,7 @@ Partial Class Compras_Compras
End If
If UsuarioActual.TienePermisoProceso(360) Then BtnProrateoDeducible.Visible = True
+ If UsuarioActual.TienePermisoProceso(365) AndAlso IfNull(Request("CveFactura"), "").ToString = "" Then BtnGuardar.Visible = False
If Not CveCompra > 0 Then LIContratos.Visible = True
@@ -1584,7 +1585,7 @@ Partial Class Compras_Compras
Private Function CargaFactura(CveFactura As Integer) As String
Dim ObjeFacturas As New ClsCompras
Dim RFC As String = ""
- If ObjeFacturas.GetFacturas(CveFactura, "-1", Now.AddYears(-4), Now, "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then
+ If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-4), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador
ViewState("CveTipoProveedor") = dr("CveTipoProveedor").ToString.ToEntero
@@ -1652,7 +1653,7 @@ Partial Class Compras_Compras
XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("<br>", "").Replace("<", "").Replace("o;?", ""))
Catch ex As Exception
Try
- Dim oReader as New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
+ Dim oReader As New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
XMLDoc.Load(oReader)
oReader.Dispose()
Catch ex2 As Exception
@@ -1976,14 +1977,17 @@ Partial Class Compras_Compras
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
Dim drMon As DataRow = GlobalDTMonedas.FiltroPrimero(String.Format(" (Abreviatura LIKE '%{0}%' OR Moneda LIKE '%{0}%' )", Moneda))
+
If drMon IsNot Nothing Then
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
+ CveMoneda = drMon("CveMoneda").ToString.ToEntero
Else
'sino busco en la tabla de alias
drMon = GlobalDTMonedasAlias.FiltroPrimero(String.Format("MonedaAlias LIKE '%{0}%' ", Moneda))
If drMon IsNot Nothing Then
DdlMoneda.SelectedValue = drMon("CveMoneda").ToString
+ CveMoneda = drMon("CveMoneda").ToString.ToEntero
Else
LblMoneda.Text = Moneda
LblMoneda.ForeColor = Drawing.Color.Red
@@ -2220,8 +2224,9 @@ Partial Class Compras_Compras
ChkIEPS.Visible = True
ChkIEPS.Checked = True
DdlConceptoIEPS.Visible = True
- CargaProductos(DdlConceptoIEPS, If(UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero, -1))
+ CargaProductos(DdlConceptoIEPS, If(UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero, -1), True)
LbImporte.Text = "$" + TrasladoIEPS.ToString
+
End If
If OtrosImpuestos > 0 Then
ChkOtrosI.Visible = True
@@ -2344,7 +2349,7 @@ Partial Class Compras_Compras
End If
End If
- Dim SubTotalIEPS = TmpDT.SUM("Total").ToString.ToDecimal
+ Dim SubTotalIEPS As Decimal = TmpDT.SUMD("Total")
SubTotal = Math.Round(SubTotalIEPS, 2)
SubTotalConceptos = Math.Round(SubTotalIEPS, 2)
@@ -5197,7 +5202,7 @@ Partial Class Compras_Compras
indice += 1
'agregamos la entrada
- If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
+ If Not UsuarioActual.Empresa.UsaAC Then fecha = NowADS()
folio = ObjInventario.GetFolioSiguiente(2, UsuarioActual.CveEmpresa)
cvemovimientoentrada = ObjInventario.AddMovimiento(tcvealmacen, 2, 1, fecha, folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), Modulo:="Comp/G4")
@@ -5284,7 +5289,7 @@ Partial Class Compras_Compras
indice += 1
Dim fecha As Date = TxtFecha.Text.ToDate
- If Not UsuarioActual.Empresa.UsaAC Then fecha = Now
+ If Not UsuarioActual.Empresa.UsaAC Then fecha = NowADS()
CveMovimientoInventario = ObjInventario.AddMovimiento(tCveAlmacen, CveConceptoMovimiento, 1, fecha, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra, -1, -1, -1, TipoCambio:=If(DdlMoneda.SelectedValue.ToEntero = 1, -1, TipoCambioGuardar), CveFolioGarantia:=tCveFolioGarantia, Modulo:="Comp/G2")
@@ -5322,7 +5327,6 @@ Partial Class Compras_Compras
ErrorMovInv = True
Exit For
End If
-
Next
End If
Else
@@ -5431,7 +5435,7 @@ Partial Class Compras_Compras
End If
Case "4" ' Deudores
CveProveedorLocal = CveProveedor
- CveProveedorConcepto = DdlDeudor.SelectedValue.ToEntero
+ CveProveedorConcepto = CveProveedor
For Each row As GridViewRow In GvDeudores.Rows
If row.FCCheckBox("Chk").Checked Then
CveIE = row.DataKey("CveIE").ToString.ToEntero
@@ -5443,7 +5447,7 @@ Partial Class Compras_Compras
CveConceptoAfectacion = 37
Case "5" ' Acreedores
CveProveedorLocal = CveProveedor
- CveProveedorConcepto = DdlAcreedor.SelectedValue.ToEntero
+ CveProveedorConcepto = CveProveedor ' DdlAcreedor.SelectedValue.ToEntero
CveConceptoAfectacion = 41
CveIE = If(DdlAcreedorDetalle.SelectedValue.ToEntero = -2, -1, DdlAcreedorDetalle.SelectedValue.ToEntero)
@@ -6064,13 +6068,13 @@ Partial Class Compras_Compras
If importeMN <> 0 Then
- If (TxtFecha.Text <> Now.ToString("dd/MM/yyyy")) And Not EntradaComoGastoConAlmacen Then
+ If (TxtFecha.Text <> NowADS().ToString("dd/MM/yyyy")) And Not EntradaComoGastoConAlmacen Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 205, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
ErrorPrepoliza = True
End If
- Dim CvePrePoliza2Almacen As Integer = ObjConta.AddPrePolizas("Compras/Registrar/Almacen", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, Now, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
+ Dim CvePrePoliza2Almacen As Integer = ObjConta.AddPrePolizas("Compras/Registrar/Almacen", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, NowADS(), ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa))
If CvePrePoliza2Almacen > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza2Almacen, True, importeMN.RoundSQL(2), importeMN.RoundSQL(2), 205, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, CveCreditoDetalle:=CveCreditoDetalle, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, Contabilizable:=ContabilizableAlmacen) Then
@@ -6180,6 +6184,7 @@ Partial Class Compras_Compras
Importe228 = ObjOC.DtResultados.FiltroPrimeroValor("Importe228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN228").ToDecimal * Dr("Cantidad").ToString.ToDecimal
Importe229 = ObjOC.DtResultados.FiltroPrimeroValor("Importe229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN229").ToDecimal * Dr("Cantidad").ToString.ToDecimal
ImporteCI176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteCI176").ToDecimal
+ Dim tCveColectiva As Integer = ObjOC.DtResultados.FiltroPrimeroValor("CveColectiva").ToEntero
CveMovimientoAlmacen = ObjOC.DtResultados.FiltroPrimeroValor("CveMovimientoAlmacen").ToEntero
Dim TCAjuste As Decimal = ObjOC.DtResultados.FiltroPrimeroValor("TipoCambioAjuste").ToDecimal
'RMF. falta verificar el costo indirecto de la OC
@@ -6190,8 +6195,8 @@ Partial Class Compras_Compras
SumatoriaInventario += Importe228 + Importe229
'se considera costoindirecto, para que la factura tiene en un concepto tipo servicio
SumatoriaOCINV += (Dr(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total")).ToString.ToDecimal * tipoCambioActual) - (ImporteMN228 + ImporteMN229 - ImporteCI176)
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe228, ImporteMN228, ConceptoContabilizacionME, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteME:=ImporteME228, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen, Contabilizable:=SeContabiliza) Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe229, ImporteMN229, ConceptoContabilizacionMEComp, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteME:=ImporteME229, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen, Contabilizable:=SeContabiliza) Then
+ If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe228, ImporteMN228, ConceptoContabilizacionME, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteME:=ImporteME228, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveColectiva:=tCveColectiva, Contabilizable:=SeContabiliza) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe229, ImporteMN229, ConceptoContabilizacionMEComp, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteME:=ImporteME229, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, TipoCambio:=TCAjuste, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveColectiva:=tCveColectiva, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
End If
@@ -6204,7 +6209,7 @@ Partial Class Compras_Compras
SumatoriaInventario += Importe176
'se considera costoindirecto, para que la factura tiene en un concepto tipo servicio
SumatoriaOCINV += (Dr(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total")).ToString.ToDecimal * tipoCambioActual) - (ImporteMN176 - ImporteCI176)
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe176, ImporteMN176, ConceptoContabilizacion, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteME:=ImporteME176, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen, Contabilizable:=SeContabiliza) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe176, ImporteMN176, ConceptoContabilizacion, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteME:=ImporteME176, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveColectiva:=tCveColectiva, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
End If
@@ -6242,7 +6247,7 @@ Partial Class Compras_Compras
tTipoMovto = False
SumatoriaOCINV = -SumatoriaOCINV
End If
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, SumatoriaOCINV, SumatoriaOCINV, 69, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69) Then
+ If Not ErrorPrepoliza AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, SumatoriaOCINV, SumatoriaOCINV, 69, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69) Then
ErrorPrepoliza = True
Exit For
End If
@@ -7007,52 +7012,52 @@ Partial Class Compras_Compras
End If
If HdnVCveOC.Value <> "-1" AndAlso HdnCveEstatusOC.Value <> "-1" Then
- Dim ArrayCveOC As String() = HdnVCveOC.Value.Split(New Char() {","c})
- Dim ArrayCveEstatusOC As String() = HdnCveEstatusOC.Value.Split(New Char() {","c})
+ Dim ArrayCveOC As String() = HdnVCveOC.Value.Split(New Char() {","c})
+ Dim ArrayCveEstatusOC As String() = HdnCveEstatusOC.Value.Split(New Char() {","c})
- If ArrayCveEstatusOC.Count = ArrayCveOC.Count Then
- For i As Integer = 0 To ArrayCveEstatusOC.Count - 1
- If Not ObjOC.UpdateOrdenCompraCompletada(ArrayCveEstatusOC(i).ToEntero, ArrayCveOC(i).ToEntero, UsuarioActual.CveUsuario, "Se vinculó Compra", CveCompra) Then
- ErrorOC = True
- Exit For
+ If ArrayCveEstatusOC.Count = ArrayCveOC.Count Then
+ For i As Integer = 0 To ArrayCveEstatusOC.Count - 1
+ If Not ObjOC.UpdateOrdenCompraCompletada(ArrayCveEstatusOC(i).ToEntero, ArrayCveOC(i).ToEntero, UsuarioActual.CveUsuario, "Se vinculó Compra", CveCompra) Then
+ ErrorOC = True
+ Exit For
+ End If
+ Next
+ Else
+ ErrorOC = True
+ End If
+
+ End If
+
+ If ChkNCInvNC.Checked Then
+ For Each Gvr As GridViewRow In GVNCInv.Rows
+ If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ErrorMovInv = True
+ Exit For
+ End If
+ End If
+ Next
+
+ For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
+ If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ErrorMovInv = True
+ Exit For
+ End If
End If
Next
- Else
- ErrorOC = True
End If
- End If
-
- If ChkNCInvNC.Checked Then
- For Each Gvr As GridViewRow In GVNCInv.Rows
- If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
- If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
- ErrorMovInv = True
- Exit For
- End If
+ 'GUARDA BITACORA TIPO CAMBIO OC
+ If Not ErrorOC And TipoCambioOC > 0 Then
+ If Not ObjEventos.AddEventoBitacora(String.Format("La vinculación con la orden de compra fue con un tipo de cambio de ${0}", TipoCambioOC.ToString), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then
+ ErrorOC = True
End If
- Next
-
- For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
- If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
- If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
- ErrorMovInv = True
- Exit For
- End If
- End If
- Next
- End If
-
- 'GUARDA BITACORA TIPO CAMBIO OC
- If Not ErrorOC And TipoCambioOC > 0 Then
- If Not ObjEventos.AddEventoBitacora(String.Format("La vinculación con la orden de compra fue con un tipo de cambio de ${0}", TipoCambioOC.ToString), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then
- ErrorOC = True
End If
- End If
'AGREGAR OTROS GASTOS A ORDEN DE CORTE
'If CveOrdenCorte > 0 And UsuarioActual.CveEmpresa = 126 Then
- ' If ObjCGame.AddCorteGasto(CveOrdenCorte, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Now, 0, CveCompra) Then
+ ' If ObjCGame.AddCorteGasto(CveOrdenCorte, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, NowADS(), 0, CveCompra) Then
' If Not ObjCGame.AddCorteGastoDetalle(ObjCGame.CveCorteGasto, 32, 1, TxtSubTotal.Text.ToDouble()) Then
' ErrorOtrosGastos = True
' End If
@@ -7063,263 +7068,263 @@ Partial Class Compras_Compras
'CREDITO COMPRA
Dim CvePrePolizaCredito As Integer = 0
- If RBLPago.SelectedValue.ToEntero = 2 AndAlso RBLContado.SelectedValue.ToEntero = 3 AndAlso DdlTipoCredito.SelectedValue.ToEntero = 1 AndAlso DdlCredito.SelectedValue.ToEntero > 0 Then
+ If RBLPago.SelectedValue.ToEntero = 2 AndAlso RBLContado.SelectedValue.ToEntero = 3 AndAlso DdlTipoCredito.SelectedValue.ToEntero = 1 AndAlso DdlCredito.SelectedValue.ToEntero > 0 Then
- If Not ObjIE.UpdateCreditosCompra(DdlCredito.SelectedValue.ToEntero, CveCompra, UsuarioActual.CveEmpresa) Then
- ErrorCreditosCompra = True
- End If
-
- If Not ErrorCreditosCompra Then
-
- Dim CveConceptoPago As Integer = 17
- If CveTipoConcepto = 2 Then CveConceptoPago = 308 'cuando es acreedor
- If CveMoneda > 1 Then
- Select Case CveConceptoPago
- Case 17
- CveConceptoPago = 312
- Case 308
- CveConceptoPago = 309
- Case Else
- End Select
+ If Not ObjIE.UpdateCreditosCompra(DdlCredito.SelectedValue.ToEntero, CveCompra, UsuarioActual.CveEmpresa) Then
+ ErrorCreditosCompra = True
End If
- If ObjIE.GetCreditos(DdlCredito.SelectedValue.ToEntero, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
- CvePrePolizaCredito = ObjConta.AddPrePolizas("Compras/RegistrarCredito", -1, ObjIE.TotalFinanciado, ObjIE.TotalFinanciado, 1, TxtFecha.Text.ToDate, "Vinculación crédito con factura", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If ObjConta.AddPrePolizasDetalle(CvePrePolizaCredito, False, ObjIE.TotalFinanciado, ObjIE.TotalFinanciado, CveConceptoPago, "", "Vinculación crédito con factura", CveProveedor:=CveProveedor, CveCompra:=CveCompra) Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaCredito, True, ObjIE.TotalFinanciado, ObjIE.TotalFinanciado, 50, "", "Vinculación crédito con factura", CveProveedor:=CveProveedor, CveCompra:=CveCompra) Then
+ If Not ErrorCreditosCompra Then
+
+ Dim CveConceptoPago As Integer = 17
+ If CveTipoConcepto = 2 Then CveConceptoPago = 308 'cuando es acreedor
+ If CveMoneda > 1 Then
+ Select Case CveConceptoPago
+ Case 17
+ CveConceptoPago = 312
+ Case 308
+ CveConceptoPago = 309
+ Case Else
+ End Select
+ End If
+
+ If ObjIE.GetCreditos(DdlCredito.SelectedValue.ToEntero, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
+ CvePrePolizaCredito = ObjConta.AddPrePolizas("Compras/RegistrarCredito", -1, ObjIE.TotalFinanciado, ObjIE.TotalFinanciado, 1, TxtFecha.Text.ToDate, "Vinculación crédito con factura", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ If ObjConta.AddPrePolizasDetalle(CvePrePolizaCredito, False, ObjIE.TotalFinanciado, ObjIE.TotalFinanciado, CveConceptoPago, "", "Vinculación crédito con factura", CveProveedor:=CveProveedor, CveCompra:=CveCompra) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaCredito, True, ObjIE.TotalFinanciado, ObjIE.TotalFinanciado, 50, "", "Vinculación crédito con factura", CveProveedor:=CveProveedor, CveCompra:=CveCompra) Then
+ ErrorCreditosCompra = True
+ End If
+ Else
ErrorCreditosCompra = True
End If
- Else
- ErrorCreditosCompra = True
- End If
-
- If Not ErrorCreditosCompra Then
- ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCredito)
- End If
-
- End If
- End If
-
- End If
-
- 'VALIDAR ERRORES
- If ErrorAC OrElse ErrorPrepoliza OrElse ErrorPrepolizaDescuadre OrElse ErrorDetalles OrElse ErrorMovDev OrElse ErrorMovtosCxP OrElse ErrorMovtosRetIVA OrElse ErrorMovtosRetISR OrElse ErrorMovtosEstimaciones OrElse ErrorMovtosIE OrElse ErrorMovtosIVA OrElse ErrorMovInv OrElse TieneError OrElse ErrorAF OrElse ErrorOC OrElse ErrorBitacora OrElse ErrorAddAcarreos OrElse ErrorCreditosCompra Then
- If ErrorDetalles Then
- Alert("Ocurrió un Error al agregar un Producto o Servicio a la Factura. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorMovtosCxP Then
- Alert("Ocurrió un Error al agregar las CxP. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorMovtosRetIVA Then
- Alert("Ocurrió un Error al agregar las Retenciones de IVA. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorMovtosRetISR Then
- Alert("Ocurrió un Error al agregar las Retenciones de ISR. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorMovtosEstimaciones Then
- Alert("Ocurrió un Error al agregar las Estimaciones. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorMovtosIE Then
- Alert("Ocurrió un Error al agregar el movimiento bancario. Revise sus datos y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorMovtosIVA Then
- Alert("Ocurrió un Error al agregar el IVA. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorMovInv Then
- Alert("Ocurrió un Error al agregar el Producto o Servicio al Inventario. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ElseIf TieneError Then
- Alert("El total de los IMPORTES del FINANCIAMIENTO debe ser mayor que 0 y menor o igual al total de la compra", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorAF Then
- Alert("Error al actualizar la vinculacion del Activo Fijo", TipoMensaje.MsgAdvertencia)
- ElseIf ErrorAC Then
- Alert("Ocurrió un Error al insertar los movimientos contables.", TipoMensaje.MsgError)
- GuardaLog($" Error Compras DESCRIPCIÓN DETALLADA {ErrorACMEnsaje.ToString} {vbCrLf} Usuario={UsuarioActual.CveUsuario}, Empresa={UsuarioActual.CveEmpresa}, CveFactura={CveFactura}, CveProveedor={CveProveedor}")
- ElseIf ErrorPrepolizaDescuadre Then
- Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
- ElseIf ErrorPrepoliza Then
- Alert("Ocurrió un Error al verificar los movimientos contables", TipoMensaje.MsgError)
- ElseIf ErrorOC Then
- Alert("Ocurrió un Error al vincular la Orden(es) de Compra. Por favor vuelva intentar.", TipoMensaje.MsgError)
- ElseIf ErrorBitacora Then
- Alert("Ocurrió un Error al guardar la refacturación.", TipoMensaje.MsgError)
- ElseIf ErrorAddAcarreos Then
- Alert("Ocurrio un Error al momento de agregar los acarreos.", TipoMensaje.MsgError)
- ElseIf ErrorCreditosCompra Then
- Alert("Ocurrió un Error al vincular la compra con el crédito.", TipoMensaje.MsgError)
- ElseIf ErrorOtrosGastos Then
- Alert("Ocurrió un Error al vincular la compra con la orden de corte.", TipoMensaje.MsgError)
- ElseIf ErrorSATPS Then
- Alert("Ocurrió un Error al actualizar el producto/servicio SAT.", TipoMensaje.MsgError)
- ElseIf ErrorSaldosInvComp Then
- Alert("Ocurrió un Error al validar la mercancía recibida por adelantado.", TipoMensaje.MsgError)
- End If
-
- ViewState("CveCompra") = -1
- ObjCompras.RollBack()
- If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
- CargaProveedor(CveProveedor, "-1")
- Else
- Dim MsgAccionAceptar As String = ""
- Dim Msg As New StringBuilder
- Msg.Append("La compra se registró correctamente")
-
- If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.TipoContabilidad = 1 AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
- If ObjConta.ValorPolizaDescuadre > 0 Then
- GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
- ErrorPrepolizaDescuadre = True
- End If
- End If
-
- 'ACTUALIZA CVEFACTURA
- If Request("CveFactura") IsNot Nothing Then
-
- If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
- TieneError = True
- End If
-
- If UsuarioActual.Empresa.UsaAC Then
- MsgAccionAceptar = String.Format("window.opener.location.href = window.opener.location.href; window.open(""/Contabilidad/RegPoliza.aspx?IdPoliza={0}""); window.close();", IdPoliza)
- Else
- MsgAccionAceptar = "if (window.opener){window.opener.location.href = window.opener.location.href; window.close();}"
- End If
- Else
- MsgAccionAceptar = "location.href =""Compras.aspx"""
- End If
-
- 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
- If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
- If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then
- Dim CvePreComprobacion As Integer
- If ObjCompras.DtResultados.Rows.Count = 0 Then
- 'sino existe, creamos la comprobacion
- Dim tConcepto As String = If(DdlPersonalReembolso.SelectedValue.ToEntero > 0, DdlPersonalReembolso.SelectedItem.Text, DdlCuentaCajaChicaReembolso.SelectedItem.Text)
- tConcepto = String.Format("{0}-{1}", tConcepto, TxtNumeroReembolso.Text.Trim)
-
- CvePreComprobacion = ObjConta.AddPrePolizas("Compras Comproba", 1, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
-
- If ObjCompras.AddComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, CvePreComprobacion, UsuarioActual.CveEmpresa) > 0 Then
+ If Not ErrorCreditosCompra Then
+ ObjConta.PrePolizaUnificacion(CvePrePoliza, CvePrePolizaCredito)
End If
- Else
- 'si ya existe, obtenemos la prepóliza
- CvePreComprobacion = ObjCompras.DtResultados.FiltroPrimeroValor("CvePrePoliza").ToEntero
+
End If
-
- ObjConta.PrePolizaUnificacion(CvePreComprobacion, CvePrePoliza)
- End If
- End If
-
- 'AJUSTA POLIZA
- If IdPoliza > 0 Then
- PolizaFolio = ObjContaAC.Folio
- ObjContaAC.AjustaPoliza(IdPoliza)
- Msg.AppendFormat("
Ver Póliza", IdPoliza)
- End If
-
- If UsuarioActual.TienePermisoProceso(354) Then 'visualizar la póliza al registros
- Msg.AppendFormat("
Ver Póliza ", CvePrePoliza)
- Dim TempParametros As String = Encripta(String.Format("OP=PREPO&CvePrePoliza={0}", CvePrePoliza))
- Msg.Append($" Imprimir ")
-
- End If
-
- If CveMovimientoInventario > 0 Then
- Dim TempParametros As String = Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoInventario))
- Msg.AppendFormat("Ver Movimiento de Almacen", CveMovimientoInventario)
- Msg.AppendFormat("Imprimir Entrada Almacen", TempParametros)
- End If
-
- If UsuarioActual.Empresa.TipoContabilidad = 2 Then
- If Not ObjCompras.UpdateCompraPrePoliza(TxtFecha.Text.ToDate, PolizaFolio.ToString, IdPoliza, CvePrePoliza, CveCompra, 0) Then
- TieneError = True
- End If
- End If
-
- If EntregaDirecta Then
- Msg.AppendFormat($"Recibir mercancía de entrega directa.")
- End If
-
- Dim AutoConta As Boolean = True
- If (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
- AutoConta = False
- End If
-
- If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then
- TieneError = True
- 'If ObjConta.ValorPolizaDescuadre > 0 Then
- ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
- ' ErrorPrepolizaDescuadre = True
- 'End If
- End If
-
- If Not TieneError Then
- ObjCompras.Commit()
- If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
-
- Dim CveEvaluacionProveedor As Integer = -1
-
- If Me.RequiereEvaluacion Then
- Dim ObjPro As New ClsCompProveedores()
- CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, Now, "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa)
- ObjPro.Dispose()
End If
- 'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
- MandaCorreoOCVendedores(CveCompra)
- If Not ErrorMovInv Then
- For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen
- MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen)
- Next
+ End If
+
+ 'VALIDAR ERRORES
+ If ErrorAC OrElse ErrorPrepoliza OrElse ErrorPrepolizaDescuadre OrElse ErrorDetalles OrElse ErrorMovDev OrElse ErrorMovtosCxP OrElse ErrorMovtosRetIVA OrElse ErrorMovtosRetISR OrElse ErrorMovtosEstimaciones OrElse ErrorMovtosIE OrElse ErrorMovtosIVA OrElse ErrorMovInv OrElse TieneError OrElse ErrorAF OrElse ErrorOC OrElse ErrorBitacora OrElse ErrorAddAcarreos OrElse ErrorCreditosCompra Then
+ If ErrorDetalles Then
+ Alert("Ocurrió un Error al agregar un Producto o Servicio a la Factura. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorMovtosCxP Then
+ Alert("Ocurrió un Error al agregar las CxP. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorMovtosRetIVA Then
+ Alert("Ocurrió un Error al agregar las Retenciones de IVA. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorMovtosRetISR Then
+ Alert("Ocurrió un Error al agregar las Retenciones de ISR. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorMovtosEstimaciones Then
+ Alert("Ocurrió un Error al agregar las Estimaciones. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorMovtosIE Then
+ Alert("Ocurrió un Error al agregar el movimiento bancario. Revise sus datos y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorMovtosIVA Then
+ Alert("Ocurrió un Error al agregar el IVA. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorMovInv Then
+ Alert("Ocurrió un Error al agregar el Producto o Servicio al Inventario. Revise su factura y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
+ ElseIf TieneError Then
+ Alert("El total de los IMPORTES del FINANCIAMIENTO debe ser mayor que 0 y menor o igual al total de la compra", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorAF Then
+ Alert("Error al actualizar la vinculacion del Activo Fijo", TipoMensaje.MsgAdvertencia)
+ ElseIf ErrorAC Then
+ Alert("Ocurrió un Error al insertar los movimientos contables.", TipoMensaje.MsgError)
+ GuardaLog($" Error Compras DESCRIPCIÓN DETALLADA {ErrorACMEnsaje.ToString} {vbCrLf} Usuario={UsuarioActual.CveUsuario}, Empresa={UsuarioActual.CveEmpresa}, CveFactura={CveFactura}, CveProveedor={CveProveedor}")
+ ElseIf ErrorPrepolizaDescuadre Then
+ Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
+ ElseIf ErrorPrepoliza Then
+ Alert("Ocurrió un Error al verificar los movimientos contables", TipoMensaje.MsgError)
+ ElseIf ErrorOC Then
+ Alert("Ocurrió un Error al vincular la Orden(es) de Compra. Por favor vuelva intentar.", TipoMensaje.MsgError)
+ ElseIf ErrorBitacora Then
+ Alert("Ocurrió un Error al guardar la refacturación.", TipoMensaje.MsgError)
+ ElseIf ErrorAddAcarreos Then
+ Alert("Ocurrio un Error al momento de agregar los acarreos.", TipoMensaje.MsgError)
+ ElseIf ErrorCreditosCompra Then
+ Alert("Ocurrió un Error al vincular la compra con el crédito.", TipoMensaje.MsgError)
+ ElseIf ErrorOtrosGastos Then
+ Alert("Ocurrió un Error al vincular la compra con la orden de corte.", TipoMensaje.MsgError)
+ ElseIf ErrorSATPS Then
+ Alert("Ocurrió un Error al actualizar el producto/servicio SAT.", TipoMensaje.MsgError)
+ ElseIf ErrorSaldosInvComp Then
+ Alert("Ocurrió un Error al validar la mercancía recibida por adelantado.", TipoMensaje.MsgError)
End If
- If CveEvaluacionProveedor > 0 Then
- Msg.Append("
El proveedor tiene evaluaciones pendientes ")
- Msg.Append("¿Desea realizar una evaluacion al proveedor?")
- Msg.AppendFormat($"Evaluar Proveedor.")
- End If
-
- BtnGuardar.Enabled = False
- UpFacturar.Update()
-
- Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
- Else
+ ViewState("CveCompra") = -1
ObjCompras.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
- Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
+ CargaProveedor(CveProveedor, "-1")
+ Else
+ Dim MsgAccionAceptar As String = ""
+ Dim Msg As New StringBuilder
+ Msg.Append("La compra se registró correctamente")
+
+ If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.TipoContabilidad = 1 AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
+ If ObjConta.ValorPolizaDescuadre > 0 Then
+ GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ErrorPrepolizaDescuadre = True
+ End If
+ End If
+
+ 'ACTUALIZA CVEFACTURA
+ If Request("CveFactura") IsNot Nothing Then
+
+ If Not ObjCompras.UpdateCompraFactura(CveCompra, Request("CveFactura").ToEntero, TxtSerie.Text.Trim, TxtFolio.Text.Trim) Then
+ TieneError = True
+ End If
+
+ If UsuarioActual.Empresa.UsaAC Then
+ MsgAccionAceptar = String.Format("window.opener.location.href = window.opener.location.href; window.open(""/Contabilidad/RegPoliza.aspx?IdPoliza={0}""); window.close();", IdPoliza)
+ Else
+ MsgAccionAceptar = "if (window.opener){window.opener.location.href = window.opener.location.href; window.close();}"
+ End If
+ Else
+ MsgAccionAceptar = "location.href =""Compras.aspx"""
+ End If
+
+ 'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
+ If UsuarioActual.CveEmpresa.Contiene(1, 119, 141, 172, 173, 174, 13, 83) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
+ If ObjCompras.GetComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, UsuarioActual.CveEmpresa) Then
+ Dim CvePreComprobacion As Integer
+ If ObjCompras.DtResultados.Rows.Count = 0 Then
+ 'sino existe, creamos la comprobacion
+ Dim tConcepto As String = If(DdlPersonalReembolso.SelectedValue.ToEntero > 0, DdlPersonalReembolso.SelectedItem.Text, DdlCuentaCajaChicaReembolso.SelectedItem.Text)
+ tConcepto = String.Format("{0}-{1}", tConcepto, TxtNumeroReembolso.Text.Trim)
+
+ CvePreComprobacion = ObjConta.AddPrePolizas("Compras Comproba", 1, 0, 0, 1, TxtFecha.Text.ToDate, tConcepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+
+ If ObjCompras.AddComprobacion(DdlPersonalReembolso.SelectedValue.ToEntero, DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero, TxtNumeroReembolso.Text.Trim, CvePreComprobacion, UsuarioActual.CveEmpresa) > 0 Then
+
+ End If
+ Else
+ 'si ya existe, obtenemos la prepóliza
+ CvePreComprobacion = ObjCompras.DtResultados.FiltroPrimeroValor("CvePrePoliza").ToEntero
+ End If
+
+ ObjConta.PrePolizaUnificacion(CvePreComprobacion, CvePrePoliza)
+ End If
+ End If
+
+ 'AJUSTA POLIZA
+ If IdPoliza > 0 Then
+ PolizaFolio = ObjContaAC.Folio
+ ObjContaAC.AjustaPoliza(IdPoliza)
+ Msg.AppendFormat("
Ver Póliza", IdPoliza)
+ End If
+
+ If UsuarioActual.TienePermisoProceso(354) Then 'visualizar la póliza al registros
+ Msg.AppendFormat("
Ver Póliza ", CvePrePoliza)
+ Dim TempParametros As String = Encripta(String.Format("OP=PREPO&CvePrePoliza={0}", CvePrePoliza))
+ Msg.Append($" Imprimir ")
+
+ End If
+
+ If CveMovimientoInventario > 0 Then
+ Dim TempParametros As String = Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoInventario))
+ Msg.AppendFormat("Ver Movimiento de Almacen", CveMovimientoInventario)
+ Msg.AppendFormat("Imprimir Entrada Almacen", TempParametros)
+ End If
+
+ If UsuarioActual.Empresa.TipoContabilidad = 2 Then
+ If Not ObjCompras.UpdateCompraPrePoliza(TxtFecha.Text.ToDate, PolizaFolio.ToString, IdPoliza, CvePrePoliza, CveCompra, 0) Then
+ TieneError = True
+ End If
+ End If
+
+ If EntregaDirecta Then
+ Msg.AppendFormat($"Recibir mercancía de entrega directa.")
+ End If
+
+ Dim AutoConta As Boolean = True
+ If (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
+ AutoConta = False
+ End If
+
+ If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then
+ TieneError = True
+ 'If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' ErrorPrepolizaDescuadre = True
+ 'End If
+ End If
+
+ If Not TieneError Then
+ ObjCompras.Commit()
+ If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
+
+ Dim CveEvaluacionProveedor As Integer = -1
+
+ If Me.RequiereEvaluacion Then
+ Dim ObjPro As New ClsCompProveedores()
+ CveEvaluacionProveedor = ObjPro.AddEvaluacionProveedor(CveProveedor, CveCompra, NowADS(), "", Me.CveUsuarioEvaluador, "", "", UsuarioActual.CveEmpresa)
+ ObjPro.Dispose()
+ End If
+
+ 'ENVIO DE CORREO NOTIFICACION A VENDEDORES DE OC
+ MandaCorreoOCVendedores(CveCompra)
+ If Not ErrorMovInv Then
+ For Each intMovimientoAlmacen As Integer In ListaMovimientosAlmacen
+ MandaCorreoOCVendedoresRecepcionAlmacen(CveCompra, intMovimientoAlmacen)
+ Next
+ End If
+
+ If CveEvaluacionProveedor > 0 Then
+ Msg.Append("
El proveedor tiene evaluaciones pendientes ")
+ Msg.Append("¿Desea realizar una evaluacion al proveedor?")
+ Msg.AppendFormat($"Evaluar Proveedor.")
+ End If
+
+ BtnGuardar.Enabled = False
+ UpFacturar.Update()
+
+ Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
+ Else
+ ObjCompras.RollBack()
+ If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
+ Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
+ End If
+
End If
+ Else
+ ObjCompras.RollBack()
+ If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
+ Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
+
Else
+ Alert("Debe seleccionar un Funcionario/Empleado o Caja Chica para Reembolsos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
ObjCompras.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
- Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
-
Else
- Alert("Debe seleccionar un Funcionario/Empleado o Caja Chica para Reembolsos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
+ Alert("Ocurrió un error al agregar el movimiento bancario. Revise sus datos de pago y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
ObjCompras.RollBack()
- If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
End If
- Else
- Alert("Ocurrió un error al agregar el movimiento bancario. Revise sus datos de pago y cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgAdvertencia)
- ObjCompras.RollBack()
End If
- End If
-
- Catch ex As Exception
- ObjCompras.RollBack()
- If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
- Alert("Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgError)
- GuardaLog($"Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico : {ex}")
- ViewState("CveCompra") = -1
- End Try
- ObjAcar.Dispose()
- ObjCompras.Dispose()
- ObjConta.Dispose()
- ObjIE.Dispose()
- ObjInventario.Dispose()
- ObjAF.Dispose()
- ObjOC.Dispose()
- ObjProveedores.Dispose()
- ObjCGame.Dispose()
- ObjProductosServicios.Dispose()
+ Catch ex As Exception
+ ObjCompras.RollBack()
+ If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
+ Alert("Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico", TipoMensaje.MsgError)
+ GuardaLog($"Ocurrió un error al registrar la compra. Cualquier detalle comuníquese a Soporte Técnico : {ex}")
+ ViewState("CveCompra") = -1
+ End Try
+ ObjAcar.Dispose()
+ ObjCompras.Dispose()
+ ObjConta.Dispose()
+ ObjIE.Dispose()
+ ObjInventario.Dispose()
+ ObjAF.Dispose()
+ ObjOC.Dispose()
+ ObjProveedores.Dispose()
+ ObjCGame.Dispose()
+ ObjProductosServicios.Dispose()
End If
End Sub
@@ -9444,7 +9449,7 @@ Partial Class Compras_Compras
If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 Then
Dim Entro As Boolean = False
- For Each Documento In ListaDocumentos
+ For Each Documento As String In ListaDocumentos
If e.Row.DBCampo("UUID").ToString = Documento Then
Entro = True
End If
@@ -9685,7 +9690,7 @@ Partial Class Compras_Compras
End Sub
Private Function notienepresupuesto() As Boolean
- Dim notienerecursos = False
+ Dim notienerecursos As Boolean = False
Dim SinRecursos As New StringBuilder
SinRecursos.AppendFormat("No se cuenta con los Recursos Suficientes en los siguientes subproyectos ")
Dim subproyectosSr As New List(Of Integer)
@@ -10040,7 +10045,7 @@ Partial Class Compras_Compras
End Sub
Private Sub SetValues()
'Dim um As New ClsUnidadesMedida
- TxtFecha.Text = Now.ToShortDateString()
+ TxtFecha.Text = NowADS().ToShortDateString()
LblUsuarioCaptura.Text = UsuarioActual.Usuario
DdlProveedor.Attributes.Add("onclick", "CargaProveedores();")
'DdlFuncionarioEmpleado.Attributes.Add("onclick", "CargaFuncionariosEmpleados();")
@@ -12608,7 +12613,7 @@ Partial Class Compras_Compras
If ObjInventario.GetExistenciasProducto(Dr.DataKey("CvePS").ToString.ToEntero, Dr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen,
- FechaMovto:=TxtFecha.Text.ToDateTime.AddHours(Now.Hour).AddMinutes(Now.Minute).AddSeconds(Now.Second).ToString("yyyy/MM/dd HH:mm")) Then
+ FechaMovto:=TxtFecha.Text.ToDateTime.AddHours(NowADS().Hour).AddMinutes(NowADS().Minute).AddSeconds(NowADS().Second).ToString("yyyy/MM/dd HH:mm")) Then
Dim Existencia As Decimal = ObjInventario.DtResultados.FiltroPrimeroValor("ExistenciaFinal", String.Format("CveAlmacen = {0}", CveAlmacen)).ToDecimal
@@ -12699,7 +12704,7 @@ Partial Class Compras_Compras
' Dim ObjInventario As New ClsInventarios()
' Dim cvecompra As Integer = 5221
' Dim subtotal As Double = TextBox1.Text.ToDouble
- ' guardardevolucion(ObjInventario, cvecompra, subtotal, Now.ToDate)
+ ' guardardevolucion(ObjInventario, cvecompra, subtotal, NowADS().ToDate)
'End Sub
Protected Sub BtnVinculaDevolucion_Click(sender As Object, e As EventArgs)
Try
@@ -13562,6 +13567,12 @@ Partial Class Compras_Compras
Alert("Debe de Seleccionar un proveedor")
Exit Sub
End If
+ Dim tCveProveedor As Integer = CveProveedor
+
+ 'código para cambiar de proveedor a la oc, para caso 172
+ If UsuarioActual.Empresa.Funcionalidad(267) = "1" AndAlso HdnCveProveedorOC.Value.ToEntero > 0 Then
+ tCveProveedor = HdnCveProveedorOC.Value.ToEntero
+ End If
'BANDERA DE SURTIDO
If UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Then
@@ -13581,7 +13592,7 @@ Partial Class Compras_Compras
If PopUpOC Then
Dim ArrayCveOC As String() = CvesOC.Split(New Char() {","c})
For i As Integer = 0 To ArrayCveOC.Count - 1
- If OC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, ArrayCveOC(i).ToEntero, CveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then
+ If OC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, ArrayCveOC(i).ToEntero, tCveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then
If OC.DtResultados.FiltraParametros("TipoTermino = 3").Rows.Count = 1 Or DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then
HdnVCveOC.Value += String.Format("{0}{1}", If(HdnVCveOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveOrdenCompra").ToString)
HdnCveEstatusOC.Value += String.Format("{0}{1}", If(HdnCveEstatusOC.Value <> "", ",", ""), OC.DtResultados.Rows(0)("CveEstatusSiguiente").ToString)
@@ -15395,15 +15406,15 @@ Partial Class Compras_Compras
#Region " CIERRE PERIODO "
Private Function ValidaCierrePeriodo() As Boolean
'solo se permiten, mes actual, mes anterior <= #dias
- Dim mesesTrans As Integer = DateDiff(DateInterval.Month, TxtFecha.Text.ToDate, Now).ToEntero
+ Dim mesesTrans As Integer = DateDiff(DateInterval.Month, TxtFecha.Text.ToDate, NowADS()).ToEntero
- If mesesTrans = 0 OrElse (mesesTrans = 1 AndAlso Day(Now) <= UsuarioActual.Empresa.Funcionalidad(123).ToEntero) Then
+ If mesesTrans = 0 OrElse (mesesTrans = 1 AndAlso Day(NowADS()) <= UsuarioActual.Empresa.Funcionalidad(123).ToEntero) Then
Return True
End If
Return False
- 'Dim mesesTrans As Integer = DateDiff(DateInterval.Month, TxtFecha.Text.ToDate, Now).ToEntero
- 'If mesesTrans > 1 OrElse Day(Now) >= UsuarioActual.Empresa.Funcionalidad(123).ToEntero Then
+ 'Dim mesesTrans As Integer = DateDiff(DateInterval.Month, TxtFecha.Text.ToDate, NowADS()).ToEntero
+ 'If mesesTrans > 1 OrElse Day(NowADS()) >= UsuarioActual.Empresa.Funcionalidad(123).ToEntero Then
' Return True
'End If
'Return False
@@ -15495,7 +15506,7 @@ Partial Class Compras_Compras
DtDatosDetalle.Rows.Add(Row)
TxtSerieLote.Text = ""
- TxtFechaCaducidad.Text = Now.ToShortDateString
+ TxtFechaCaducidad.Text = NowADS().ToShortDateString
CargaSerie()
End Sub
@@ -16450,7 +16461,7 @@ Partial Class Compras_Compras
Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND CveTipoGasto = {DdlTipoGasto.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble
End If
End If
- If ObjCon.GetPresupuestosRep(CvePresupuesto, DdlTipoGasto.SelectedValue.ToEntero, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
+ If ObjCon.GetPresupuestosRep(CvePresupuesto, DdlTipoGasto.SelectedValue.ToEntero, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
If ObjCon.DtResultados.Rows.Count > 0 Then
Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble
@@ -16600,7 +16611,7 @@ Partial Class Compras_Compras
End If
Dim CveCompraDetalleDesvicnualarAF As Integer = TmpDT.FiltroPrimeroValor("CveCompraDetalle", $"Consec={Index}").ToEntero
- 'If ObjAF.UpdateActivosFijosCompra(-1, CveCompraDetalleDesvicnualarAF, -1, 0, Now, Opcion:=2) Then
+ 'If ObjAF.UpdateActivosFijosCompra(-1, CveCompraDetalleDesvicnualarAF, -1, 0, NowADS(), Opcion:=2) Then
For Each dRow As DataRow In TmpDT.Rows
@@ -17792,7 +17803,7 @@ Partial Class Compras_Compras
Dim ObjCompras As New ClsCompras
Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL)
- Dim TieneError = False
+ Dim TieneError As Boolean = False
For Each Gvr As GridViewRow In GVNCInv.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
@@ -17820,18 +17831,18 @@ Partial Class Compras_Compras
Protected Sub BtnNCInvAlmacen_Click(sender As Object, e As EventArgs)
' se comenta RMF.2023/09/08, genera negativos en el rep recibir oc
- 'Dim i As Integer = 0
- 'For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
- ' If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
- ' If i < TmpDT.Rows.Count Then
- ' TmpDT.Rows(i)("CveOrdenCompraDetalle") = Gvr.DataKey("CveOrdenCompraDetalle")
- ' End If
- ' 'If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
- ' ' TieneError = True
- ' ' Exit For
- ' 'End If
- ' End If
- 'Next
+ Dim i As Integer = 0
+ For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
+ If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ If i < TmpDT.Rows.Count Then
+ TmpDT.Rows(i)("CveOrdenCompraDetalle") = Gvr.DataKey("CveOrdenCompraDetalle")
+ End If
+ 'If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ' TieneError = True
+ ' Exit For
+ 'End If
+ End If
+ Next
RegistraScript("$('#FacturaNC').modal('hide');", "ModalNCInv")
End Sub
@@ -17956,8 +17967,8 @@ Partial Class Compras_Compras
'CTA PROVEEDOR
Select Case RBLContado.SelectedValue
- Case "4" ' Deudores
- CveProveedorConcepto = DdlDeudor.SelectedValue.ToEntero
+ 'Case "4" ' Deudores
+ ' CveProveedorConcepto = DdlDeudor.SelectedValue.ToEntero
Case "5" ' Acreedores
CveProveedorConcepto = DdlAcreedor.SelectedValue.ToEntero
Case Else ' Proveedores - F y E - Doctos
@@ -18057,7 +18068,7 @@ Partial Class Compras_Compras
For Each Row2 As DataRow In DT.Rows
ImporteMovimiento = DtTemporal.SUM("Total", String.Format("ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveClasificacion = {0} AND CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal
- ImporteAlmacen = DtTemporal.SUM("ImporteEnAlmacen", String.Format("ISNULL(TipoAF,0) <> 2 AND CveClasificacion = {0} AND CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal
+ ImporteAlmacen = DtTemporal.SUM("ImporteEnAlmacen", String.Format("ISNULL(TipoAF,0) <> 2 AND CveClasificacion = {0} AND CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal
ImporteMovimiento = (ImporteMovimiento - ImporteAlmacen) * Multiplicador
importeMN = ImporteMovimiento * TipoCambioActual
@@ -18140,14 +18151,18 @@ Partial Class Compras_Compras
#End Region
#Region "DEDUCCIONES IEPS / OTROS IMPUESTOS"
- Protected Sub CargaProductos(Ddl As DropDownList, CvePS As Integer)
+ Protected Sub CargaProductos(Ddl As DropDownList, CvePS As Integer, Optional OpIncluirIEPSEnProducto As Boolean = False)
Ddl.DataSource = TmpDT
Ddl.DataBind()
Ddl.Items.Insert(0, New ListItem("Seleccione un concepto", "-1"))
Ddl.SelectedValueExist("-1")
If CvePS > 0 Then
- Ddl.Items.Insert(1, New ListItem(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("PS"), CvePS.ToString))
+ Ddl.Items.Insert(1, New ListItem(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS).FiltroPrimeroValor("PSCodigo"), CvePS.ToString))
+ End If
+
+ If OpIncluirIEPSEnProducto Then
+ Ddl.Items.Add(New ListItem("Incluir en Producto", "-2"))
End If
'Ddl.Items.Insert(1, New ListItem(Concepto, "-1"))
@@ -18166,15 +18181,28 @@ Partial Class Compras_Compras
If IEPSGasto Then
Dim CvePS As Integer = DdlConceptoIEPS.SelectedValue.ToEntero
' If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(112).ToString.ToEntero
- AgregarConceptoIEPS(TrasladoIEPS, CvePS)
+ If CvePS = -2 Then 'opción Incluir en producto
+ For Each Dr As DataRow In TmpDT.Rows
+ If Dr("IVA").ToString.ToDecimal = 0 Then
+ Dr("PU") = ((Dr("IEPSPS").ToString.ToDecimal / Dr("Cantidad").ToString.ToDecimal) + Dr("Pu").ToString.ToDecimal).RoundSQL(6)
+ Dr("IEPSPS") = 0
+ Dr("IEPSPSPorcentaje") = 0
+ Dr("Total") = (Dr("PU").ToString.ToDecimal * Dr("Cantidad").ToString.ToDecimal - Dr("Descuento").ToString.ToDecimal)
+ End If
+ Next
+ CalculaTotales(True)
+ Else
+ AgregarConceptoIEPS(TrasladoIEPS, CvePS)
+
+ For Each Dr As DataRow In TmpDT.Rows
+ Dr("IEPSPS") = 0
+ Dr("IEPSPSPorcentaje") = 0
+ Next
+ End If
TrasladoIEPS = 0
TxtIEPS.Text = 0.ToString.FormatoNumero
TrIEPS.Visible = False
- For Each Dr As DataRow In TmpDT.Rows
- Dr("IEPSPS") = 0
- Dr("IEPSPSPorcentaje") = 0
- Next
TmpDT.AcceptChanges()
End If
'AGREGA OTROS IMPUESTOS COMO CONCEPTO
@@ -18182,7 +18210,6 @@ Partial Class Compras_Compras
Dim CvePS As Integer = DdlConceptoOI.SelectedValue.ToEntero
'If CvePS = -1 Then CvePS = UsuarioActual.Empresa.Funcionalidad(305).ToString.ToEntero
AgregarConceptoIEPS(OtrosImpuestos, CvePS)
-
OtrosImpuestos = 0
TxtOtrosImpuestos.Text = 0.ToString.FormatoNumero
TrOtrosImpuestos.Visible = False
@@ -18195,7 +18222,6 @@ Partial Class Compras_Compras
Alert("Debe seleccionar al menos un impuesto", TipoMensaje.MsgAdvertencia)
End If
-
MostrarOcultarColumnaIEPS()
AddPS2()
End Sub
@@ -18453,7 +18479,7 @@ Partial Class Compras_Compras
Private Sub CargaModalFletesImportaciones()
- TxtFechaModalImportacionesFletes.Text = Now.ToShortDateString
+ TxtFechaModalImportacionesFletes.Text = NowADS().ToShortDateString
TxtDescripcionModalFletesImportacion.Text = ""
TxtPedimento.Text = ""
RblTipo.SelectedValue = "1"
@@ -18532,7 +18558,7 @@ Partial Class Compras_Compras
Case 240
DdlImportaciones.SelectedValueExist(CveImportacion)
End Select
- TxtFechaModalImportacionesFletes.Text = Now.ToShortDateString
+ TxtFechaModalImportacionesFletes.Text = NowADS().ToShortDateString
TxtDescripcionModalFletesImportacion.Text = ""
TxtPedimento.Text = ""
UpModalFletesImportaciones.Update()
@@ -18592,7 +18618,7 @@ Partial Class Compras_Compras
Dim CveProveedorSucursal As Integer = -1
Dim CveProveedorContacto As Integer = -1
Dim Retorno As Boolean = True
- Dim CveProveedor As Integer = -1
+ Dim tCveProveedor As Integer = -1
Dim GeneraReq As Boolean = False
Dim IDPoliza As Integer = 0
@@ -18613,6 +18639,8 @@ Partial Class Compras_Compras
DtInvOCDiferencias.Columns.Add("FolioAlmacen", GetType(String))
DtInvOCDiferencias.Columns.Add("TipoCambioAjuste", GetType(Double))
DtInvOCDiferencias.Columns.Add("ConceptoSalida", GetType(Integer))
+ DtInvOCDiferencias.Columns.Add("CveClasificacion", GetType(Integer))
+ DtInvOCDiferencias.Columns.Add("CveColectiva", GetType(Integer))
DtInvOCDiferencias.Columns.Add("PS", GetType(String))
@@ -18631,6 +18659,8 @@ Partial Class Compras_Compras
DrInvOCDiferencias("Diferencia") = diferencia.RoundSQL()
DrInvOCDiferencias("PUCompra") = Math.Round(gvr.FCTextBox("TxtPU").Text.ToDecimal, 6)
DrInvOCDiferencias("CveMoneda") = dr2("CveMoneda").ToString.ToEntero
+ DrInvOCDiferencias("CveClasificacion") = dr2("CveClasificacion").ToString.ToEntero
+ DrInvOCDiferencias("CveColectiva") = dr2("CveColectiva").ToString.ToEntero
DrInvOCDiferencias("FolioOC") = dr2("FolioOC").ToString
DrInvOCDiferencias("CveProveedor") = dr2("CveProveedorOC").ToString.ToEntero
DrInvOCDiferencias("PS") = dr2("PS").ToString
@@ -18684,6 +18714,7 @@ Partial Class Compras_Compras
Dim DiferenciaInvOC As Decimal = 0.0D
Dim CveMovimientoAlmacen As Integer = -1
Dim CveOCDetalle As Integer = -1
+ Dim CveColectiva As Integer = -1
Dim CveAlmacen As Integer = -1
Dim Fecha As Date = TxtFecha.Text.ToDate
Dim CveProveedorInvOC As Integer = -1
@@ -18700,55 +18731,65 @@ Partial Class Compras_Compras
Dim PUCompra As Decimal = 0.0D
Dim CveMoneda As Integer = 1
Dim PS As String = ""
+ Dim TipoMovtoCosto As Boolean = True
+
+ tCveProveedor = DtInvOCDiferencias.MAX("CveProveedor").ToEntero
+ ProveedorNombre = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", $"CveProveedor = {tCveProveedor}").ToString
+ Fecha = TxtFecha.Text.ToDate
+ CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, 0, 0, 1, Fecha, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+
+ If CvePrePoliza > 0 Then
+
+ 'AJUSTES EN PREPOLIZA - SALIDA CONTABLE (CON SALIDA DE VENTA O SIN SALIDA)
+ For Each DrDiferencias As DataRow In DtInvOCDiferencias.FiltraParametros("ConceptoSalida IN (0,1)").Rows
+ CveOrdenCompra = DrDiferencias("CveOrdenCompra").ToString.ToEntero
+ CveOCDetalle = DrDiferencias("CveOrdenCompraDetalle").ToString.ToEntero
+ CveMoneda = DrDiferencias("CveMoneda").ToString.ToEntero
+ DiferenciaInvOC = DrDiferencias("Diferencia").ToString.ToDecimal.RoundSQL()
+ PUCompra = DrDiferencias("PUCompra").ToString.ToDecimal
+ CveColectiva = DrDiferencias("CveColectiva").ToString.ToEntero
+ PS = DrDiferencias("PS").ToString
- 'AJUSTES EN PREPOLIZA - SALIDA CONTABLE (CON SALIDA DE VENTA O SIN SALIDA)
- For Each DrDiferencias As DataRow In DtInvOCDiferencias.FiltraParametros("ConceptoSalida IN (0,1)").Rows
- CveOrdenCompra = DrDiferencias("CveOrdenCompra").ToString.ToEntero
- CveOCDetalle = DrDiferencias("CveOrdenCompraDetalle").ToString.ToEntero
- CveMoneda = DrDiferencias("CveMoneda").ToString.ToEntero
- DiferenciaInvOC = DrDiferencias("Diferencia").ToString.ToDecimal.RoundSQL()
- PUCompra = DrDiferencias("PUCompra").ToString.ToDecimal
- PS = DrDiferencias("PS").ToString
+ SerieFolio = $"OC: {DrDiferencias("FolioOC").ToString}"
+ tCveProveedor = DrDiferencias("CveProveedor").ToString.ToEntero
+ Dim ConceptoPartida As String = String.Format("{0} OC: {1} Inv: {2}", ProveedorNombre, DrDiferencias("FolioOC"), DrDiferencias("FolioAlmacen"))
- Fecha = TxtFecha.Text.ToDate
- SerieFolio = $"OC: {DrDiferencias("FolioOC").ToString}"
- CveProveedor = DrDiferencias("CveProveedor").ToString.ToEntero
- ProveedorNombre = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", $"CveProveedor = {CveProveedor}").ToString
- Dim ConceptoPartida As String = String.Format("{0} OC: {1} Inv: {2}", ProveedorNombre, DrDiferencias("FolioOC"), DrDiferencias("FolioAlmacen"))
+ ConceptoSalida = DrDiferencias("ConceptoSalida").ToString.ToEntero
+ CveAlmacen = DrDiferencias("CveAlmacen").ToString.ToEntero
+ CveMovimientoAlmacen = DrDiferencias("CveMovimiento").ToString.ToEntero
+ TCInvOC = DrDiferencias("TipoCambioAjuste").ToString.ToDecimal
- ConceptoSalida = DrDiferencias("ConceptoSalida").ToString.ToEntero
- CveAlmacen = DrDiferencias("CveAlmacen").ToString.ToEntero
- CveMovimientoAlmacen = DrDiferencias("CveMovimiento").ToString.ToEntero
- TCInvOC = DrDiferencias("TipoCambioAjuste").ToString.ToDecimal
+ Dim CveClasificacionCostoOC As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero
+ Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
- Dim CveClasificacionCostoOC As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero
- Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
+ If DiferenciaInvOC.RoundSQL() <> 0 Then
- If DiferenciaInvOC.RoundSQL() <> 0 Then
+ If CveSubProyecto <= 0 Then
+ Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
+ Retorno = False
+ End If
- If CveSubProyecto <= 0 Then
- Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
- Retorno = False
- End If
+ If CvePrePoliza > 0 Then
- CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If CvePrePoliza > 0 Then
+ If CveMoneda = 2 Then
+ ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD()
+ ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD()
- If CveMoneda = 2 Then
- ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD()
- ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD()
+ Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)
- Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoCosto, -DiferenciaInvOC, -DiferenciaInvOC, 177, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto) Then
+ Retorno = False
+ Exit For
+ End If
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, -DiferenciaInvOC, 177, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto) Then
- Retorno = False
- Exit For
- End If
-
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, ImporteME, 228, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, ImporteMEComp, 229, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
- If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, DifImporte, 69, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC, CveSubProyecto:=CveSubProyecto) Then
+ If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, ImporteME, 228, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
+ If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, ImporteMEComp, 229, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then
+ If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoCosto, DifImporte, DifImporte, 69, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC, CveSubProyecto:=CveSubProyecto) Then
+ Retorno = False
+ Exit For
+ End If
+ Else
Retorno = False
Exit For
End If
@@ -18757,35 +18798,34 @@ Partial Class Compras_Compras
Exit For
End If
Else
- Retorno = False
- Exit For
- End If
- Else
- '2018.11.24 se cambia concepto 177, de cargo a abono negativo., petición MALL
- If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, -DiferenciaInvOC, If(ConceptoSalida = 0, 177, 177), SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto) Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, DiferenciaInvOC, 176, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, CveOCDetalle:=CveOCDetalle) Then
+ '2018.11.24 se cambia concepto 177, de cargo a abono negativo., petición MALL
+ If ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoCosto, -DiferenciaInvOC, -DiferenciaInvOC, If(ConceptoSalida = 0, 177, 177), SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=CveSubProyecto, CveClasificacion:=CveClasificacionCostoOC) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DiferenciaInvOC, DiferenciaInvOC, 176, SerieFolio, ConceptoPartida, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, CveOCDetalle:=CveOCDetalle, CveColectiva:=CveColectiva) Then
+ Retorno = False
+ Exit For
+ End If
+ Else
Retorno = False
Exit For
End If
- Else
+ End If
+ If Not OC.UpdateOrdenCompraDetalleAjuste(CveOrdenCompra, CveOCDetalle, PUCompra, UsuarioActual.CveUsuario) Then
Retorno = False
Exit For
End If
- End If
- If Not OC.UpdateOrdenCompraDetalleAjuste(CveOrdenCompra, CveOCDetalle, PUCompra, UsuarioActual.CveUsuario) Then
- Retorno = False
- Exit For
- End If
- If Retorno Then
- If Not OCBitacora.AddEventoBitacora(String.Format("Se registró una póliza de ajuste por cambio de precio en producto: {0}", PS), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOC:=CveOrdenCompra) Then
- Retorno = False
+ If Retorno Then
+ If Not OCBitacora.AddEventoBitacora(String.Format("Se registró una póliza de ajuste por cambio de precio en producto: {0}", PS), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOC:=CveOrdenCompra) Then
+ Retorno = False
+ End If
End If
End If
End If
- End If
- Next
-
+ Next
+ Else
+ Alert("prepóliza de ajuste no registrada.", TipoMensaje.MsgAdvertencia)
+ Retorno = False
+ End If
End If
End If
diff --git a/Compras/EvaluacionProveedor.aspx.vb b/Compras/EvaluacionProveedor.aspx.vb
index 517bedcec..d755d2df7 100644
--- a/Compras/EvaluacionProveedor.aspx.vb
+++ b/Compras/EvaluacionProveedor.aspx.vb
@@ -85,7 +85,7 @@ Partial Class Compras_EvaluacionProveedor
TxtSerieFolio.Text = ""
TxtPS.Text = ""
TxtCodigo.Text = ""
- TxtFecha.Text = Now.ToString("dd/MM/yyyy")
+ TxtFecha.Text = NowADS().ToString("dd/MM/yyyy")
TxtFirma.Text = UsuarioActual.Nombre
TxtCalificacion.Text = ""
@@ -147,14 +147,14 @@ Partial Class Compras_EvaluacionProveedor
TxtRS.Text = Row.DataKey("RazonSocial")
TxtCodigo.Text = Row.DataKey("Codigo")
- TxtFecha.Text = Now.ToString("dd/MM/yyyy")
+ TxtFecha.Text = NowADS().ToString("dd/MM/yyyy")
UpEvaluacion.Update()
RegistraScript("$('#DvEvaluacion').modal('show');IniciarCalculo();")
End Sub
Protected Sub BtnEvaluarProveedor_Click(sender As Object, e As EventArgs)
CalcularCalificacion()
- Dim Fecha = Now
+ Dim Fecha = NowADS()
Dim Mes = Fecha.ToString("MMMM", New CultureInfo("es-MX"))
Dim Obs = TxtObs.Text.Trim()
@@ -287,7 +287,7 @@ Partial Class Compras_EvaluacionProveedor
Dim PathRoot As String = ModExtensiones.DirectorioBaseEmpresas
Dim Documento As String = "CartaProveedor.docx"
Dim PathSource As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Plantillas\{Documento}"
- Dim PathDestino As String = PathRoot & "Temp\" & Now.Ticks & Documento
+ Dim PathDestino As String = PathRoot & "Temp\" & NowADS().Ticks & Documento
If File.Exists(PathDestino) Then
File.Delete(PathDestino)
@@ -321,7 +321,7 @@ Partial Class Compras_EvaluacionProveedor
Dim PathRoot As String = ModExtensiones.DirectorioBaseEmpresas
Dim Documento As String = "FormatoEvaluacionProveedor.docx"
Dim PathSource As String = $"{UsuarioActual.Empresa.Ruta}\Formatos\Plantillas\{Documento}"
- Dim PathDestino As String = PathRoot & "Temp\" & Now.Ticks & Documento
+ Dim PathDestino As String = PathRoot & "Temp\" & NowADS().Ticks & Documento
If File.Exists(PathDestino) Then
File.Delete(PathDestino)
@@ -354,7 +354,7 @@ Partial Class Compras_EvaluacionProveedor
ListaTagsDocumentost.Add(New TagsDocumentos("{{Proveedor}}", Proveedor))
ListaTagsDocumentost.Add(New TagsDocumentos("{{Dia}}", Dia))
ListaTagsDocumentost.Add(New TagsDocumentos("{{Mes}}", Mes))
- ListaTagsDocumentost.Add(New TagsDocumentos("{{Anio}}", Now.Year.ToString))
+ ListaTagsDocumentost.Add(New TagsDocumentos("{{Anio}}", NowADS().Year.ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{{Calificacion}}", Calificacion))
ListaTagsDocumentost.Add(New TagsDocumentos("{{Resultado}}", Resultado))
'ListaTagsDocumentost.Add(New TagsDocumentos("{{Usuario}}", UsuarioActual.Nombre))
diff --git a/Compras/Importaciones.aspx.vb b/Compras/Importaciones.aspx.vb
index 6b3621f02..cc2a0d2a9 100644
--- a/Compras/Importaciones.aspx.vb
+++ b/Compras/Importaciones.aspx.vb
@@ -65,7 +65,7 @@ Partial Class Compras_Importaciones
DdlProveedores.SelectedText = "Todos"
DdlProveedores.SelectedValue = "-1"
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
End Sub
#End Region
diff --git a/Compras/PopUpBuscarFolioC.aspx.vb b/Compras/PopUpBuscarFolioC.aspx.vb
index 40c5d023f..b567dfaf0 100644
--- a/Compras/PopUpBuscarFolioC.aspx.vb
+++ b/Compras/PopUpBuscarFolioC.aspx.vb
@@ -28,8 +28,8 @@ Partial Class Compras_PopUpBuscarFolioC
'RegistraScript("$get('tdContenido').style.height='470px'")
CargaProveedor()
- txtFechaI.Text = Now.AddDays(-30).ToShortDateString
- txtFechaI.Text = Now.AddYears(-1).ToShortDateString
+ txtFechaI.Text = NowADS().AddDays(-30).ToShortDateString
+ txtFechaI.Text = NowADS().AddYears(-1).ToShortDateString
If Request("Opt") = "Fact" Then
ViewState("Opt") = "MandaCveCompra"
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 5ab388631..fc8cd8d8b 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -1338,9 +1338,9 @@ Partial Class PopUpVerFactura
Dim AplicaPagare As String = If(UrlParametros("PAG") IsNot Nothing AndAlso UrlParametros("PAG").ToString <> "", UrlParametros("PAG").ToString, "0")
Dim Guardar As Boolean = UrlParametros("GUARDAR") IsNot Nothing AndAlso UrlParametros("GUARDAR").ToString() = "1"
Dim RegenerarPDF As Boolean = UrlParametros("REGENERAR") IsNot Nothing AndAlso UrlParametros("REGENERAR").ToString() = "1"
- Dim STIMULSOFT As Boolean = UrlParametros("STIMULSOFT") IsNot Nothing AndAlso UrlParametros("STIMULSOFT").ToString() = "1"
+ Dim STIMUL As Boolean = UrlParametros("STIMULSOFT") IsNot Nothing AndAlso UrlParametros("STIMULSOFT").ToString() = "1"
- imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimulsoft:=STIMULSOFT)
+ imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimul:=STIMUL)
End If
End If
@@ -1578,7 +1578,7 @@ Partial Class PopUpVerFactura
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("AgrupoPor", $"{FechaCorte}{Usuario}"))
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
Dim lrds As New List(Of ReportDataSource)
@@ -1692,7 +1692,7 @@ Partial Class PopUpVerFactura
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Contrato", $"{ObjContratos.NumeroContrato} - {ObjContratos.DescripcionContrato} "))
params.Add(New ReportParameter("Proveedor", If(ObjContratos.CveProveedor > 0, ObjContratos.RazonSocial.ToString, ObjContratos.NombreComercial.ToString)))
params.Add(New ReportParameter("FechaInicio", ObjContratos.FechaInicial.ToShortDateString))
@@ -1748,13 +1748,13 @@ Partial Class PopUpVerFactura
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("EnvioContacto", EnvioContacto))
params.Add(New ReportParameter("SerieFolio", SerieFolio))
params.Add(New ReportParameter("PedidoContrato", PedidoContrato))
params.Add(New ReportParameter("EnvioDireccion", EnvioDireccion))
params.Add(New ReportParameter("Guia", Guia))
- ImprimirPDF("Empresas/Grales/Formatos/Cicovisa.rdlc", Dt, params, String.Format("Formato Cicovisa -{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/Cicovisa.rdlc", Dt, params, String.Format("Formato Cicovisa -{0}", NowADS().ToDateTime.ToShortDateString))
End If
End If
End Sub
@@ -2066,7 +2066,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("DomicilioFiscal", $"{UsuarioActual.Empresa.Direccion}, {UsuarioActual.Empresa.Colonia}, {UsuarioActual.Empresa.Localidad}, {UsuarioActual.Empresa.Estado}, Tel. {Telefono}"))
params.Add(New ReportParameter("SerieFolio", SerieFolio))
params.Add(New ReportParameter("DomicilioSucursal", DomicilioSucursal))
@@ -2093,7 +2093,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Ciudad", Ciudad))
params.Add(New ReportParameter("Licencia", Licencia))
- ImprimirPDF($"Empresas/Grales/Formatos/{FormatoRDLC}", Dt, params, String.Format("Carta Porte -{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF($"Empresas/Grales/Formatos/{FormatoRDLC}", Dt, params, String.Format("Carta Porte -{0}", NowADS().ToDateTime.ToShortDateString))
End If
@@ -2525,7 +2525,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("RegimenFiscal", UsuarioActual.Empresa.Regimen))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("DomicilioFiscal", $"{UsuarioActual.Empresa.Direccion}, {UsuarioActual.Empresa.Colonia}, {UsuarioActual.Empresa.Localidad}, {UsuarioActual.Empresa.Estado}, Tel. {Telefono}"))
params.Add(New ReportParameter("SerieFolio", SerieFolio))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
@@ -2736,12 +2736,12 @@ Partial Class PopUpVerFactura
ObjFactura.Folio = Folio
ObjFactura.Serie = "Tra"
'ObjFactura.CveMesa = -1
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = NowADS()
ObjFactura.CvePrePoliza = -1
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = NowADS()
ObjFactura.MotivoDescuento = ""
ObjFactura.Observaciones = ""
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = NowADS()
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CveCondicionEntrega = -1
ObjFactura.CondicionEntrega = ""
@@ -2762,7 +2762,7 @@ Partial Class PopUpVerFactura
ObjFactura.Amortizacion = 0
ObjFactura.CveContrato = 0
ObjFactura.CveVendedor = 0
- ObjFactura.FechaVencimiento = Now
+ ObjFactura.FechaVencimiento = NowADS()
ObjFactura.TipoEstatus = 0
ObjFactura.Det_OrdenCompra = ""
ObjFactura.Inv_CveEstatusEntrega = 0
@@ -2923,7 +2923,7 @@ Partial Class PopUpVerFactura
Archivo = Nothing
End If
End Sub
- Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False, Optional RegenerarPDF As Boolean = False, Optional UsarStimulsoft As Boolean = False)
+ Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False, Optional RegenerarPDF As Boolean = False, Optional UsarStimul As Boolean = False)
Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing
@@ -2952,7 +2952,7 @@ Partial Class PopUpVerFactura
Dim Archivo As New System.IO.FileInfo(PathArchivo)
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
- If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimulsoft Then
+ If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimul Then
Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
'se rellena la sucursal
'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel)
@@ -3128,7 +3128,7 @@ Partial Class PopUpVerFactura
End If
End If
- If Vta.Version.ToEntero() = 4 AndAlso dr1("CodigoObjetoImpuesto").ToString() = "02" AndAlso Now.Date >= New DateTime(2022, 11, 1) AndAlso dr1("Descuento").ToString().ToDecimal().RoundSQL(2) = dr1("Total").ToString().ToDecimal().RoundSQL(2) Then
+ If Vta.Version.ToEntero() = 4 AndAlso dr1("CodigoObjetoImpuesto").ToString() = "02" AndAlso NowADS().Date >= New DateTime(2022, 11, 1) AndAlso dr1("Descuento").ToString().ToDecimal().RoundSQL(2) = dr1("Total").ToString().ToDecimal().RoundSQL(2) Then
dr1("CodigoObjetoImpuesto") = "04"
End If
@@ -3261,7 +3261,7 @@ Partial Class PopUpVerFactura
Dim CveTimbreCartaPorteVenta As Integer = -1
Dim CartaPorte As Modelos.MSubReportData = Nothing
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
- If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimulsoft Then
+ If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimul Then
If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Ing" Then
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
@@ -3289,8 +3289,8 @@ Partial Class PopUpVerFactura
End If
End If
- If UsarStimulsoft Then
- ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte, UsarStimulsoft:=UsarStimulsoft), Vta.SerieFolio, "PDF")
+ If UsarStimul Then
+ ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte, UsarStimul:=UsarStimul), Vta.SerieFolio, "PDF")
Else
If Archivo.Exists Then
If RegenerarPDF Then
@@ -3602,7 +3602,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "Inventario Inicial"))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
'params.Add(New ReportParameter("Descuentos", (dr("Descuentos").ToString.ToDouble).FormatoNumero(2)))
@@ -3662,7 +3662,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Concepto", ConceptoFormato))
params.Add(New ReportParameter("Almacen", Almacen))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
@@ -3714,7 +3714,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", concepto))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, "")))
@@ -3766,7 +3766,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "ENTRADA DE ALMACÉN"))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, "")))
@@ -3781,7 +3781,7 @@ Partial Class PopUpVerFactura
End If
If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
- ImprimirPDFStimulsoft("Empresas/Grales/Formatos/EntradaSalida.mrt", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString))
+ ImprimirPDFStimul("Empresas/Grales/Formatos/EntradaSalida.mrt", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString))
Else
ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
@@ -3836,7 +3836,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Telefono", DtMovimientos(0)("Telefono").ToString))
params.Add(New ReportParameter("Correo", DtMovimientos(0)("Correo").ToString))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("NombreEntrego", Capturo))
params.Add(New ReportParameter("NombreRecibio", Recibio))
@@ -3916,7 +3916,7 @@ Partial Class PopUpVerFactura
End If
params.Add(New ReportParameter("Concepto", concepto))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("FacturaProveedor", FolioVenta))
@@ -3948,7 +3948,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FacturaProveedor", FolioVenta))
params.Add(New ReportParameter("FacturadoA", If(DtMovimientos(0)("Nombre").ToString <> "", DtMovimientos(0)("Nombre").ToString, NombreCliente)))
params.Add(New ReportParameter("Observaciones", Observaciones))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -3984,7 +3984,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FacturaProveedor", FolioVenta))
params.Add(New ReportParameter("FacturadoA", If(DtMovimientos(0)("Nombre").ToString <> "", DtMovimientos(0)("Nombre").ToString, NombreCliente)))
params.Add(New ReportParameter("Observaciones", Observaciones))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -4041,7 +4041,7 @@ Partial Class PopUpVerFactura
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
Else
If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
- ImprimirPDFStimulsoft("Empresas/Grales/Formatos/EntradaSalida.mrt", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString))
+ ImprimirPDFStimul("Empresas/Grales/Formatos/EntradaSalida.mrt", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString))
Else
ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
@@ -4059,7 +4059,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "Entrada por Desarmado de Paquete"))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -4083,7 +4083,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "Salida por Armado de Paquete"))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -4126,7 +4126,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("AlmacenDestino", AlmacenDestino))
params.Add(New ReportParameter("NombreProveedor", Proveedor))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Resguardo.rdlc", DtMovimientos, params, String.Format("Resguardo - {0}", Folio.ToString), RDSName:="DsInventarios")
@@ -4198,7 +4198,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("AlmacenDestino", AlmacenDestino))
params.Add(New ReportParameter("NombreProveedor", Proveedor))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
End If
@@ -4359,7 +4359,7 @@ Partial Class PopUpVerFactura
If UsuarioActual.CveEmpresa = 140 Then
params.Add(New ReportParameter("Origen", Almacen))
params.Add(New ReportParameter("Destino", AlmacenDestino))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("CantidadProductos", CantidadProductos.ToString()))
@@ -4369,7 +4369,7 @@ Partial Class PopUpVerFactura
ElseIf UsuarioActual.CveEmpresa = 153 Then
params.Add(New ReportParameter("Origen", Almacen))
params.Add(New ReportParameter("Destino", AlmacenDestino))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Observaciones", Observaciones)) 'TxtObservaciones.Text
@@ -4388,7 +4388,7 @@ Partial Class PopUpVerFactura
End If
If UsuarioActual.CveEmpresa = 72 Or UsuarioActual.CveEmpresa = 119 Then
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("AlmacenOrigen", Almacen))
params.Add(New ReportParameter("AlmacenDestino", AlmacenDestino))
@@ -4404,11 +4404,11 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
params.Add(New ReportParameter("Origen", Almacen))
params.Add(New ReportParameter("Destino", AlmacenDestino))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
- ImprimirPDFStimulsoft(String.Format("Empresas/Grales/Formatos/Traslado.mrt", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Aviso de Traslado - {0}", Folio), RDSName:="DsInventarios")
+ ImprimirPDFStimul(String.Format("Empresas/Grales/Formatos/Traslado.mrt", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Aviso de Traslado - {0}", Folio), RDSName:="DsInventarios")
Else
ImprimirPDF(String.Format("Empresas/Grales/Formatos/Traslado.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Aviso de Traslado - {0}", Folio), RDSName:="DsInventarios")
End If
@@ -4439,7 +4439,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Factura", DtMovimientos(0)("SerieFolio").ToString))
If UsuarioActual.CveEmpresa = 72 Or UsuarioActual.CveEmpresa = 119 Then
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("AlmacenOrigen", Almacen))
params.Add(New ReportParameter("AlmacenDestino", AlmacenDestino))
@@ -4451,7 +4451,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Origen", AlmacenDestino)) ' se invierte
params.Add(New ReportParameter("Destino", Almacen))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
@@ -4460,7 +4460,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
params.Add(New ReportParameter("Origen", AlmacenDestino)) ' se invierte
params.Add(New ReportParameter("Destino", Almacen))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
End If
@@ -4473,7 +4473,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Origen", Almacen))
params.Add(New ReportParameter("Destino", AlmacenDestino))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
ImprimirPDF(String.Format("Empresas/Grales/Formatos/Traslado.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Recepción de Traslado - {0}", Folio), RDSName:="DsInventarios")
@@ -4544,7 +4544,7 @@ Partial Class PopUpVerFactura
End If
If UsuarioActual.CveEmpresa = 119 Then
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
End If
'ObjInventarios.Dispose()
@@ -4660,7 +4660,7 @@ Partial Class PopUpVerFactura
End If
params.Add(New ReportParameter("Concepto", "Entrada por garantia"))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("Almacen", Almacen))
@@ -4693,7 +4693,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "Salida Garantía"))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("Almacen", Almacen))
@@ -4740,7 +4740,7 @@ Partial Class PopUpVerFactura
CiudadSucursal = String.Format("{0}, {1}", DtMovimientos(0)("Municipio").ToString, DtMovimientos(0)("Estado").ToString)
DomicilioSucursal = String.Format("{0} #{1}, {2}, Col. {3}, CP: {4}, {5}, {6}", DtMovimientos(0)("Calle").ToString, DtMovimientos(0)("NoExt").ToString, DtMovimientos(0)("NoInt").ToString, DtMovimientos(0)("Colonia"), DtMovimientos(0)("CP").ToString, CiudadSucursal, DtMovimientos(0)("Pais").ToString)
End If
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Concepto", "DEVOLUCIÓN DEL CLIENTE"))
params.Add(New ReportParameter("Fecha", Fecha))
@@ -4752,7 +4752,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FacturadoA", DtMovimientos(0)("Nombre").ToString))
params.Add(New ReportParameter("EnviarA", DtMovimientos(0)("Mail").ToString))
params.Add(New ReportParameter("Entrega", DtMovimientos(0)("Entrega").ToString))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
If UsuarioActual.CveEmpresa = 72 Or UsuarioActual.CveEmpresa = 119 Then
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
@@ -4780,7 +4780,7 @@ Partial Class PopUpVerFactura
CiudadSucursal = String.Format("{0}, {1}", DtMovimientos(0)("Municipio").ToString, DtMovimientos(0)("Estado").ToString)
DomicilioSucursal = String.Format("{0} #{1}, {2}, Col. {3}, CP: {4}, {5}, {6}", DtMovimientos(0)("Calle").ToString, DtMovimientos(0)("NoExt").ToString, DtMovimientos(0)("NoInt").ToString, DtMovimientos(0)("Colonia"), DtMovimientos(0)("CP").ToString, CiudadSucursal, DtMovimientos(0)("Pais").ToString)
End If
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Concepto", "DEVOLUCIÓN DEL CLIENTE"))
params.Add(New ReportParameter("Fecha", Fecha))
@@ -4792,7 +4792,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FacturadoA", DtMovimientos(0)("Nombre").ToString))
params.Add(New ReportParameter("EnviarA", DtMovimientos(0)("Mail").ToString))
params.Add(New ReportParameter("Entrega", DtMovimientos(0)("Entrega").ToString))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
ImprimirPDF("Empresas/Grales/Formatos/DevolucionCliente.rdlc", DtMovimientos, params, String.Format("Devolucion del Cliente - {0}", Folio.ToString), RDSName:="DsInventarios")
@@ -4810,7 +4810,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "Armado de Paquete"))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -4835,7 +4835,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "Desarmado de Paquete"))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -4861,7 +4861,7 @@ Partial Class PopUpVerFactura
End If
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -4888,7 +4888,7 @@ Partial Class PopUpVerFactura
' params.Add(New ReportParameter("Concepto", "Entrada por Prestamo"))
' params.Add(New ReportParameter("Almacen", Almacen))
' params.Add(New ReportParameter("Fecha", Fecha))
- ' params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ ' params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
' params.Add(New ReportParameter("Folio", Folio))
' params.Add(New ReportParameter("Descuentos", ""))
' params.Add(New ReportParameter("IVA", ""))
@@ -4915,7 +4915,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", "Salida por resguardo"))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -4997,7 +4997,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Concepto", ConceptoReporte))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Proveedor", Proveedor))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
@@ -5037,7 +5037,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Telefono", DtMovimientos(0)("Telefono").ToString))
params.Add(New ReportParameter("Correo", DtMovimientos(0)("Correo").ToString))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("NombreEntrego", Capturo))
params.Add(New ReportParameter("NombreRecibio", Recibio))
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
@@ -5057,7 +5057,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Observaciones", Observaciones))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("NombreRecibio", Recibio))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/SalidaDemostracion.rdlc", DtMovimientos, params, String.Format("Salida por Demostración - {0}", Folio.ToString), RDSName:="DsInventarios")
End If
@@ -5100,7 +5100,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Telefono", DtMovimientos(0)("Telefono").ToString))
params.Add(New ReportParameter("Correo", DtMovimientos(0)("Correo").ToString))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("NombreEntrego", Capturo))
params.Add(New ReportParameter("NombreRecibio", Recibio))
@@ -5184,7 +5184,7 @@ Partial Class PopUpVerFactura
End If
params.Add(New ReportParameter("Concepto", ConceptoReporte))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("FacturaProveedor", FolioVenta))
@@ -5207,7 +5207,7 @@ Partial Class PopUpVerFactura
Else
If UsuarioActual.CveEmpresa = 140 Then
params.Add(New ReportParameter("Concepto", ConceptoReporte))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioRegistro", UsuarioRegistro))
End If
params.Add(New ReportParameter("Folio", Folio))
@@ -5230,7 +5230,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FacturaProveedor", FolioVenta))
params.Add(New ReportParameter("FacturadoA", DtMovimientos(0)("Nombre").ToString))
params.Add(New ReportParameter("Observaciones", Observaciones))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Descuentos", ""))
params.Add(New ReportParameter("IVA", ""))
@@ -5306,7 +5306,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Sucursal", "Sucursal"))
params.Add(New ReportParameter("Cliente", NombreCliente))
params.Add(New ReportParameter("Folio", Folio))
- params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy hh:mm tt")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy hh:mm tt")))
params.Add(New ReportParameter("Recibio", Recibio))
params.Add(New ReportParameter("Observaciones", Observaciones))
'params.Add(New ReportParameter("Observaciones", "Observaciones con un tamaño mas grande para ver como se ve en el ticket chico."))
@@ -5331,7 +5331,7 @@ Partial Class PopUpVerFactura
CiudadSucursal = String.Format("{0}, {1}", DtMovimientos(0)("Municipio").ToString, DtMovimientos(0)("Estado").ToString)
DomicilioSucursal = String.Format("{0} #{1}, {2}, Col. {3}, CP: {4}, {5}, {6}", DtMovimientos(0)("Calle").ToString, DtMovimientos(0)("NoExt").ToString, DtMovimientos(0)("NoInt").ToString, DtMovimientos(0)("Colonia"), DtMovimientos(0)("CP").ToString, CiudadSucursal, DtMovimientos(0)("Pais").ToString)
End If
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("Concepto", "DEVOLUCIÓN DEL CLIENTE"))
params.Add(New ReportParameter("Fecha", Fecha))
@@ -5343,7 +5343,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FacturadoA", DtMovimientos(0)("Nombre").ToString))
params.Add(New ReportParameter("EnviarA", DtMovimientos(0)("Mail").ToString))
params.Add(New ReportParameter("Entrega", DtMovimientos(0)("Entrega").ToString))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/DevolucionCliente.rdlc", DtMovimientos, params, String.Format("Devolucion del Cliente - {0}", Folio.ToString), RDSName:="DsInventarios")
@@ -5479,7 +5479,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Año", dr("Año").ToString))
params.Add(New ReportParameter("TelefonoContacto", dr("TelefonoContacto").ToString))
- params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
params.Add(New ReportParameter("Condiciones", dr("Condiciones").ToString))
params.Add(New ReportParameter("FechaAtencion", If(dr("FechaInicio").ToString.Length > 0, dr("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy hh:mm tt"), "")))
@@ -5503,7 +5503,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", RutaImagenLogo))
@@ -5956,9 +5956,7 @@ Partial Class PopUpVerFactura
DtAcuse.Rows.Add(RowCFDI)
End If
-
-
- ImprimirPDFStimulsoft(DirectorioArchivo, DtAcuse, params, "AcuseCancelacion" & CveVenta)
+ ImprimirPDFStimul(DirectorioArchivo, DtAcuse, params, "AcuseCancelacion" & CveVenta)
End If
@@ -5978,7 +5976,7 @@ Partial Class PopUpVerFactura
Tabla = ObjIE.DtResultados
Dim params As New List(Of ReportParameter)
- params.Add(New ReportParameter("Fecha", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("Fecha", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("FechaIE", ObjIE.DtResultados(0)("FechaDocumento").ToString.ToDate.ToShortDateString))
params.Add(New ReportParameter("CuentaCaja", CuentaCaja))
params.Add(New ReportParameter("CuentaDeposito", CuentaDeposito))
@@ -6107,7 +6105,7 @@ Partial Class PopUpVerFactura
ElseIf CveTipoTransaccion.Contiene(2, 8, 9, 10) Then
Dim Folio, Observacion, UsuarioRegistro, TextoImporte, PagueseA, Ruta, Banco, NumCuenta, AbonoCuenta, SubProyecto, NotificarA, RefCrediproveedor As String
- Dim FechaExpedicion As Date = Now
+ Dim FechaExpedicion As Date = NowADS()
Dim Importe As Double
Dim FormatoCheque As String = ""
@@ -6220,7 +6218,7 @@ Partial Class PopUpVerFactura
'IMPRESION DE FORMATO DE IE PAGO EN EFECTIVO PARA COMPU - VIATICOS
Dim Folio As String = "", Observacion As String = "", UsuarioRegistro As String = "", TextoImporte As String = "", PagueseA As String = ""
Dim Ruta As String = UsuarioActual.Empresa.Ruta
- Dim FechaExpedicion As Date = Now
+ Dim FechaExpedicion As Date = NowADS()
Dim Importe As Double
Dim FormatoCheque As String = ""
@@ -6304,7 +6302,7 @@ Partial Class PopUpVerFactura
If UsuarioActual.CveEmpresa = 72 Then
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("CveCajaChica", DtComprobacion.Rows(0)("CveCajaChica").ToString))
params.Add(New ReportParameter("CveFyE", "0")) '
@@ -6321,7 +6319,7 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("Numero", "")) '
params.Add(New ReportParameter("Anio", DtComprobacion.FiltraParametros("CveCompra > 0").MAX("Fecha").ToDate.Year.ToString))
params.Add(New ReportParameter("Nombre", DtComprobacion.MAX("SubProyecto")))
- params.Add(New ReportParameter("Fecha", Now.Date.ToString))
+ params.Add(New ReportParameter("Fecha", NowADS().Date.ToString))
params.Add(New ReportParameter("Elaboro", ""))
params.Add(New ReportParameter("Autorizo", ""))
params.Add(New ReportParameter("ElaboroPuesto", ""))
@@ -6331,7 +6329,7 @@ Partial Class PopUpVerFactura
Else
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("cuentaRetiro", "Cuenta retiro: " & ParamComprobacion.Rows(0)("BancoNumCuentaMoneda").ToString))
params.Add(New ReportParameter("CajaChica", "Caja chica: " & ParamComprobacion.Rows(0)("BancoNumCuentaMoneda").ToString))
@@ -6384,7 +6382,7 @@ Partial Class PopUpVerFactura
Dim paramList As New List(Of ReportParameter)
With paramList
.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- .Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ .Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
.Add(New ReportParameter("Cuenta", ObjIE.NumCuenta, True))
.Add(New ReportParameter("Fecha", ObjIE.FechaDocumento.ToString("dd/MM/yyyy"), True))
diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb
index 8cfa32948..ffd74af0e 100644
--- a/Compras/Proveedores.aspx.vb
+++ b/Compras/Proveedores.aspx.vb
@@ -8,8 +8,6 @@ Imports System.Xml
Imports Microsoft.Reporting.WebForms
Imports System.IO
Imports System.Globalization
-Imports System.Data.SqlClient
-'Imports VBIDE
Partial Class Compras_Proveedores
Inherits ClsPaginas
@@ -451,7 +449,7 @@ Partial Class Compras_Proveedores
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
- Return Date.Now.AddDays(15)
+ Return NowADS().AddDays(15)
Else
Return ViewState("FechaLimite").ToString.ToDate
End If
@@ -548,7 +546,7 @@ Partial Class Compras_Proveedores
ImgAddObs.Visible = False
ChkEstado.Checked = True : ChkEstado.Enabled = False
- LblFechaCaptura.Text = Now.ToShortDateString()
+ LblFechaCaptura.Text = NowADS().ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
ViewState("CveProveedor") = -1
DivSucursales.Visible = False
@@ -627,8 +625,8 @@ Partial Class Compras_Proveedores
End If
- TxtFechaICredito.Text = Now.AddYears(-2).ToShortDateString
- TxtFechaFCredito.Text = Now.ToShortDateString
+ TxtFechaICredito.Text = NowADS().AddYears(-2).ToShortDateString
+ TxtFechaFCredito.Text = NowADS().ToShortDateString
If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then
TabEvaluacion.Visible = True
@@ -736,7 +734,7 @@ Partial Class Compras_Proveedores
Private Function CargadeFactura(CveFactura As Integer) As Integer
Dim ObjeFacturas As New ClsCompras
- If ObjeFacturas.GetFacturas(CveFactura, "-1", Now.AddYears(-2), Now, "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) Then
+ If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-2), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) Then
Dim XMLDoc As New XmlDocument
Try
@@ -1119,10 +1117,9 @@ Partial Class Compras_Proveedores
Private Sub CargaAnticipos(CveProveedorSucursal As Integer, Optional SelectTop As Integer = -1)
Dim ObjMovtos As New ClsMovimientos()
- If ObjMovtos.GetAnticiposProveedor(CveProveedor, If(CveProveedorSucursal = 0, -1, CveProveedorSucursal), CveMonedaFiltro, -1) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then
+ If ObjMovtos.GetAnticiposProveedor(CveProveedor, UsuarioActual.CveEmpresa, CveMoneda:=CveMonedaFiltro, CveProveedorSucursal:=If(CveProveedorSucursal = 0, -1, CveProveedorSucursal)) AndAlso ObjMovtos.DtResultados.Rows.Count > 0 Then
CountAnticipos = ObjMovtos.DtResultados.FiltraParametros(" Tipo = 'Act' AND TipoDocto <> '' AND (CveCompra > 0 OR CveIE > 0) ").Rows.Count
-
LblVencidoPesosAnt.Text = String.Format("{0}", ObjMovtos.DtResultados.SUM("Saldo", "CveMoneda = 1 And DiasVencidos > 0")).FormatoNumero
LblTotalPesosAnt.Text = String.Format("{0}", ObjMovtos.DtResultados.SUM("Saldo", "CveMoneda = 1 ")).FormatoNumero
LblPorVencerPesosAnt.Text = CType(LblTotalPesosAnt.Text.ToDouble - LblVencidoPesosAnt.Text.ToDouble, String).FormatoNumero
@@ -1134,7 +1131,6 @@ Partial Class Compras_Proveedores
LblTipoCambioAnt.Text = GlobalTipoCambio.ToString.FormatoNumero
LblTotalAnt.Text = (LblTotalPesosAnt.Text.ToDouble + (LblTotalDolaresAnt.Text.ToDouble * LblTipoCambioAnt.Text.ToDouble)).ToString.FormatoNumero
-
If SelectTop > 0 Then
If ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'").Rows.Count > 0 Then
DtAntNC = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'")
@@ -2032,7 +2028,7 @@ Partial Class Compras_Proveedores
End Sub
- Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, CveConceptoContable As Integer, Optional Transaccion As SqlTransaction = Nothing, Optional IdCompaqPadre As Integer = -1, Optional CveProveedorCuenta As Integer = -1) As Boolean
+ Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, CveConceptoContable As Integer, Optional Transaccion As SqlClient.SqlTransaction = Nothing, Optional IdCompaqPadre As Integer = -1, Optional CveProveedorCuenta As Integer = -1) As Boolean
If Not UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then
Return True
@@ -2233,7 +2229,7 @@ Partial Class Compras_Proveedores
Dim Para As String = TxtCorreoCobranza.Text.Trim
Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx"
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & NowADS().Ticks & "&CveE=" & UsuarioActual.CveEmpresa)
Dim ObjMail As New ClsSisMail()
@@ -3734,7 +3730,7 @@ Partial Class Compras_Proveedores
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
lista.Add(New CrystalParametro("TipoCuentas", DdlTipoCuentasCxP.SelectedItem.Text))
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
- lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString, FF)))
+ lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", NowADS().ToShortDateString, FF)))
lista.Add(New CrystalParametro("NombreProveedor", LtlProveedor.Text))
lista.Add(New CrystalParametro("DireccionProveedor", TxtDireccion.Text))
lista.Add(New CrystalParametro("ProveedorRFC", TxtRFC.Text))
@@ -3889,7 +3885,7 @@ Partial Class Compras_Proveedores
' ' ArchivoTemp.Delete()
' ' Dim Descargas As New StringBuilder()
- ' ' Descargas.AppendFormat("
", UsuarioActual.CveEmpresa, CvePersonal, CvePeriodo, NowADS().Ticks)
' Alert(" El Registro de Nómina, se generó correctamente.
Descargas:
" & Descargas.ToString & "
", TipoMensaje.MsgInformacion)
'End Sub
diff --git a/Nomina/RepFiniquito.aspx.cs b/Nomina/RepFiniquito.aspx.cs
index 7ac7410bb..8c1a34ac2 100644
--- a/Nomina/RepFiniquito.aspx.cs
+++ b/Nomina/RepFiniquito.aspx.cs
@@ -25,7 +25,7 @@ public partial class Nomina_RepFiniquito : ClsPaginas
{
if (!IsPostBack)
{
- DateTime dnow = DateTime.Now;
+ DateTime dnow = NowADS();
int diafin = DateTime.DaysInMonth(dnow.Year, dnow.Month);
TxtFechaInicio.Text = string.Format("01/{0:MM/yyyy}", dnow);
TxtFechaFin.Text = string.Format("{1}/{0:MM/yyyy}", dnow,diafin);
diff --git a/Nomina/RepInversiondeNomina.aspx.cs b/Nomina/RepInversiondeNomina.aspx.cs
index dbe7625aa..77656795d 100644
--- a/Nomina/RepInversiondeNomina.aspx.cs
+++ b/Nomina/RepInversiondeNomina.aspx.cs
@@ -100,7 +100,7 @@ public partial class Nomina_RepInversiondeNomina : ClsPaginas
DdlDepartamento.DataBind();
DdlDepartamento.Items.Insert(0, new ListItem("Todos", "-1"));
- TxtFechaInicio.Text = Request["fechaInicio"] == null ? DateTime.Now.ToString("01/MM/yyyy") : Request["fechaInicio"].ToString().ToDateTime().ToString("dd/MM/yyyy");
+ TxtFechaInicio.Text = Request["fechaInicio"] == null ? NowADS().ToString("01/MM/yyyy") : Request["fechaInicio"].ToString().ToDateTime().ToString("dd/MM/yyyy");
TxtFechaFin.Text = Request["fechaFin"] == null ? "" : Request["fechaFin"].ToString().ToDateTime().ToString("dd/MM/yyyy");
diff --git a/Nomina/RepPersonalAcumulados.aspx.vb.exclude b/Nomina/RepPersonalAcumulados.aspx.vb.exclude
index 1df8ecb65..7ed1f0e18 100644
--- a/Nomina/RepPersonalAcumulados.aspx.vb.exclude
+++ b/Nomina/RepPersonalAcumulados.aspx.vb.exclude
@@ -119,7 +119,7 @@ Partial Class Nomina_RepPersonalAcumulados
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReportePersonalAcumulados" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReportePersonalAcumulados" & NowADS().ToShortDateString)
End Sub
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
diff --git a/Nomina/RepPersonalDIM.aspx.vb b/Nomina/RepPersonalDIM.aspx.vb
index fb2d75c48..3f84f8cc5 100644
--- a/Nomina/RepPersonalDIM.aspx.vb
+++ b/Nomina/RepPersonalDIM.aspx.vb
@@ -82,7 +82,7 @@ Partial Class Nomina_RepPersonalDIM
DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
If DdlEjercicio.Items.Count = 0 Then
- DdlEjercicio.Items.Add(New ListItem(Now.Year.ToString, Now.Year.ToString))
+ DdlEjercicio.Items.Add(New ListItem(NowADS().Year.ToString, NowADS().Year.ToString))
End If
End Sub
@@ -460,7 +460,7 @@ Partial Class Nomina_RepPersonalDIM
worksheet.Rows(IndexEndTable + 1).Cells(1).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(3).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(3).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(3).Value = NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
diff --git a/Nomina/ReportePTU.aspx.vb b/Nomina/ReportePTU.aspx.vb
index 88f85fafb..faacecee9 100644
--- a/Nomina/ReportePTU.aspx.vb
+++ b/Nomina/ReportePTU.aspx.vb
@@ -49,7 +49,7 @@ Partial Class Nomina_ReportePTU
DdlEjercicios.DataBind()
If (DdlEjercicios.Items.Count > 0) Then
DdlEjercicios.SelectedIndex = 0
- DdlEjercicios.SelectedValueExist(DateTime.Now.Year.ToString())
+ DdlEjercicios.SelectedValueExist(NowADS().Year.ToString())
DdlEjercicios_SelectedIndexChanged(Nothing, Nothing)
End If
End If
diff --git a/Nomina/ReportedeAcumulados.aspx.cs b/Nomina/ReportedeAcumulados.aspx.cs
index c1ba412a4..2494996c2 100644
--- a/Nomina/ReportedeAcumulados.aspx.cs
+++ b/Nomina/ReportedeAcumulados.aspx.cs
@@ -115,7 +115,7 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas
int EjercicioActual = UsuarioActual.Empresa.EjercicioActual;
if (EjercicioActual == 0)
{
- EjercicioActual = DateTime.Now.Year;
+ EjercicioActual = NowADS().Year;
}
DataTable dtejercicio = null;
using (ClsNominas objnom = new ClsNominas())
@@ -153,7 +153,7 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas
{
DdlEjercicios.SelectedIndex = 0;
}
- DdlEjercicios.SelectedValueExist(DateTime.Now.Year.ToString());
+ DdlEjercicios.SelectedValueExist(NowADS().Year.ToString());
}
private void CargaTiposPeriodo()
{
@@ -682,8 +682,8 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas
libro.Range(2, 2, 2, 6).Merge().Value = "Reporte de acumulados nómina";
libro.Range(1, 2, 2, 6).Style.Font.Bold = true; libro.Range(1, 2, 2, 6).Style.Font.FontSize = 16;
libro.Range(3, 2, 3, 6).Merge().Value = $"del {TxtRpdFechaInicio.Text.ToDateTime():dd/MM/yyyy} al {TxtRpdFechaFin.Text.ToDateTime():dd/MM/yyyy}";
- libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}";
- libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}";
+ libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{NowADS():dd/MM/yyyy}";
+ libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{NowADS():HH:mm}";
System.IO.Stream fs = new System.IO.MemoryStream();
diff --git a/Nomina/SobreRecibo.aspx.vb b/Nomina/SobreRecibo.aspx.vb
index 00a46140d..991913bce 100644
--- a/Nomina/SobreRecibo.aspx.vb
+++ b/Nomina/SobreRecibo.aspx.vb
@@ -63,7 +63,7 @@ Partial Class Nominas_SobreRecibo
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 Then
Dim ObjPeriodos As New ClsNominas
- If ObjPeriodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Now.Year, -1, -1) Then
+ If ObjPeriodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, NowADS().Year, -1, -1) Then
DdlPeriodo.DataSource = ObjPeriodos.DtResultados.FiltraParametros("Estatus IN (1,2,3)")
Else
DdlPeriodo.DataSource = Nothing
diff --git a/OC/CotizacionEnLinea.aspx.vb b/OC/CotizacionEnLinea.aspx.vb
index 939ea6f1f..79b2ad250 100644
--- a/OC/CotizacionEnLinea.aspx.vb
+++ b/OC/CotizacionEnLinea.aspx.vb
@@ -232,7 +232,7 @@ Partial Class OC_CotizacionEnLinea
ElseIf objCotizacion.CveColectiva > 0 Then
Dim objColectiva As New ClsGenerales
- If objColectiva.GetColectivas(CveColectiva, "-1", "-1", "1", CveEmpresa) Then
+ If objColectiva.GetColectivas(CveEmpresa, CveColectiva:=CveColectiva) Then
If objColectiva.DtResultados.Rows.Count > 0 Then
lblProveedor.Text = objColectiva.DtResultados.Rows(0)("Colectiva").ToString
End If
@@ -293,9 +293,9 @@ Partial Class OC_CotizacionEnLinea
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim objCotizacion As New ClsOC
objCotizacion.IniciaTransacSQL()
- Dim TieneError = False
+ Dim TieneError As Boolean = False
- If objCotizacion.UpdateCotizacion(CveProveedor, CveColectiva, TxtFolio.Text, Now.ToShortDateString(), IO.Path.GetExtension(FUArchivo.FileName), ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, 0, CveCotizacion) Then
+ If objCotizacion.UpdateCotizacion(CveProveedor, CveColectiva, TxtFolio.Text, ClsPaginas.NowADS().ToShortDateString(), IO.Path.GetExtension(FUArchivo.FileName), ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, 0, CveCotizacion) Then
If FUArchivo.HasFile Then
'verificar que exista el directorio
@@ -364,7 +364,7 @@ Partial Class OC_CotizacionEnLinea
Dim strBody As New StringBuilder
If objCotizacion.GetOC(CveOrdenCompra, CveEmpresa) Then
- Dim Folio = "", Descripcion = "", Justificacion = "", Estatus = "", Empresa = "", FechaEstimadaEntrega = ""
+ Dim Folio As String = "", Descripcion As String = "", Justificacion As String = "", Estatus As String = "", Empresa As String = "", FechaEstimadaEntrega As String = ""
Folio = objCotizacion.Folio.ToString
Descripcion = objCotizacion.Descripcion
@@ -509,7 +509,7 @@ Partial Class OC_CotizacionEnLinea
Protected Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvD.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.FCCalendarExtender("CEFechaEntrega").StartDate = Date.Now
+ e.Row.FCCalendarExtender("CEFechaEntrega").StartDate = ClsPaginas.NowADS()
e.Row.FCTextBox("TxtPU").Attributes.Add("onchange", String.Format("$get('{0}').value = FormatNumber(parseFloat(this.value) * parseFloat($get('{1}').value), 2, true, true, true);", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.FCTextBox("TxtCant").ClientID))
Page.ClientScript.RegisterExpandoAttribute(e.Row.FCCustomValidator("CVFechaEntrega").ClientID, "txtCantidadSurtir", e.Row.FCTextBox("txtCantidadSurtir").ClientID, False)
diff --git a/OC/CotizacionEnvio.aspx.vb b/OC/CotizacionEnvio.aspx.vb
index e49748aed..8fc084c94 100644
--- a/OC/CotizacionEnvio.aspx.vb
+++ b/OC/CotizacionEnvio.aspx.vb
@@ -86,7 +86,7 @@ Partial Class OC_CotizacionEnvio
Protected Sub CargaColectivas()
Dim objColectiva As New ClsGenerales
- If objColectiva.GetColectivas(-1, "-1", "-1", "1", UsuarioActual.CveEmpresa) Then
+ If objColectiva.GetColectivas(UsuarioActual.CveEmpresa, -1) Then
DtColectivas = objColectiva.DtResultados
ddlColectiva.DataSource = DtColectivas
@@ -272,7 +272,7 @@ Partial Class OC_CotizacionEnvio
If TieneError = False Then
Dim Body As String
- For i = 0 To Correo.Count - 1
+ For i As Integer = 0 To Correo.Count - 1
'Dim Body As String = GeneraCorreo(objCotizacion.CveCotizacion, objCotizacion)
Body = GeneraCorreo(OrdenCotizacion(i), objCotizacion)
diff --git a/OC/ListaRequisicion.aspx.cs b/OC/ListaRequisicion.aspx.cs
index 36e3fbb8d..99292aff5 100644
--- a/OC/ListaRequisicion.aspx.cs
+++ b/OC/ListaRequisicion.aspx.cs
@@ -118,7 +118,7 @@ public partial class OC_ListaRequisicion : ClsPaginas
@params.Add(new ReportParameter("pImg", Imagen.Exists ? $"file://{Imagen.FullName}" : ""));
@params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
@params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- @params.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()));
+ @params.Add(new ReportParameter("FechaImpresion", NowADS().ToShortDateString()));
@params.Add(new ReportParameter("LogoPath", Imagen.Exists ? $"file://{Imagen.FullName}" : ""));
ImprimirPDF(RutaPDF, DTDatos, @params, "Lista de Requisicion", Formato);
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index a68e38494..b7da299e9 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -724,7 +724,7 @@ Partial Class OC_OC
'Poner el Estatus mas Avanzado
' If DtEstatusUsuarios.Rows.Count > 0 Then CboE.SelectedValue = DtEstatusUsuarios.MAX("Nivel").ToEntero Else DesHabilitar()
- TxtFecha.Text = Now.ToString("dd/MM/yyyy")
+ TxtFecha.Text = NowADS().ToString("dd/MM/yyyy")
lblNombreUsuario.Text = UsuarioActual.Nombre
ViewState("CveOrdenCompra") = 0
CargaFolios()
@@ -2213,7 +2213,7 @@ Partial Class OC_OC
Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDecimal
End If
End If
- If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
+ If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
If ObjCon.DtResultados.Rows.Count > 0 Then
Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal
@@ -2377,6 +2377,10 @@ Partial Class OC_OC
Private Function ValidaGuardar() As Boolean
Dim TieneError As Boolean = False
+ If UsuarioActual.CveEmpresa.Contiene(119) Then
+ ChkCotizacion.Checked = False
+ End If
+
If CboE.SelectedValue.ToEntero = 0 AndAlso TipoOC = "OC" Then
Alert("Las ordenes de compra no puede tener el estatus 'Pre Solicitud'. Debe ser una requisición", TipoMensaje.MsgAdvertencia)
Return True
@@ -2608,10 +2612,6 @@ Partial Class OC_OC
'VALIDACIONES PARA GUARDAR
If ValidaGuardar() Then Exit Sub
- If UsuarioActual.CveEmpresa.Contiene(119) Then
- ChkCotizacion.Checked = False
- End If
-
Dim MsgError As String = "Hubo un error al registrar"
'VARIABLES
Dim CveProveedorSucursal As Integer = -1
@@ -2988,7 +2988,7 @@ Partial Class OC_OC
Dim CveMovimientoAlmacen As Integer = -1
Dim CveOCDetalle As Integer = -1
Dim CveAlmacen As Integer = -1
- Dim Fecha As Date = Now
+ Dim Fecha As Date = NowADS()
Dim CveProveedorInvOC As Integer = -1
Dim ProveedorNombre As String = ""
Dim SerieFolio As String = ""
@@ -3003,7 +3003,7 @@ Partial Class OC_OC
Dim PS As String = ""
If Not TieneError Then
- Fecha = Now
+ Fecha = NowADS()
CveProveedor = DdlProveedores.SelectedValue.ToEntero
ProveedorNombre = DdlProveedores.SelectedText
SerieFolio = $"OC: {Folio}"
@@ -3113,14 +3113,14 @@ Partial Class OC_OC
' 'SALIDA ADMINISTRATIVA (CON SALIDA POR TRASPASO) -AJUSTE
' If ConceptoSalida = 2 Then
- ' Dim CveMovimientoSalidaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 3, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, MovimientoFijo:=True, Modulo:="OC/G")
+ ' Dim CveMovimientoSalidaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 3, 1, NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, MovimientoFijo:=True, Modulo:="OC/G")
' For Each DrAjuste As DataRow In DtInvOC.FiltraParametros($"CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = 2").Rows
' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoSalidaAjuste, DrAjuste("Cantidad").ToString.ToDecimal, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("CveUM").ToString.ToEntero, DrAjuste("PU").ToString.ToDecimal, -1, CveOrdenCompraDetalle:=DrAjuste("CveOrdenCompraDetalle").ToString.ToEntero) Then
' TieneError = True
' Exit For
' End If
' Next
- ' Dim CveMovimientoEntradaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 2, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OC/G")
+ ' Dim CveMovimientoEntradaAjuste = ObjInventarios.AddMovimiento(CveAlmacen, 2, 1, NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="OC/G")
' If ObjInventarios.GetMovimientosDetalle(CveMovimientoSalidaAjuste, UsuarioActual.CveEmpresa) Then
' For Each Dr As DataRow In ObjInventarios.DtResultados.Rows
' If Not ObjInventarios.AddMovimientoDetalle(CveMovimientoEntradaAjuste, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, DtInvOCDiferencias.FiltroPrimeroValor("ImporteMovto", $"CveOrdenCompraDetalle = {Dr("CveOrdenCompraDetalle").ToString.ToEntero}").ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveOrdenCompraDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero) Then
@@ -3667,12 +3667,12 @@ Partial Class OC_OC
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
'CREA POLIZA NEGATIVA
- IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, Now)
+ IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, NowADS())
If IdPolizaNueva > 0 Then
'DETALLES POLIZA NEGATIVA
For Each dr As DataRow In dt.Rows
- If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, Now, "") Then
+ If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, NowADS(), "") Then
ErrorCancelar = True : Exit For
End If
Next
@@ -4089,7 +4089,7 @@ Partial Class OC_OC
Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows(0)("Importe").ToString.ToDecimal
End If
End If
- If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, CveProyecto,
+ If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, CveProyecto,
CveSubProyecto, UsuarioActual.CveUsuario, CveClasificacion) Then
If ObjCon.DtResultados.Rows.Count > 0 Then
Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal
@@ -5191,7 +5191,7 @@ Partial Class OC_OC
'AGREGA
Dim Dr As DataRow = DtBitacora.NewRow
- Dr("FechaIng") = Now
+ Dr("FechaIng") = NowADS()
Dr("FechaInicio") = ""
Dr("Usuario") = UsuarioActual.Usuario
Dr("CveUsuario") = UsuarioActual.CveUsuario
@@ -5330,7 +5330,7 @@ Partial Class OC_OC
Dim ObjOI As New ClsOIEventos(ObjOC.IniciaTransacSQL)
Dim TieneError As Boolean = False
- If ObjOI.AddEventoTarea(Asunto, Descripcion.ToString, 1, UsuarioActual.CveUsuario, DdlSAUsuario.SelectedValue.ToString.ToEntero, DateTime.Now, DateTime.Now.AddMinutes(15), -1, 1, -1, "-1", -1, -1, -1, -1, -1, CveOrdenCompra.ToEntero, -1, -1, UsuarioActual.CveUsuario, -1, CveEmpresaActual) Then
+ If ObjOI.AddEventoTarea(Asunto, Descripcion.ToString, 1, UsuarioActual.CveUsuario, DdlSAUsuario.SelectedValue.ToString.ToEntero, NowADS(), NowADS().AddMinutes(15), -1, 1, -1, "-1", -1, -1, -1, -1, -1, CveOrdenCompra.ToEntero, -1, -1, UsuarioActual.CveUsuario, -1, CveEmpresaActual) Then
If Not ObjOC.AddSolicitudAnticipo(CveOrdenCompra, TxtSAImporte.Text.ToDecimal, CveEmpresaActual) Then
TieneError = True
End If
@@ -5459,7 +5459,7 @@ Partial Class OC_OC
strBody.Append("
+
+
+
@@ -109,8 +119,6 @@
-
-
@@ -153,14 +161,14 @@
-
+
-
+
@@ -203,8 +211,8 @@
window.close();
}
- function Ir3(CveOC, Folio, CveEstatusSiguiente) {
- window.opener.VinculaOC(CveOC, Folio, CveEstatusSiguiente);
+ function Ir3(CveOC, Folio, CveEstatusSiguiente, CveProveedor) {
+ window.opener.VinculaOC(CveOC, Folio, CveEstatusSiguiente, CveProveedor);
window.close();
parent.$('#ajax').modal('hide');
}
diff --git a/OC/PopUpBuscarReq.aspx.vb b/OC/PopUpBuscarReq.aspx.vb
index 60be97147..0f9514e06 100644
--- a/OC/PopUpBuscarReq.aspx.vb
+++ b/OC/PopUpBuscarReq.aspx.vb
@@ -17,6 +17,12 @@ Partial Class OC_PopUpBuscarReq
Return ViewState("CveProveedor").ToString
End Get
End Property
+
+ Private ReadOnly Property CveProveedorMultiple As String
+ Get
+ Return ViewState("CveProveedorMultiple").ToString
+ End Get
+ End Property
Private ReadOnly Property Ruta As String
Get
Return UsuarioActual.Empresa.Ruta
@@ -27,7 +33,7 @@ Partial Class OC_PopUpBuscarReq
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
- Dim UsaParametros = False
+ Dim UsaParametros As Boolean = False
ViewState("VinculacionOC") = ""
ViewState("CveProveedor") = ""
@@ -35,10 +41,29 @@ Partial Class OC_PopUpBuscarReq
GV.Width = 750
If Request("V") IsNot Nothing AndAlso Request("V").ToString <> "" Then
If Request("P") IsNot Nothing AndAlso Request("P").ToString <> "" Then
+ ViewState("VinculacionOC") = Request("V")
+ ViewState("CveProveedor") = Request("P")
+ UPFiltros.Visible = False
+
+ Dim NombreProv As String = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, ViewState("CveProveedor").ToString.ToEntero).FiltroPrimeroValor("RazonSocial")
+ LbTitulo.Text = String.Format("Órdenes de Compra - {0}", NombreProv)
+
+ If UsuarioActual.Empresa.Funcionalidad(267) = "1" Then
+ UPProveedorCompra.Visible = True
+ 'DdlProveedorMultiple.setEsWebService(True)
+ 'DdlProveedorMultiple.Attributes.Add("data-metodo", "getproveedores") ' proveedores tipo productores // proveedores
+ DdlProveedorMultiple.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros("ProveedorClasificacion like '%PRODUCTOR%'")
+ DdlProveedorMultiple.DataBind()
+ DdlProveedorMultiple.Items.Insert(0, New ListItem("-", "-1"))
+ End If
+
CargarVinculacionCompras()
DivDatos.Attributes.Add("style", "overflow-y: auto; width: 950px; height: 700px;")
- GV.Width = 950
- GV.Columns(4).Visible = False
+ GV.Width = 930
+ GV.Columns(1).Visible = False ' folio req
+ GV.Columns(2).Visible = False ' tipo 'oc/req
+ GV.Columns(5).Visible = False ' nombre proveedor
+ GV.Columns(9).Visible = False ' descarga pdf
If UsuarioActual.Empresa.MetodoOC <> 2 Then
BtnVincularOC.Visible = True
End If
@@ -67,25 +92,10 @@ Partial Class OC_PopUpBuscarReq
#Region " CARGA URL PARAMETROS "
Private Sub CargaURLParametros()
- txtFechaI.Text = Now.FirstDayOfMonth.AddMonths(-3).ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.AddMonths(-3).ToShortDateString
CargaEstatus()
CargarCentrosDeCosto(DdlProyectos, DdlSubProyectos, LblProyecto, LtSubProyecto)
- 'If UsuarioActual.Empresa.GralSoloProyecto Then
- ' TdProyecto.Visible = False
- ' TdProyecto2.Visible = False
- ' LtSubProyecto.Text = "Proyecto:"
- 'Else
- ' 'DdlProyectos.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveProyecto", "Proyecto"}) 'GlobalDTProyectos(UsuarioActual.CveEmpresa, 1)
- ' 'DdlProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110),
- ' ' GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1))
- ' DdlProyectos.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1)
- ' DdlProyectos.DataBind()
- ' DdlProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
- 'End If
-
- 'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
- 'DdlProveedor.DataBind()
'DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
DdlProveedor.setEsWebService(True)
@@ -127,28 +137,18 @@ Partial Class OC_PopUpBuscarReq
#Region " CARGA DATOS "
Protected Sub CargarVinculacionCompras() ' CUANDO VIENE DESDE COMPRAS
- ViewState("VinculacionOC") = Request("V")
- ViewState("CveProveedor") = Request("P")
- UPFiltros.Visible = False
-
- Dim NombreProv As String = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, ViewState("CveProveedor").ToString.ToEntero).FiltroPrimeroValor("RazonSocial")
- LbTitulo.Text = String.Format("Órdenes de Compra - {0}", NombreProv)
-
- 'Dim ObjPro As New ClsCompProveedores
- 'ObjPro.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, ViewState("CveProveedor").ToString.ToEntero, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa)
- 'If ObjPro.DtResultados.Rows.Count > 0 Then
- ' LbTitulo.Text = String.Format("Órdenes de Compra - {0}", ObjPro.DtResultados.Rows(0)("RazonSocial").ToString)
- 'End If
- 'ObjPro.Dispose()
-
+ Dim tCveProveedor As Integer = ViewState("CveProveedor").ToString.ToEntero
+ If DdlProveedorMultiple.SelectedValue.ToEntero > 0 Then
+ ViewState("CveProveedorMultiple") = DdlProveedorMultiple.SelectedValue
+ ViewState("CveProveedor") = DdlProveedorMultiple.SelectedValue
+ tCveProveedor = DdlProveedorMultiple.SelectedValue.ToEntero
+ End If
'Cargar Datos
Dim ObjOC As New ClsOC
- 'ObjOC.GetOC(-1, UsuarioActual.CveEmpresa)
- ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, ViewState("CveProveedor").ToString.ToEntero, -1, -1, -1, UsuarioActual.CveEmpresa, -1)
- Dim DtOC = ObjOC.DtResultados.FiltraParametros("TipoTermino = 3") ' tipotermino, esattus inicial
+ ObjOC.GetOrdenesCompraRep("OC", -1, -1, -1, -1, MinFecha, MaxFecha, -1, tCveProveedor, -1, -1, -1, UsuarioActual.CveEmpresa, -1)
+ Dim DtOC As Data.DataTable = ObjOC.DtResultados.FiltraParametros("TipoTermino = 3") ' tipotermino, esattus inicial
ObjOC.Dispose()
-
If DtOC.Rows.Count > 0 Then ' tipotermino, esattus inicial
BtnVincularOC.Visible = True
End If
@@ -157,14 +157,13 @@ Partial Class OC_PopUpBuscarReq
GV.DataSource = DtOC.FiltraParametros("CveOrdenCompraDisponible > 0")
GV.DataBind()
- LtlTotalRegistros.Text = GV.Rows.Count.ToString
- LblTotalRegistros.Text = "Número de registros: "
+ LblTotalRegistros.Text = "Número de registros: " & GV.Rows.Count.ToString
UPDatos.Update()
End Sub
Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs)
- Dim CveProyecto = -1
- Dim CveSubProyecto = -1
+ Dim CveProyecto As Integer = -1
+ Dim CveSubProyecto As Integer = -1
If LblProyecto.Visible Then
CveProyecto = DdlProyectos.SelectedValue.ToEntero
@@ -184,7 +183,7 @@ Partial Class OC_PopUpBuscarReq
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, CveProveedor,
If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100)
- Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial
+ Dim DtOC As Data.DataTable = ObjOC.DtResultados ' tipotermino, esattus inicial
ObjOC.Dispose()
GV.DataSource = DtOC
@@ -208,7 +207,7 @@ Partial Class OC_PopUpBuscarReq
e.Row.FCHyperLink("HLDescripcion").Visible = True
e.Row.FCLabel("LbDescripcion").Visible = False
- Dim Link = String.Format("javascript:Ir3('{0}','{1}','{2}');", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("Folio"), e.Row.DBCampo("CveEstatusSiguiente"))
+ Dim Link As String = String.Format("javascript:Ir3('{0}','{1}','{2}');", e.Row.DBCampo("CveOrdenCompra"), e.Row.DBCampo("Folio"), e.Row.DBCampo("CveEstatusSiguiente"), e.Row.DBCampo("CveProveedor"))
e.Row.FCHyperLink("HLFolio").NavigateUrl = Link
e.Row.FCHyperLink("HLDescripcion").NavigateUrl = Link
@@ -219,7 +218,7 @@ Partial Class OC_PopUpBuscarReq
e.Row.FCHyperLink("HLDescripcion").Visible = True
e.Row.FCLabel("LbDescripcion").Visible = False
- Dim Link = String.Format("javascript:Ir4('{0}');", e.Row.DBCampo("CveOrdenCompra"))
+ Dim Link As String = String.Format("javascript:Ir4('{0}');", e.Row.DBCampo("CveOrdenCompra"))
e.Row.FCHyperLink("HLFolio").NavigateUrl = Link
e.Row.FCHyperLink("HLDescripcion").NavigateUrl = Link
@@ -231,7 +230,7 @@ Partial Class OC_PopUpBuscarReq
e.Row.FCHyperLink("HLDescripcion").Visible = True
e.Row.FCLabel("LbDescripcion").Visible = False
- Dim Link = String.Format("javascript:Ir(""{0}"");", e.Row.DBCampo("CveOrdenCompra"))
+ Dim Link As String = String.Format("javascript:Ir(""{0}"");", e.Row.DBCampo("CveOrdenCompra"))
e.Row.FCHyperLink("HLFolio").NavigateUrl = Link
e.Row.FCHyperLink("HLDescripcion").NavigateUrl = Link
@@ -245,14 +244,11 @@ Partial Class OC_PopUpBuscarReq
If e.Row.DataKey("FolioREQ").ToString.Trim.Length > 0 Then
Dim LbFolio As Label = e.Row.FCLabel("LbFolio")
-
LbFolio.Attributes.Add("data-toggle", "tooltip")
LbFolio.Attributes.Add("data-placement", "top")
LbFolio.Attributes.Add("title", "REQ: " & e.Row.DataKey("FolioREQ").ToString)
End If
-
-
If ViewState("CveProveedor").ToString <> "" And UsuarioActual.CveEmpresa.Contiene(72) Then
GV.Columns(2).Visible = False
End If
@@ -274,6 +270,12 @@ Partial Class OC_PopUpBuscarReq
#End Region
+ Protected Sub DdlProveedoresmultiple_selectedindexchange(sender As Object, e As EventArgs)
+
+ CargarVinculacionCompras()
+
+ End Sub
+
#Region " VINCULA CON COMPRAS "
Protected Sub BtnVincularOC_Click(sender As Object, e As EventArgs)
Dim CveOC As String = ""
@@ -286,6 +288,15 @@ Partial Class OC_PopUpBuscarReq
CveOC &= String.Format(", {0}", GV.Rows(i).DataKey("CveOrdenCompra").ToString)
Folio &= String.Format(", {0}", GV.Rows(i).DataKey("Folio").ToString)
CveEstatus &= String.Format(", {0}", GV.Rows(i).DataKey("CveEstatusSiguiente").ToString)
+
+ 'código para cambiar de proveedor a la oc, para caso 172
+ 'If UsuarioActual.Empresa.Funcionalidad(267) = "1" AndAlso CveProveedorMultiple.ToEntero <> 0 Then
+ ' Dim OC As New ClsOC
+ ' If OC.UpdateProveedorOrdenCompra(CveProveedor.ToEntero, GV.Rows(i).DataKey("CveOrdenCompra").ToString.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+
+ ' End If
+ ' OC.Dispose()
+ 'End If
Else
CveOC = GV.Rows(i).DataKey("CveOrdenCompra").ToString
Folio = GV.Rows(i).DataKey("Folio").ToString
@@ -295,7 +306,7 @@ Partial Class OC_PopUpBuscarReq
Next
If CveOC <> "" AndAlso CveOC.Length > 0 Then
- RegistraScript(String.Format("javascript: Ir3('{0}','{1}','{2}');", CveOC, Folio, CveEstatus))
+ RegistraScript(String.Format("javascript: Ir3('{0}','{1}','{2}','{3}');", CveOC, Folio, CveEstatus, CveProveedor))
Else
Alert("No seleccionó ninguna Orden de Compra, Por lo cual no se puede vincular.", TipoMensaje.MsgAdvertencia)
End If
diff --git a/OC/RepCotizaciones.aspx.vb b/OC/RepCotizaciones.aspx.vb
index 08bda8aa6..390f592a4 100644
--- a/OC/RepCotizaciones.aspx.vb
+++ b/OC/RepCotizaciones.aspx.vb
@@ -255,7 +255,7 @@ Partial Class RepCotizaciones
If CveCotizacion <> Row("CveCotizacion").ToString.ToEntero Then
CveCotizacion = Row("CveCotizacion").ToString.ToEntero
- If objCotizacion.AddOrdenCompra("OC", Row("CveSubProyecto").ToString.ToEntero, Row("Descripcion").ToString, Row("Justificacion").ToString, Prioridad, Now, CveMoneda, CveEstatusInicialOC, Row("FechaEstimadaEntrega").ToString, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Row("CveProveedor").ToString.ToEntero, -1) Then
+ If objCotizacion.AddOrdenCompra("OC", Row("CveSubProyecto").ToString.ToEntero, Row("Descripcion").ToString, Row("Justificacion").ToString, Prioridad, NowADS(), CveMoneda, CveEstatusInicialOC, Row("FechaEstimadaEntrega").ToString, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Row("CveProveedor").ToString.ToEntero, -1) Then
CveOrdenCompra = objCotizacion.CveOrdenCompra
'Ingresar los detalles
diff --git a/OC/RepCotizacionesDetalle.aspx.vb b/OC/RepCotizacionesDetalle.aspx.vb
index 12abc9f9f..29e725848 100644
--- a/OC/RepCotizacionesDetalle.aspx.vb
+++ b/OC/RepCotizacionesDetalle.aspx.vb
@@ -75,7 +75,7 @@ Partial Class PopOCCotizacionesDetalle
EsNuevo = True
CveCotizacion = -1
CargaOCDetalle(CveOrdenCompra)
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
Else
EsNuevo = False
GvDC.DataKeyNames = {"CveOrdenCompra", "CvePS", "Cantidad", "CveUnidadMedida", "CveCotizacionDetalle", "CveOrdenCompraDetalle"}
@@ -310,7 +310,7 @@ Partial Class PopOCCotizacionesDetalle
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCTextBox("TxtPU").Attributes.Add("onchange", String.Format("$get('{0}').value = FormatNumber(parseFloat(this.value) * parseFloat($get('{1}').value), 2, true, true, true);", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.FCTextBox("TxtCant").ClientID))
- e.Row.FCCalendarExtender("CEFechaEntrega").StartDate = Date.Now
+ e.Row.FCCalendarExtender("CEFechaEntrega").StartDate = NowADS()
' e.Row.FCTextBox("TxtPU").Attributes.Add("onchange", String.Format("$get('{0}').value = FormatNumber(parseFloat(this.value) * parseFloat($get('{1}').value), 2, true, true, true);", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.FCTextBox("TxtCant").ClientID))
'Page.ClientScript.RegisterExpandoAttribute(e.Row.FCCustomValidator("CVFechaEntrega").ClientID, "txtCantidadSurtir", e.Row.FCTextBox("txtCantidadSurtir").ClientID, False)
diff --git a/OC/RepImprimir.aspx.vb.exclude b/OC/RepImprimir.aspx.vb.exclude
index 8a5433977..489e77e83 100644
--- a/OC/RepImprimir.aspx.vb.exclude
+++ b/OC/RepImprimir.aspx.vb.exclude
@@ -39,7 +39,7 @@ Partial Class RepImprimir
Dim paramList As New List(Of ReportParameter)
With paramList
' .Add(New ReportParameter("CveOrdenCompra", CveOC.ToString, True))
- ' .Add(New ReportParameter("FechaSolicitud", Now.ToShortDateString, True))
+ ' .Add(New ReportParameter("FechaSolicitud", NowADS().ToShortDateString, True))
.Add(New ReportParameter("pSolicita", Solicita, True))
.Add(New ReportParameter("pSupervisa", Supervisa, True))
.Add(New ReportParameter("pAutoriza", Autoriza, True))
diff --git a/OC/RepImprimirC.aspx.vb.exclude b/OC/RepImprimirC.aspx.vb.exclude
index 394082c50..52049c8a5 100644
--- a/OC/RepImprimirC.aspx.vb.exclude
+++ b/OC/RepImprimirC.aspx.vb.exclude
@@ -58,7 +58,7 @@ Partial Class RepImprimirC
'.Add(New ReportParameter("CveOrdenCompra", CveOC.ToString, True))
- '.Add(New ReportParameter("FechaSolicitud", Now.ToShortDateString, True))
+ '.Add(New ReportParameter("FechaSolicitud", NowADS().ToShortDateString, True))
'.Add(New ReportParameter("pSolicita", Solicita, True))
'.Add(New ReportParameter("pSupervisa", Supervisa, True))
'.Add(New ReportParameter("pAutoriza", Autoriza, True))
diff --git a/OC/RepOC.aspx.vb b/OC/RepOC.aspx.vb
index e0ddce034..359058272 100644
--- a/OC/RepOC.aspx.vb
+++ b/OC/RepOC.aspx.vb
@@ -35,8 +35,8 @@ Partial Class RepOC
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaI.Text = Now.AddMonths(-3).ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().AddMonths(-3).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
DdlTipo.SelectedValue = IfNull(Request("Tipo"), "-1").ToString
@@ -78,8 +78,8 @@ Partial Class RepOC
CargaPendientes()
- txtFechaISemanal.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaFSemanal.Text = Now.ToShortDateString
+ txtFechaISemanal.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaFSemanal.Text = NowADS().ToShortDateString
@@ -513,7 +513,7 @@ Partial Class RepOC
#Region " IMPRESION "
Protected Sub LbPorAtender_Click(sender As Object, e As System.EventArgs) Handles LbPorAtender.Click
- 'GvPorAtender.ExportToExcel("OrdenesCompraPorAtender" & Now.ToShortDateString)
+ 'GvPorAtender.ExportToExcel("OrdenesCompraPorAtender" & NowADS().ToShortDateString)
ImprimePorAtender("Excel")
End Sub
Protected Sub LbPorAtenderPDF_Click(sender As Object, e As System.EventArgs) Handles LbPorAtenderPDF.Click
@@ -564,7 +564,7 @@ Partial Class RepOC
End Sub
Protected Sub LbPendientes_Click(sender As Object, e As System.EventArgs) Handles LbPendientes.Click
- 'GvPendientes.ExportToExcel("OrdenesCompraPendientes" & Now.ToShortDateString)
+ 'GvPendientes.ExportToExcel("OrdenesCompraPendientes" & NowADS().ToShortDateString)
ImprimirPendientes("EXCEL")
End Sub
Protected Sub LbPendientesPDF_Click(sender As Object, e As System.EventArgs) Handles LbPendientesPDF.Click
@@ -578,12 +578,12 @@ Partial Class RepOC
params.Add(New ReportParameter("FechaInicio", If(txtFechaI.Text = "", "-1", txtFechaI.Text)))
params.Add(New ReportParameter("FechaFin", If(txtFechaF.Text = "", "-1", txtFechaF.Text)))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToShortDateString))
params.Add(New ReportParameter("SubProyecto", LblSubProyecto.Text))
ImprimirPDF(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/RepRequisicionesOC.rdlc", UsuarioActual.Empresa.Ruta), DtPendiente, params, Formato:=format)
Else
- GvConsultar.ExportToExcel("OrdenesCompra" & Now.ToShortDateString)
+ GvConsultar.ExportToExcel("OrdenesCompra" & NowADS().ToShortDateString)
End If
End Sub
Protected Sub LbConsultar_Click(sender As Object, e As System.EventArgs) Handles LbConsultar.Click
@@ -593,12 +593,12 @@ Partial Class RepOC
params.Add(New ReportParameter("FechaInicio", If(txtFechaI.Text = "", "-1", txtFechaI.Text)))
params.Add(New ReportParameter("FechaFin", If(txtFechaF.Text = "", "-1", txtFechaF.Text)))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToShortDateString))
params.Add(New ReportParameter("SubProyecto", LblSubProyecto.Text))
ImprimirPDF(String.Format(UsuarioActual.Empresa.Ruta & "/Formatos/RepRequisicionesOC.rdlc", UsuarioActual.Empresa.Ruta), DtOC, params, Formato:="EXCEL")
Else
- GvConsultar.ExportToExcel("OrdenesCompra" & Now.ToShortDateString)
+ GvConsultar.ExportToExcel("OrdenesCompra" & NowADS().ToShortDateString)
End If
End Sub
Private Sub Tab_ActiveTabChanged(sender As Object, e As EventArgs) Handles Tab.ActiveTabChanged
diff --git a/OC/RepOCAnticiposPtes.aspx.cs b/OC/RepOCAnticiposPtes.aspx.cs
index 2be1ed724..ff65fb881 100644
--- a/OC/RepOCAnticiposPtes.aspx.cs
+++ b/OC/RepOCAnticiposPtes.aspx.cs
@@ -24,8 +24,8 @@ public partial class OC_RepOCAnticiposPtes : ClsPaginas
DdlProveedores.DataBind();
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().AddMonths(-1).ToShortDateString();
- txtFechaF.Text = DateTime.Now.ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().AddMonths(-1).ToShortDateString();
+ txtFechaF.Text = NowADS().ToShortDateString();
}
protected void BtnConsultar_Click(object sender, EventArgs e)
diff --git a/OC/RepOCGuias.aspx.vb b/OC/RepOCGuias.aspx.vb
index 4e89ddf94..942d8e6c2 100644
--- a/OC/RepOCGuias.aspx.vb
+++ b/OC/RepOCGuias.aspx.vb
@@ -34,8 +34,8 @@ Partial Class OC_RepOCGuias
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
- txtFechaI.Text = Now.AddDays(-10).ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().AddDays(-10).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
Select Case UsuarioActual.Empresa.Tipo_CentroCosto
Case 1
@@ -139,10 +139,10 @@ Partial Class OC_RepOCGuias
'params.Add(New ReportParameter("FechaInicio", FechaI))
'params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas\Grales\Formatos\RepOCGuias.rdlc", DTDatos, params, $"RepOCGuias_{Now.ToString("yyyyMMddmmss")}", Formato:=Formato)
+ ImprimirPDF("Empresas\Grales\Formatos\RepOCGuias.rdlc", DTDatos, params, $"RepOCGuias_{NowADS().ToString("yyyyMMddmmss")}", Formato:=Formato)
End Sub
#End Region
diff --git a/OC/RepOCxSurtir.aspx.vb b/OC/RepOCxSurtir.aspx.vb
index aaf8c50a8..468e54d2a 100644
--- a/OC/RepOCxSurtir.aspx.vb
+++ b/OC/RepOCxSurtir.aspx.vb
@@ -15,8 +15,8 @@ Partial Class OC_RepOCxSurtir
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
- TxtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- TxtFechaF.Text = Now.ToShortDateString
+ TxtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ TxtFechaF.Text = NowADS().ToShortDateString
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlProveedor.DataBind()
diff --git a/OC/RepReqXOC.aspx.vb b/OC/RepReqXOC.aspx.vb
index 3f76d8e00..f8dbdf34c 100644
--- a/OC/RepReqXOC.aspx.vb
+++ b/OC/RepReqXOC.aspx.vb
@@ -24,8 +24,8 @@ Partial Class RepReqXOC
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaI.Text = Now.AddDays(-10).ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().AddDays(-10).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargaProveedores()
@@ -138,10 +138,10 @@ Partial Class RepReqXOC
'params.Add(New ReportParameter("FechaInicio", FechaI))
'params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas\Grales\Formatos\RepReqXOC.rdlc", DTDatos, params, $"RepReqXOC_{Now.ToString("yyyyMMddmmss")}", Formato:=Formato)
+ ImprimirPDF("Empresas\Grales\Formatos\RepReqXOC.rdlc", DTDatos, params, $"RepReqXOC_{NowADS().ToString("yyyyMMddmmss")}", Formato:=Formato)
End Sub
diff --git a/OC/RepRequisiciones.aspx.vb b/OC/RepRequisiciones.aspx.vb
index 7db46c460..a7215683e 100644
--- a/OC/RepRequisiciones.aspx.vb
+++ b/OC/RepRequisiciones.aspx.vb
@@ -32,7 +32,7 @@ Partial Class OC_RepRequisiciones
DtUsuarioProyectos = objEstatusUsuarios.DtResultados
End If
objEstatusUsuarios.Dispose()
- txtFechaI.Text = Now.AddMonths(-1).FirstDayOfMonth.ToShortDateString
+ txtFechaI.Text = NowADS().AddMonths(-1).FirstDayOfMonth.ToShortDateString
DdlProyecto.DataSource = DtUsuarioProyectos.FiltraParametros("", "", {"CveProyecto", "Proyecto"}) ' GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa)
DdlProyecto.DataBind()
@@ -145,7 +145,7 @@ Partial Class OC_RepRequisiciones
End Sub
'Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
- ' GVDatos.ExportToExcel("ReporteRequisiciones" & Now.ToShortDateString)
+ ' GVDatos.ExportToExcel("ReporteRequisiciones" & NowADS().ToShortDateString)
'End Sub
@@ -161,7 +161,7 @@ Partial Class OC_RepRequisiciones
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Proyecto", DdlProyecto.SelectedItem.Text))
params.Add(New ReportParameter("SubProyecto", DdlSubProyecto.SelectedItem.Text))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
diff --git a/OC/RepSolicitudesAnticipo.aspx.cs b/OC/RepSolicitudesAnticipo.aspx.cs
index ec535ef27..e294c04ea 100644
--- a/OC/RepSolicitudesAnticipo.aspx.cs
+++ b/OC/RepSolicitudesAnticipo.aspx.cs
@@ -74,8 +74,8 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
protected void InicializaDatos()
{
- txtFechaI.Text = DateTime.Now.AddMonths(-1).FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.ToShortDateString();
+ txtFechaI.Text = NowADS().AddMonths(-1).FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().ToShortDateString();
CveProveedor = -1;
CargaSubProyectos();
CargaProveedor();
@@ -120,7 +120,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
CveProveedor = DdlProveedores.SelectedValue.ToEntero();
FechaI = (txtFechaI.Text.ToString() != "" ? txtFechaI.Text.ToDateTime() : MinFecha);
- FechaF = (txtFechaF.Text.ToString() != "" ? txtFechaF.Text.ToDateTime() : DateTime.Now);
+ FechaF = (txtFechaF.Text.ToString() != "" ? txtFechaF.Text.ToDateTime() : NowADS());
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero(),DdlUsuarios.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero()))
{
diff --git a/OI/Circular.aspx.vb b/OI/Circular.aspx.vb
index 8a4b73290..212b71247 100644
--- a/OI/Circular.aspx.vb
+++ b/OI/Circular.aspx.vb
@@ -55,7 +55,7 @@ Partial Class OI_Circular
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
- params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Filtros", String.Format("Fecha Inicial: {0} Fecha Final: {1}", TxtFechaI.Text, TxtFechaF.Text)))
ImprimirPDF("Empresas/Grales/Formatos/Circulares.rdlc", DtDatos, params, "Circulares", "PDF", RDSName:="DataSet1")
diff --git a/OI/ConvocatoriaDetalle.aspx.cs b/OI/ConvocatoriaDetalle.aspx.cs
index ad9daff9b..29e1621d9 100644
--- a/OI/ConvocatoriaDetalle.aspx.cs
+++ b/OI/ConvocatoriaDetalle.aspx.cs
@@ -782,7 +782,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
strICS.AppendLine(string.Format("DTEND:{0}", DTEND));
strICS.AppendLine(string.Format("LOCATION:{0}", Ubicacion));
strICS.AppendLine(string.Format("UID:{0}", uuid));
- strICS.AppendLine(string.Format("DTSTAMP:{0}", DateTime.Now.ToUniversalTime().ToString("yyyyMMddTHHmmssZ")));
+ strICS.AppendLine(string.Format("DTSTAMP:{0}", NowADS().ToUniversalTime().ToString("yyyyMMddTHHmmssZ")));
strICS.AppendLine(string.Format("SUMMARY:{0}", Asunto));
strICS.AppendLine(string.Format("DESCRIPTION:{0}", descripcion));
strICS.AppendLine("PRIORITY:5");
diff --git a/OI/Desarrollo.aspx.vb b/OI/Desarrollo.aspx.vb
index 2fdfd72b8..556315751 100644
--- a/OI/Desarrollo.aspx.vb
+++ b/OI/Desarrollo.aspx.vb
@@ -392,7 +392,7 @@ Partial Class OI_Desarrollo
Else
Dim _CveEstadoTemp As Integer = -1
If DdlUsuarioDes.SelectedValue.ToEntero <> CveUsuarioAsignado Then
- FechaAsiganacion = Now
+ FechaAsiganacion = NowADS()
_CveEstadoTemp = 2
End If
diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs
index c24e28bda..f5a013961 100644
--- a/OI/DocumentoDetalle.aspx.cs
+++ b/OI/DocumentoDetalle.aspx.cs
@@ -779,7 +779,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
ClsOIEventos ObjOI = new ClsOIEventos();
if (Autorizar)
{
- if (ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, -1, "-1", "-1", DateTime.Now))
+ if (ObjOI.UpdateDocumentoAutorizacion(CveAutorizacion, -1, "-1", "-1", NowADS()))
{
Alert("Haz aprobado la versión actual del Documento");
}
@@ -817,7 +817,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
{
ClsOIEventos ObjOI = new ClsOIEventos();
if (ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 2, "-1", TxtResponsable.Text,
- DateTime.Now, -1, -1, UsuarioActual.CveEmpresa))
+ NowADS(), -1, -1, UsuarioActual.CveEmpresa))
{
Alert("Documento publicado");
}
@@ -852,7 +852,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas
{
ClsOIEventos ObjOI = new ClsOIEventos();
if (ObjOI.UpdateDocumento(this.CveDocumento, DdlSubCategoria.SelectedValue.ToEntero(), TxtDescripcion.Text, TxtObs.InnerText, TxtVersion.Text, 3, "-1", TxtResponsable.Text,
- DateTime.Now, -1, -1, UsuarioActual.CveEmpresa))
+ NowADS(), -1, -1, UsuarioActual.CveEmpresa))
{
Alert("Documento cancelado");
}
diff --git a/OI/EventoDetalle.aspx.vb b/OI/EventoDetalle.aspx.vb
index dd5c8cade..a3da3521b 100644
--- a/OI/EventoDetalle.aspx.vb
+++ b/OI/EventoDetalle.aspx.vb
@@ -369,11 +369,11 @@ Partial Class OI_EventoDetalle
CveEvento = -1
CveEventoPadre = -1
ArchivoReenvio = "-1"
- TxtFechaInicio.Text = DateTime.Now.ToShortDateString
- TxtFechaFin.Text = DateTime.Now.ToShortDateString
+ TxtFechaInicio.Text = NowADS().ToShortDateString
+ TxtFechaFin.Text = NowADS().ToShortDateString
Dim am_pm As MKB.TimePicker.TimeSelector.AmPmSpec
- Dim hora As DateTime = Now.AddMinutes(15)
+ Dim hora As DateTime = NowADS().AddMinutes(15)
If hora.ToString("tt") = "AM" Then am_pm = MKB.TimePicker.TimeSelector.AmPmSpec.AM Else am_pm = MKB.TimePicker.TimeSelector.AmPmSpec.PM
TxtHoraFin.SetTime(hora.Hour, hora.Minute, am_pm)
Nuevo = True
@@ -841,7 +841,7 @@ Partial Class OI_EventoDetalle
lbCambiaEstatus.Visible = True
End If
- lblFechaObs.Text = Now.ToString("dd/MM/yyyy")
+ lblFechaObs.Text = NowADS().ToString("dd/MM/yyyy")
lblUsuarioObs.Text = UsuarioActual.Nombre
If .GetEventosComentarios(CveEvento) Then
DTComentarios = ObjEventos.DtResultados
@@ -1121,7 +1121,7 @@ Partial Class OI_EventoDetalle
UsuarioDe = UsuarioActual.Nombre
Prioridad = DdlPrioridad.SelectedValue.ToEntero
CveRevision = DdlRevision.SelectedValue.ToEntero
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
'CveUsuarioPara = DdlUsuarioPara.SelectedValue.ToEntero
'UsuarioPara = DdlUsuarioPara.SelectedItem.Text
@@ -1533,7 +1533,7 @@ Partial Class OI_EventoDetalle
' End If
'End If
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
Alert("La observación se guardó correctamente.", TipoMensaje.MsgInformacion)
TxtOBs.Text = ""
'registrascript la imagen
@@ -1648,7 +1648,7 @@ Partial Class OI_EventoDetalle
If CorreosCCP IsNot Nothing AndAlso CorreosCCP.Count > 1 Then
Dim ArrCCP As String() = CorreosCCP.ToArray
If ArrCCP.Length > 0 Then
- 'Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, Now.ToString(), StrPrioridad, Descripcion, "", 1)
+ 'Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, NowADS().ToString(), StrPrioridad, Descripcion, "", 1)
For i As Integer = 0 To ArrCCP.Length - 1
If ArrCCP(i) <> "" Then
'Mail.Mandacorreo(UsuarioActual.Empresa, , ArrCCP(i), " " & UsuarioActual.Nombre & " le asignó una tarea a " & UsuarioPara & " en SIG.", SB.ToString)
diff --git a/OI/EventoDetalle1.aspx.vb.exclude b/OI/EventoDetalle1.aspx.vb.exclude
index 9d19d5889..463d0a631 100644
--- a/OI/EventoDetalle1.aspx.vb.exclude
+++ b/OI/EventoDetalle1.aspx.vb.exclude
@@ -260,8 +260,8 @@ Partial Class OI_EventoDetalle1
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CveEvento = -1
- TxtFechaInicio.Text = DateTime.Now.ToShortDateString
- TxtFechaFin.Text = DateTime.Now.ToShortDateString
+ TxtFechaInicio.Text = NowADS().ToShortDateString
+ TxtFechaFin.Text = NowADS().ToShortDateString
Nuevo = True
CveUsuarioDe = -1
CveUsuarioPara = -1
@@ -653,7 +653,7 @@ Partial Class OI_EventoDetalle1
UsuarioDe = UsuarioActual.Nombre
Prioridad = DdlPrioridad.SelectedValue.ToEntero
CveRevision = DdlRevision.SelectedValue.ToEntero
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
'CveUsuarioPara = DdlUsuarioPara.SelectedValue.ToEntero
'UsuarioPara = DdlUsuarioPara.SelectedItem.Text
@@ -848,7 +848,7 @@ Partial Class OI_EventoDetalle1
End If
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
Alert("La observación se guardó correctamente.", TipoMensaje.MsgInformacion)
TxtOBs.Text = ""
'registrascript la imagen
@@ -914,7 +914,7 @@ Partial Class OI_EventoDetalle1
If CorreosCCP.Length > 1 Then
Dim ArrCCP As String() = CorreosCCP.Split(";"c)
If ArrCCP.Length > 0 Then
- Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, Now.ToString(), StrPrioridad, Descripcion, "", 1)
+ Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, NowADS().ToString(), StrPrioridad, Descripcion, "", 1)
For i As Integer = 0 To ArrCCP.Length - 1
If ArrCCP(i) <> "" Then
' Mail.Mandacorreo(UsuarioActual.Empresa,, ArrCCP(i), " " & UsuarioActual.Nombre & " le asignó una tarea a " & UsuarioPara & " en SIG.", SB.ToString)
diff --git a/OI/MinutaDetalle.aspx.cs b/OI/MinutaDetalle.aspx.cs
index 331241f74..f5febfad4 100644
--- a/OI/MinutaDetalle.aspx.cs
+++ b/OI/MinutaDetalle.aspx.cs
@@ -369,7 +369,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
using (ClsOIEventos oieve = new ClsOIEventos())
{
oieve.IniciaTransacSQL();
- Continuar = oieve.AddEventoMinuta2(asunto, descripcion, acuerdos, cveusuarioDe, cveusuarioPara, DateTime.Now, archivoname, lMiembros, chkList, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtCorreoExterno.Text);
+ Continuar = oieve.AddEventoMinuta2(asunto, descripcion, acuerdos, cveusuarioDe, cveusuarioPara, NowADS(), archivoname, lMiembros, chkList, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtCorreoExterno.Text);
CveEvento = oieve.CveEvento;
Folio = oieve.Folio;
@@ -1397,7 +1397,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
strICS.AppendFormat("DTEND:{0}", DTEND);
strICS.AppendFormat("LOCATION:{0}", Ubicacion);
strICS.AppendFormat("UID:{0}", uuid);
- strICS.AppendFormat("DTSTAMP:{0}", DateTime.Now.ToUniversalTime().ToString("yyyyMMddTHHmmssZ"));
+ strICS.AppendFormat("DTSTAMP:{0}", NowADS().ToUniversalTime().ToString("yyyyMMddTHHmmssZ"));
strICS.AppendFormat("SUMMARY:{0}", Asunto);
strICS.AppendFormat("DESCRIPTION:{0}", descripcion);
strICS.Append("PRIORITY:5");
diff --git a/OI/Minutas.aspx.vb b/OI/Minutas.aspx.vb
index c4f6b17e8..4d442258d 100644
--- a/OI/Minutas.aspx.vb
+++ b/OI/Minutas.aspx.vb
@@ -325,7 +325,7 @@ Partial Class OI_Minutas
Dim RutaArchivo As String = String.Format("{0}\OI\Temp\{1}", UsuarioActual.Empresa.Ruta, Session("Eventos"))
If CveEvento = -1 Then
- If ObjEventos.AddEventoMinuta(Asunto, Descripcion, Acuerdos, -1, -1, Now, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ If ObjEventos.AddEventoMinuta(Asunto, Descripcion, Acuerdos, -1, -1, NowADS(), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ViewState("CveEvento") = ObjEventos.CveEvento
For Each RowCCP As GridViewRow In GVUsuarios.Rows
diff --git a/OI/PopUpAgenda.aspx.vb b/OI/PopUpAgenda.aspx.vb
index 0b5f58b89..44e371eb3 100644
--- a/OI/PopUpAgenda.aspx.vb
+++ b/OI/PopUpAgenda.aspx.vb
@@ -266,8 +266,8 @@ Partial Class OI_PopUpAgenda
CType(Me.Master, BaseMasterPage).PopupWidth = 915
CveEvento = -1
- TxtFechaInicio.Text = DateTime.Now.ToShortDateString
- TxtFechaFin.Text = DateTime.Now.ToShortDateString
+ TxtFechaInicio.Text = NowADS().ToShortDateString
+ TxtFechaFin.Text = NowADS().ToShortDateString
Nuevo = True
CveUsuarioDe = -1
CveUsuarioPara = -1
@@ -730,7 +730,7 @@ Partial Class OI_PopUpAgenda
UsuarioDe = UsuarioActual.Nombre
Prioridad = DdlPrioridad.SelectedValue.ToEntero
CveRevision = DdlRevision.SelectedValue.ToEntero
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
Dim dru As DataRow = GlobalDTUsuarios(CveUsuarioPara).FiltroPrimero("")
If dru IsNot Nothing Then CorreoPara = dru("Correo").ToString
@@ -920,7 +920,7 @@ Partial Class OI_PopUpAgenda
End If
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
Alert("La observación se guardó correctamente.", TipoMensaje.MsgInformacion)
TxtOBs.Text = ""
'registrascript la imagen
@@ -982,7 +982,7 @@ Partial Class OI_PopUpAgenda
'If CorreosCCP.Length > 1 Then
' Dim ArrCCP As String() = CorreosCCP.Split(";"c)
' If ArrCCP.Length > 0 Then
- ' Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, Now.ToString(), StrPrioridad, Descripcion, "", 1)
+ ' Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, NowADS().ToString(), StrPrioridad, Descripcion, "", 1)
' For i As Integer = 0 To ArrCCP.Length - 1
' If ArrCCP(i) <> "" Then
' ' Mail.Mandacorreo(UsuarioActual.Empresa,, ArrCCP(i), " " & UsuarioActual.Nombre & " le asignó una tarea a " & UsuarioPara & " en SIG.", SB.ToString)
diff --git a/OI/RepDesarrollo.aspx.vb b/OI/RepDesarrollo.aspx.vb
index ed19e11a3..ad2083768 100644
--- a/OI/RepDesarrollo.aspx.vb
+++ b/OI/RepDesarrollo.aspx.vb
@@ -7,8 +7,8 @@ Partial Class OI_RepDesarrollo
Private Sub OI_RepDesarrollo_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- TxtFechaFin.Text = Now.ToString("dd/MM/yyyy")
- TxtFechaI.Text = Now.AddDays(-30).ToString("dd/MM/yyyy")
+ TxtFechaFin.Text = NowADS().ToString("dd/MM/yyyy")
+ TxtFechaI.Text = NowADS().AddDays(-30).ToString("dd/MM/yyyy")
CargaCombos()
CargaDatos()
diff --git a/OI/RepMinutas.aspx.vb b/OI/RepMinutas.aspx.vb
index c63326e75..21f0648fe 100644
--- a/OI/RepMinutas.aspx.vb
+++ b/OI/RepMinutas.aspx.vb
@@ -18,8 +18,8 @@ Partial Class OI_RepMinutas
End Sub
Private Sub CargaFiltros()
- txtFechaI.Text = New Date(Now.Year, Now.Month, 1).ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = New Date(NowADS().Year, NowADS().Month, 1).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
End Sub
Public Sub CargaDatosOIMinutas()
Dim ObjProspectos As New ClsOIEventos
diff --git a/OI/RepReuniones.aspx.cs b/OI/RepReuniones.aspx.cs
index 416170f12..95aa77f24 100644
--- a/OI/RepReuniones.aspx.cs
+++ b/OI/RepReuniones.aspx.cs
@@ -29,8 +29,8 @@ public partial class OI_RepReuniones : ClsPaginas
private void CargaFiltros()
{
- TxtFechaI.Text = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToShortDateString();
- TxtFechaF.Text = DateTime.Now.ToShortDateString();
+ TxtFechaI.Text = new DateTime(NowADS().Year, NowADS().Month, 1).ToShortDateString();
+ TxtFechaF.Text = NowADS().ToShortDateString();
TxtCFechaInicio.Text = TxtFechaI.Text;
TxtCFechaFin.Text = TxtFechaF.Text;
}
diff --git a/OI/RepSoporteADS.aspx.vb b/OI/RepSoporteADS.aspx.vb
index 5b2b738e3..3fa1aaf16 100644
--- a/OI/RepSoporteADS.aspx.vb
+++ b/OI/RepSoporteADS.aspx.vb
@@ -67,8 +67,8 @@ Partial Class OI_RepSoporteADS
End Sub
Private Sub CargaFiltros()
- txtFechaI.Text = New Date(Now.Year, Now.Month, 1).ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = New Date(NowADS().Year, NowADS().Month, 1).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargarEventoEstatus()
CargaRevisiones()
CargaUsuarios()
@@ -179,21 +179,21 @@ Partial Class OI_RepSoporteADS
TipoReporte = 1
CargaDatos()
TipoReporte = -1
- LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("H:mm:ss - dd MMMM"))
+ LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm:ss - dd MMMM"))
UPFiltros.Update()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
TipoReporte = -1
CargaDatos()
TipoReporte = -1
- LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("H:mm:ss - dd MMMM"))
+ LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm:ss - dd MMMM"))
UPFiltros.Update()
End Sub
Protected Sub BtnEscritorio_Click(sender As Object, e As EventArgs) Handles BtnEscritorio.Click
TipoReporte = 1
CargaDatos()
TipoReporte = -1
- LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("H:mm:ss - dd MMMM"))
+ LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm:ss - dd MMMM"))
UPFiltros.Update()
End Sub
Private Sub CargaDatos()
@@ -232,7 +232,7 @@ Partial Class OI_RepSoporteADS
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
diff --git a/OI/RepTareas.aspx.vb b/OI/RepTareas.aspx.vb
index 480b77172..3db949f8b 100644
--- a/OI/RepTareas.aspx.vb
+++ b/OI/RepTareas.aspx.vb
@@ -70,8 +70,8 @@ Partial Class OI_RepTareas
End Sub
Private Sub CargaFiltros()
- txtFechaI.Text = New Date(Now.Year, Now.Month, 1).ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = New Date(NowADS().Year, NowADS().Month, 1).ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargarEventoEstatus()
CargaRevisiones()
End Sub
@@ -303,21 +303,21 @@ Partial Class OI_RepTareas
TipoReporte = 1
CargaDatos()
TipoReporte = -1
- 'LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("H:mm:ss - dd MMMM"))
+ 'LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm:ss - dd MMMM"))
UPFiltros.Update()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
TipoReporte = -1
CargaDatos()
TipoReporte = -1
- 'LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("H:mm:ss - dd MMMM"))
+ 'LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm:ss - dd MMMM"))
UPFiltros.Update()
End Sub
Protected Sub BtnEscritorio_Click(sender As Object, e As EventArgs) Handles BtnEscritorio.Click
TipoReporte = 1
CargaDatos()
TipoReporte = -1
- 'LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("H:mm:ss - dd MMMM"))
+ 'LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("H:mm:ss - dd MMMM"))
UPFiltros.Update()
End Sub
Private Sub CargaDatos()
@@ -409,13 +409,13 @@ Partial Class OI_RepTareas
SbFiltros.Append($" Tema: {DdlRevision.SelectedItem.Text}")
If Tab.ActiveTabIndex = 0 Then 'TabPanelAsignaron
- GvDatosOIEventosTareasAsignaron.ExportToExcelGembox($"ReporteTareasMeAsignaron{Now.ToString("yyyyMMddhhss")}", UsuarioActual, "Reporte Tareas Me Asignaron", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
+ GvDatosOIEventosTareasAsignaron.ExportToExcelGembox($"ReporteTareasMeAsignaron{NowADS().ToString("yyyyMMddhhss")}", UsuarioActual, "Reporte Tareas Me Asignaron", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
ElseIf Tab.ActiveTabIndex = 1 Then 'TabPanelCCP
- GvDatosOIEventosTareasCCP.ExportToExcelGembox($"ReporteTareasCPP{Now.ToString("yyyyMMddhhss")}", UsuarioActual, "Reporte Tareas CPP", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
+ GvDatosOIEventosTareasCCP.ExportToExcelGembox($"ReporteTareasCPP{NowADS().ToString("yyyyMMddhhss")}", UsuarioActual, "Reporte Tareas CPP", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
ElseIf Tab.ActiveTabIndex = 2 Then 'TabPanelAsigne
- GvDatosOIEventosTareasAsigne.ExportToExcelGembox($"ReporteTareasQueAsigne{Now.ToString("yyyyMMddhhss")}", UsuarioActual, "Reporte Tareas Asigne", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
+ GvDatosOIEventosTareasAsigne.ExportToExcelGembox($"ReporteTareasQueAsigne{NowADS().ToString("yyyyMMddhhss")}", UsuarioActual, "Reporte Tareas Asigne", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
End If
End Sub
diff --git a/OI/SoporteADS.aspx.vb b/OI/SoporteADS.aspx.vb
index ac36935d4..8521a99d2 100644
--- a/OI/SoporteADS.aspx.vb
+++ b/OI/SoporteADS.aspx.vb
@@ -567,12 +567,12 @@ Partial Class OI_SoporteADS
CveEvento = -1
CveEventoPadre = -1
ArchivoReenvio = "-1"
- TxtFechaInicio.Text = DateTime.Now.ToShortDateString
- TxtFechaFin.Text = DateTime.Now.ToShortDateString
+ TxtFechaInicio.Text = NowADS().ToShortDateString
+ TxtFechaFin.Text = NowADS().ToShortDateString
Dim am_pm As MKB.TimePicker.TimeSelector.AmPmSpec
- Dim hora As DateTime = Now.AddMinutes(15)
+ Dim hora As DateTime = NowADS().AddMinutes(15)
If hora.ToString("tt") = "AM" Then am_pm = MKB.TimePicker.TimeSelector.AmPmSpec.AM Else am_pm = MKB.TimePicker.TimeSelector.AmPmSpec.PM
TxtHoraFin.SetTime(hora.Hour, hora.Minute, am_pm)
Nuevo = True
@@ -1019,7 +1019,7 @@ Partial Class OI_SoporteADS
- lblFechaObs.Text = Now.ToString("dd/MM/yyyy")
+ lblFechaObs.Text = NowADS().ToString("dd/MM/yyyy")
lblUsuarioObs.Text = UsuarioActual.Nombre
If .GetEventosComentarios(CveEvento) Then
DTComentarios = ObjEventos.DtResultados
@@ -1326,7 +1326,7 @@ Partial Class OI_SoporteADS
UsuarioDe = UsuarioActual.Nombre
Prioridad = DdlPrioridad.SelectedValue.ToEntero
CveRevision = DdlRevision.SelectedValue.ToEntero
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
'CveUsuarioPara = DdlUsuarioPara.SelectedValue.ToEntero
'UsuarioPara = DdlUsuarioPara.SelectedItem.Text
@@ -1610,7 +1610,7 @@ Partial Class OI_SoporteADS
' End If
'End If
- Fecha = Now.ToLongDateString
+ Fecha = NowADS().ToLongDateString
Alert("La observación se guardó correctamente.", TipoMensaje.MsgInformacion)
TxtOBs.Text = ""
'registrascript la imagen
@@ -1725,7 +1725,7 @@ Partial Class OI_SoporteADS
' If CorreosCCP IsNot Nothing AndAlso CorreosCCP.Count > 1 Then
' Dim ArrCCP As String() = CorreosCCP.ToArray
' If ArrCCP.Length > 0 Then
- ' 'Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, Now.ToString(), StrPrioridad, Descripcion, "", 1)
+ ' 'Dim SB As StringBuilder = GeneraContenido(CveEvento, Titulo, UsuarioActual.Nombre, UsuarioPara, UsuariosCCP, NowADS().ToString(), StrPrioridad, Descripcion, "", 1)
' For i As Integer = 0 To ArrCCP.Length - 1
' If ArrCCP(i) <> "" Then
' 'Mail.Mandacorreo(UsuarioActual.Empresa, , ArrCCP(i), " " & UsuarioActual.Nombre & " le asignó una tarea a " & UsuarioPara & " en SIG.", SB.ToString)
diff --git a/OI/SubidasADS.aspx b/OI/SubidasADS.aspx
index 7f15ce8d9..c20d3a659 100644
--- a/OI/SubidasADS.aspx
+++ b/OI/SubidasADS.aspx
@@ -243,7 +243,7 @@
} else {
CopiaExitosa = true;
- //console.log("The text is now on the clipboard");
+ //console.log("The text is NowADS() on the clipboard");
correctoCopiado();
}
} catch (err) {
@@ -259,7 +259,7 @@
errorCopiado();
} else {
CopiaExitosa = true;
- console.log("The text is now on the clipboard");
+ console.log("The text is NowADS() on the clipboard");
correctoCopiado();
}
} catch (err) {
diff --git a/OI/SubidasADS.aspx.vb b/OI/SubidasADS.aspx.vb
index 4dc87ec3f..8772b8e8f 100644
--- a/OI/SubidasADS.aspx.vb
+++ b/OI/SubidasADS.aspx.vb
@@ -28,8 +28,8 @@ Partial Class OI_SubidasADS
If Not Page.IsPostBack Then
- TxtFechaI.Text = Now.AddDays(-30).ToString("dd/MM/yyyy")
- TxtFechaFin.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaI.Text = NowADS().AddDays(-30).ToString("dd/MM/yyyy")
+ TxtFechaFin.Text = NowADS().ToString("dd/MM/yyyy")
If UsuarioActual.CveRol = 1 Then
CargaDatosSubidasPendientes()
diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs
index a16b711b7..d84c993aa 100644
--- a/OI/TareaDetalle.aspx.cs
+++ b/OI/TareaDetalle.aspx.cs
@@ -2057,7 +2057,7 @@ public partial class OI_TareaDetalle : ClsPaginas
//using ( ClsAF ObjAF = new ClsAF())
//{
- // if (ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", DateTime.Now.Year, -1, -1,-1,-1, "-1",-1))
+ // if (ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", NowADS().Year, -1, -1,-1,-1, "-1",-1))
// {
// GvActividades.DataSource = ObjAF.DtResultados;
// GvActividades.DataBind();
diff --git a/OI/UnoaUno.aspx.cs b/OI/UnoaUno.aspx.cs
index 29400b6f7..689e50025 100644
--- a/OI/UnoaUno.aspx.cs
+++ b/OI/UnoaUno.aspx.cs
@@ -33,7 +33,7 @@ public partial class OI_UnoaUno : ClsPaginas
{
if (!IsPostBack)
{
- TxtCFecha.Text = DateTime.Now.ToString("dd/MM/yyyy");
+ TxtCFecha.Text = NowADS().ToString("dd/MM/yyyy");
LtlusuarioTitulo.Text = UsuarioActual.Nombre;
@@ -74,7 +74,7 @@ public partial class OI_UnoaUno : ClsPaginas
ObjPA_O.Dispose();
}
GVPA_OI_UnoAUnoTableroGet.DataBind();
- if (GVPA_OI_UnoAUnoTableroGet.Rows.Count > 0 && TxtCFecha.Text.ToDate().ToString("yyyy/MM/dd") == DateTime.Now.ToString("yyyy/MM/dd"))
+ if (GVPA_OI_UnoAUnoTableroGet.Rows.Count > 0 && TxtCFecha.Text.ToDate().ToString("yyyy/MM/dd") == NowADS().ToString("yyyy/MM/dd"))
{
LnkGuardar.Visible = true;
}
diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb
index 358ff51b9..4044f2a1d 100644
--- a/OS/Asignaciones.aspx.vb
+++ b/OS/Asignaciones.aspx.vb
@@ -374,7 +374,7 @@ Partial Class OS_Asignaciones
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
@@ -465,7 +465,7 @@ Partial Class OS_Asignaciones
e.Row.FCCheckBox("ChbxAsignar").Checked = False
e.Row.FCCheckBox("ChbxAsignar").Visible = True
e.Row.FCTextBox("FechaOS").Visible = True
- e.Row.FCTextBox("FechaOS").Text = Now.ToString("dd/MM/yyy")
+ e.Row.FCTextBox("FechaOS").Text = NowADS().ToString("dd/MM/yyy")
e.Row.FCLinkButton("imgCalendario").Visible = True
e.Row.FCLiteral("LtlHoraServicio").Visible = False
e.Row.FindControl("TimeSelector").Visible = True
@@ -487,7 +487,7 @@ Partial Class OS_Asignaciones
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("FechaInicio", txtFechaI.Text))
params.Add(New ReportParameter("FechaFin", txtFechaF.Text))
diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb
index d7509a1d8..c4fb7da51 100644
--- a/OS/OrdenesServicios.aspx.vb
+++ b/OS/OrdenesServicios.aspx.vb
@@ -347,7 +347,7 @@ Partial Class OS_OrdenesServicios
DivSeFactura.Visible = True
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Orden de Servicio"
- TxtFecha.Text = Now.ToString("dd/MM/yyy")
+ TxtFecha.Text = NowADS().ToString("dd/MM/yyy")
If UsuarioActual.TienePermisoProceso(198) Then
ChkSeFacturara.Visible = True
@@ -358,7 +358,7 @@ Partial Class OS_OrdenesServicios
End If
Else
DivSeFactura.Visible = False
- TxtFechaRecibido.Text = Now.ToString("dd/MM/yyy")
+ TxtFechaRecibido.Text = NowADS().ToString("dd/MM/yyy")
ViewState("CveOS") = -1
DdlEstatusOS.Enabled = False
CargaEstatusOS()
@@ -1173,7 +1173,7 @@ Partial Class OS_OrdenesServicios
' Dim objEventos As New ClsOIEventos(ObjOrdenServicio.IniciaTransacSQL)
- ' If Not objEventos.FinalizaEvento(Now, 3, "", -1, CveOS) Then
+ ' If Not objEventos.FinalizaEvento(NowADS(), 3, "", -1, CveOS) Then
' Errores = True
' End If
@@ -1230,7 +1230,7 @@ Partial Class OS_OrdenesServicios
Dim CveUsuarioEntrego As Integer = If(Entregar = True, UsuarioActual.CveUsuario, -1)
- Dim FechaEntrega As String = If(Entregar = True, Now.ToString("dd/MM/yyy"), "-1")
+ Dim FechaEntrega As String = If(Entregar = True, NowADS().ToString("dd/MM/yyy"), "-1")
Dim Consecutivo As Integer = Row("Consecutivo").ToString.ToEntero
CveConsecutivo = Consecutivo
@@ -1313,7 +1313,7 @@ Partial Class OS_OrdenesServicios
Dim objEventos As New ClsOIEventos(ObjOrdenServicio.IniciaTransacSQL)
- If Not objEventos.FinalizaEvento(Now, 3, "", -1, CveOS, UsuarioActual.CveUsuario) Then
+ If Not objEventos.FinalizaEvento(NowADS(), 3, "", -1, CveOS, UsuarioActual.CveUsuario) Then
Errores = True
End If
@@ -2781,7 +2781,7 @@ Partial Class OS_OrdenesServicios
'End Sub
Private Sub LimpiaMovimiento()
CargaAlmacen()
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
UpAddMateriales.Update()
End Sub
Private Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyecto.SelectedIndexChanged
diff --git a/OS/RepOrdenesServicios.aspx.vb b/OS/RepOrdenesServicios.aspx.vb
index 4bed0045a..01fdef67f 100644
--- a/OS/RepOrdenesServicios.aspx.vb
+++ b/OS/RepOrdenesServicios.aspx.vb
@@ -20,7 +20,7 @@ Partial Class OS_RepOrdenesServicios
ViewState("CveUsuarioTecnico") = -1
End If
- txtFechaI.Text = $"01/01/{Now.Year}"
+ txtFechaI.Text = $"01/01/{NowADS().Year}"
CargaDatos()
OrdenaDatos()
@@ -116,7 +116,7 @@ Partial Class OS_RepOrdenesServicios
End If
End Sub
'Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
- ' GvDatos.ExportToExcel("RepOrdenesServicio_" & Now.ToShortDateString)
+ ' GvDatos.ExportToExcel("RepOrdenesServicio_" & NowADS().ToShortDateString)
'End Sub
#Region "O R D E N A M I E N T O"
diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb
index 45d9d378a..e66cc2b5a 100644
--- a/OS/RepServicioDomicilio.aspx.vb
+++ b/OS/RepServicioDomicilio.aspx.vb
@@ -211,7 +211,7 @@ Partial Class OS_RepServicioDomicilio
Private Property FechaInicioOriginal As DateTime
Get
If ViewState("FechaInicioOriginal") Is Nothing Then
- ViewState("FechaInicioOriginal") = DateTime.Now
+ ViewState("FechaInicioOriginal") = NowADS()
End If
Return ViewState("FechaInicioOriginal").ToString.ToDateTime
End Get
@@ -673,11 +673,11 @@ Partial Class OS_RepServicioDomicilio
TxtAnio.Text = ""
TxtModalFechaOS.Text = ""
- 'TSTimeSelector.Hour = Now.Hour
- 'TSTimeSelector.Minute = Now.Minute
+ 'TSTimeSelector.Hour = NowADS().Hour
+ 'TSTimeSelector.Minute = NowADS().Minute
CveTecnicoAsignarOrioginal = -1
- FechaInicioOriginal = DateTime.Now
+ FechaInicioOriginal = NowADS()
DVFolio.Visible = False
DvModalSubProyecto.Visible = False
@@ -707,7 +707,7 @@ Partial Class OS_RepServicioDomicilio
DdlClientesWS.ddl.SelectedValueExist(CveClientePublicoGeneral)
End If
- TxtFechaOS.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaOS.Text = NowADS().ToString("dd/MM/yyyy")
RegistraScript("$('#DVModalOS').modal('show');")
LblModalOStitulo.Text = "Agregar Orden de Servicio"
@@ -1130,7 +1130,7 @@ Partial Class OS_RepServicioDomicilio
params.Add(New ReportParameter("Año", dr("Año").ToString))
params.Add(New ReportParameter("TelefonoContacto", dr("TelefonoContacto").ToString))
- params.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
params.Add(New ReportParameter("Condiciones", dr("Condiciones").ToString))
params.Add(New ReportParameter("FechaAtencion", If(dr("FechaInicio").ToString.Length > 0, dr("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy hh:mm tt"), "")))
@@ -1154,7 +1154,7 @@ Partial Class OS_RepServicioDomicilio
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
diff --git a/Planeacion/Sucursal.aspx.vb b/Planeacion/Sucursal.aspx.vb
index 2e9702867..67d8ef91b 100644
--- a/Planeacion/Sucursal.aspx.vb
+++ b/Planeacion/Sucursal.aspx.vb
@@ -30,7 +30,7 @@ Partial Class Sucursal
ViewState("CveSucursal") = -1
ChkEstado.Enabled = False
ChkEstado.Checked = True
- LblFechaCaptura.Text = Now.ToShortDateString()
+ LblFechaCaptura.Text = NowADS().ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
BtnEliminar.Visible = False
End If
diff --git a/Portal/LogInPortal.aspx.vb b/Portal/LogInPortal.aspx.vb
index 198792daf..3eea5d8f7 100644
--- a/Portal/LogInPortal.aspx.vb
+++ b/Portal/LogInPortal.aspx.vb
@@ -35,7 +35,7 @@ Partial Class LogInPortal
' If UrlParametros("CVEU") IsNot Nothing AndAlso UrlParametros("CVEU").ToString.ToEntero > 0 Then
' CveUsuario = UrlParametros("CVEU").ToString.ToEntero
' 'Activo el usuario y redirecciono para que pida la nueva contraseña
- ' Dim currentDate As Date = Date.Now
+ ' Dim currentDate As Date = NowADS()
' Dim elapsedTicks As Long = currentDate.Ticks - UrlParametros("HORA").ToString.ToLong
' Dim elapsedSpan As New TimeSpan(elapsedTicks)
' PnlLogin.Visible = False
diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb
index 0e7514c8d..0a76b5515 100644
--- a/PortalCliente/PortalCliente.aspx.vb
+++ b/PortalCliente/PortalCliente.aspx.vb
@@ -596,7 +596,7 @@ Partial Class Ventas_PortalCliente
DtPagos.Columns.Add("ImportePagoMX", GetType(Decimal))
Dim Facturas = ""
- Dim TCPago = GlobalTipoCambio(Now)
+ Dim TCPago = GlobalTipoCambio(NowADS())
For Each Gvr As GridViewRow In GvCxC.Rows
If Gvr.FCCheckBox("ChkPagar").Checked Then
@@ -657,7 +657,7 @@ Partial Class Ventas_PortalCliente
Protected Sub BtnProsePago_Click(sender As Object, e As EventArgs)
- Dim ClavePago = $"{UsuarioActual.CveUsuario}-{Now.Ticks}"
+ Dim ClavePago = $"{UsuarioActual.CveUsuario}-{NowADS().Ticks}"
Dim Carpeta = $"{AppDomain.CurrentDomain.BaseDirectory}/PortalCliente/ePagos/{CveCliente}"
Carpeta.DirectoryExistsCreate
@@ -749,7 +749,7 @@ Partial Class Ventas_PortalCliente
' PREPOLIZA
Dim CvePlantillaPoliza = 11
- Dim FechaMovimiento As Date = Now
+ Dim FechaMovimiento As Date = NowADS()
Dim Concepto = "Prosepago"
Dim DtConceptos As New DataTable
Dim CveMonedaPago = 1
@@ -1117,7 +1117,7 @@ Partial Class Ventas_PortalCliente
strBody.Append("
")
strBody.Append("
")
strBody.Append("
Fecha
")
- strBody.Append($"
{Now.ToString("dd/MM/yyyy HH:ss")}
")
+ strBody.Append($"
{NowADS().ToString("dd/MM/yyyy HH:ss")}
")
strBody.Append("
")
strBody.Append("
")
@@ -1784,12 +1784,12 @@ Partial Class Ventas_PortalCliente
Dim ComprobanteIE As String = ""
Dim CveIE As Integer = -1
Dim CveTipoTransaccion As Integer = 11
- Dim FechaDoc As DateTime = Now
+ Dim FechaDoc As DateTime = NowADS()
Dim ConceptoContable As Integer
Dim TipoMovimiento As Boolean
Dim importeMovimiento As Decimal
- Dim FechaMovimiento As Date = Now
+ Dim FechaMovimiento As Date = NowADS()
Dim Concepto As String = ""
Dim Importe As Decimal = ImportePagado
@@ -1819,7 +1819,7 @@ Partial Class Ventas_PortalCliente
Dim FolioFijo As Integer = 0
Dim tCveMoneda As Integer = ObjFactura.CveMoneda
Dim tImporteMonedaExtranjera As Decimal = 0
- If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(Now).ToString.ToDecimal
+ If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(NowADS()).ToString.ToDecimal
Dim PagueseA = ObjFactura.Cliente.Nombre
If MsgError = "" Then
@@ -2584,10 +2584,10 @@ Partial Class Ventas_PortalCliente
Case "1"
TxtTipoCambio.Text = "1"
Case "2"
- TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS()).ToString
TrConversionTipoCambio.Visible = True
Case Else
- TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS()).ToString
TrConversionTipoCambio.Visible = True
End Select
UpTabPedidos.Update()
@@ -2993,12 +2993,12 @@ Partial Class Ventas_PortalCliente
ObjFactura.Folio = Folio.ToEntero
ObjFactura.Serie = Serie
'ObjFactura.CveMesa = -1
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = NowADS()
ObjFactura.CvePrePoliza = -1
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = NowADS()
ObjFactura.MotivoDescuento = ""
ObjFactura.Observaciones = ""
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = NowADS()
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CveCondicionEntrega = -1
ObjFactura.CondicionEntrega = ""
diff --git a/PortalGPS/Penske.aspx.vb b/PortalGPS/Penske.aspx.vb
index 461592c6e..de0c5c1ea 100644
--- a/PortalGPS/Penske.aspx.vb
+++ b/PortalGPS/Penske.aspx.vb
@@ -16,7 +16,7 @@ Partial Class PortalGPS_Penske
Private Sub EnviarDatos()
Dim ObjTsoft As New ClsTSoft
Try
- GuardaLog($"Empecé Task. Fecha: {DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}")
+ GuardaLog($"Empecé Task. Fecha: {NowADS().ToString("dd/MM/yyyy HH:mm:ss")}")
If ObjTsoft.GetInfoWSPenske() AndAlso ObjTsoft.DtResultados.Rows.Count > 0 Then
Dim Direcciones As JArray = ConsultarDirecciones(ObjTsoft.DtResultados)
For Each Dir As JObject In Direcciones
@@ -26,7 +26,7 @@ Partial Class PortalGPS_Penske
Catch ex As Exception
GuardaLog(ex.ToString())
Finally
- GuardaLog($"Terminé Task, se reportaron: {ObjTsoft.DtResultados.Rows.Count} registros. Fecha: {DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")}")
+ GuardaLog($"Terminé Task, se reportaron: {ObjTsoft.DtResultados.Rows.Count} registros. Fecha: {NowADS().ToString("dd/MM/yyyy HH:mm:ss")}")
ObjTsoft.Dispose()
End Try
End Sub
@@ -45,7 +45,7 @@ Partial Class PortalGPS_Penske
info.Trackingnumber = row("TrackingNumber").ToString
info.Ubicacion = direccion
info.FechaHoraEvento = row("FechaTrama").ToString.ToDate
- info.FechaRecepcion = DateTime.Now.AddMinutes(120)
+ info.FechaRecepcion = NowADS().AddMinutes(120)
info.Username = row("Usuario").ToString
info.Password = row("PWD").ToString
Dim Protocol As New WSPenske.Protocolo
@@ -96,8 +96,8 @@ Partial Class PortalGPS_Penske
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- ' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
- strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
+ ' strLineaTMP = Chr(13) & Chr(10) & Day(NowADS()) & "/" & Month(NowADS()) & "/" & Year(NowADS()) & " " & Hour(NowADS()) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
+ strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, NowADS().ToShortDateString, NowADS().ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\log\LogPenske.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
diff --git a/PortalGPS/ServiciosGPS.aspx.vb b/PortalGPS/ServiciosGPS.aspx.vb
index d0d8d1aa0..5f7650372 100644
--- a/PortalGPS/ServiciosGPS.aspx.vb
+++ b/PortalGPS/ServiciosGPS.aspx.vb
@@ -36,12 +36,12 @@ Partial Class PortalGPS_ServiciosGPS
Select Case Tipo
Case "GPRS"
If ObjHerra.EjecutarComandoManualGPRS(Comando, Telefono, CveDispositivo, -1) Then
- LblFecha.Text = Now.ToString("dd/MM/yyyy")
+ LblFecha.Text = NowADS().ToString("dd/MM/yyyy")
GuardaLog($"Se ejecuto el comando correctamente vía GPRS. ")
End If
Case "SMS"
If ObjHerra.EjecutarComandoManualSMS(Comando, Telefono, CveDispositivo, -1) Then
- LblFecha.Text = Now.ToString("dd/MM/yyyy")
+ LblFecha.Text = NowADS().ToString("dd/MM/yyyy")
GuardaLog($"Se ejecuto el comando correctamente vía SMS Fecha. ")
End If
End Select
@@ -64,7 +64,7 @@ Partial Class PortalGPS_ServiciosGPS
Dim ArchivoW As StreamWriter
Dim strLineaTMP As String
- strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
+ strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, NowADS().ToShortDateString, NowADS().ToShortTimeString)
Try
ArchivoW = New StreamWriter(String.Format("{0}\log\LogCanBus.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As Exception
diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb
index acc01a29f..8772990de 100644
--- a/PortalProveedor/PortalProveedor.aspx.vb
+++ b/PortalProveedor/PortalProveedor.aspx.vb
@@ -233,7 +233,7 @@ Partial Class Portal_PortalProveedor
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
- Return Date.Now.AddDays(15)
+ Return NowADS().AddDays(15)
Else
Return ViewState("FechaLimite").ToString.ToDate
End If
@@ -397,7 +397,7 @@ Partial Class Portal_PortalProveedor
End Sub
Private Sub CargaAnticipos(SerieSucursal As String, SelectTop As Integer)
Dim ObjMovtos As New ClsMovimientos()
- If ObjMovtos.GetAnticiposProveedor(CveProveedor, -1, SelectTop:=SelectTop) Then
+ If ObjMovtos.GetAnticiposProveedor(CveProveedor, UsuarioActual.CveEmpresa, SelectTop:=SelectTop) Then
If ObjMovtos.DtResultados.Rows.Count > 0 Then
Dim dtA, dtAH As DataTable
@@ -836,7 +836,7 @@ Partial Class Portal_PortalProveedor
' If Not TieneError Then
' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL)
' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx"
- ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa)
+ ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & NowADS().Ticks & "&CveE=" & UsuarioActual.CveEmpresa)
' Dim ObjMail As New ClsSisMail()
@@ -1253,7 +1253,7 @@ Partial Class Portal_PortalProveedor
Protected Function ImprimirReporteCxPPagadas(Optional Formato As String = "PDF") As Byte()
Dim retorno As Byte() = Nothing
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
- Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+ Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim ImagenADSistemas As New System.IO.FileInfo(Server.MapPath("~") & "/Imagenes/LogoSinFondochico.png")
Dim LogoADSistemasUri As String = String.Format("{0}://{1}:{2}/Imagenes/LogoSinFondochico.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port)
diff --git a/Presupuestos/GenerarPresupuestos.aspx.vb b/Presupuestos/GenerarPresupuestos.aspx.vb
index 0d6d01aa0..0b60ba2bd 100644
--- a/Presupuestos/GenerarPresupuestos.aspx.vb
+++ b/Presupuestos/GenerarPresupuestos.aspx.vb
@@ -105,7 +105,7 @@ Partial Class Presupuestos_GenerarPresupuestos
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
tbHPorcentaje.Attributes.Add("onchange", "CostoHerramienta(this);")
InicializarListas()
CrearDTMaterial()
diff --git a/Productos202006221814.xlsx b/Productos202006221814.xlsx
deleted file mode 100644
index 421d798b8..000000000
Binary files a/Productos202006221814.xlsx and /dev/null differ
diff --git a/Productos202006221920.xlsx b/Productos202006221920.xlsx
deleted file mode 100644
index ae050ff6e..000000000
Binary files a/Productos202006221920.xlsx and /dev/null differ
diff --git a/Prospeccion/Prospectos.aspx.vb b/Prospeccion/Prospectos.aspx.vb
index c5985a827..a13ef9dc5 100644
--- a/Prospeccion/Prospectos.aspx.vb
+++ b/Prospeccion/Prospectos.aspx.vb
@@ -178,7 +178,7 @@ Partial Class Prospectos_Prospectos
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
If ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
- TxtNombres.Text.Trim, Now, "", "", "", 0, TxtCalle.Text.Trim,
+ TxtNombres.Text.Trim, NowADS(), "", "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, "", TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", -1, DdlProspectoClasificacion.SelectedValue.ToEntero, -1, TxtEmpresaNombre.Text.Trim, "", "", "",
TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, "", DdlEmpresaMunicipios.SelectedValue.ToEntero, TxtEmpresaTelefono.Text.Trim, "", "", TxtEmpresaPuesto.Text.Trim, "", False, "", "", "", "", -1, "", -1, -1, -1, "", -1, 0, -1, "", 0, "", DdlVendedor.SelectedValue.ToEntero, DdlCalificacion.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then
@@ -190,7 +190,7 @@ Partial Class Prospectos_Prospectos
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
- TxtNombres.Text.Trim, Now, "", "", "", 0, TxtCalle.Text.Trim,
+ TxtNombres.Text.Trim, NowADS(), "", "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, "", TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", -1, DdlProspectoClasificacion.SelectedValue.ToEntero, -1, TxtEmpresaNombre.Text.Trim, "", "", "",
TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, "", DdlEmpresaMunicipios.SelectedValue.ToEntero, TxtEmpresaTelefono.Text.Trim, "", "", TxtEmpresaPuesto.Text.Trim, "", False, "", "", "", "", -1, "", -1, -1, -1, "", -1, 0, 1, "", 0, "", DdlVendedor.SelectedValue.ToEntero, DdlCalificacion.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
diff --git a/Prospeccion/RepProspectosGIS.aspx.vb b/Prospeccion/RepProspectosGIS.aspx.vb
index e2edca92e..6b54b1cea 100644
--- a/Prospeccion/RepProspectosGIS.aspx.vb
+++ b/Prospeccion/RepProspectosGIS.aspx.vb
@@ -105,7 +105,7 @@ Partial Class Prospeccion_RepProspectosGIS
' Dim dtc As DataTable = DTApartados.FiltraParametros("CveCliente = " & drr("CveCliente").ToString)
- ' If Venta.AddVenta("Rem", 0, drr("CveCliente").ToString.ToEntero, -1, dtc.SUM("Precio"), 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, Now, "", "", Now, -1, -1, "", "", "", 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 0, 43) Then
+ ' If Venta.AddVenta("Rem", 0, drr("CveCliente").ToString.ToEntero, -1, dtc.SUM("Precio"), 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, NowADS(), "", "", NowADS(), -1, -1, "", "", "", 0, 0, 0, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue, -1, -1, 0, 0, 43) Then
' Dim CveVenta As Integer = Venta.CveVenta
' For Each dr As DataRow In dtc.Rows
' Dim CveUnidadMedida As Integer
diff --git a/Prospectos/ProspectoExpediente.aspx.vb b/Prospectos/ProspectoExpediente.aspx.vb
index 2d90f538f..cd569290b 100644
--- a/Prospectos/ProspectoExpediente.aspx.vb
+++ b/Prospectos/ProspectoExpediente.aspx.vb
@@ -63,7 +63,7 @@ Partial Class Prospectos_ProspectoExpediente
ViewState("CveProspecto") = -1
- TxtFechaIngreso.Text = Now.ToShortDateString
+ TxtFechaIngreso.Text = NowADS().ToShortDateString
End If
@@ -214,8 +214,8 @@ Partial Class Prospectos_ProspectoExpediente
If FechaIngreso = "__/__/____" Then FechaIngreso = "-1"
- If TxtFechaIngreso.Text.Trim = Now.ToShortDateString Then
- FechaIngreso = Now.ToString
+ If TxtFechaIngreso.Text.Trim = NowADS().ToShortDateString Then
+ FechaIngreso = NowADS().ToString
End If
Dim ObjProspectos As New ClsProspectos
diff --git a/Prospectos/ProspectosEstructuras.aspx.vb b/Prospectos/ProspectosEstructuras.aspx.vb
index 7a172decd..8ac932e24 100644
--- a/Prospectos/ProspectosEstructuras.aspx.vb
+++ b/Prospectos/ProspectosEstructuras.aspx.vb
@@ -73,7 +73,7 @@ Partial Class Prospectos_ProspectosEstructuras
PnlBusquedaGral.Visible = True
Me.Form.DefaultButton = BtnBusqueda.UniqueID
TxtBusqueda.Focus()
- TxtFechaIngreso.Text = Now.ToShortDateString
+ TxtFechaIngreso.Text = NowADS().ToShortDateString
End If
@@ -225,8 +225,8 @@ Partial Class Prospectos_ProspectosEstructuras
If FechaIngreso = "__/__/____" Then FechaIngreso = "-1"
- If TxtFechaIngreso.Text.Trim = Now.ToShortDateString Then
- FechaIngreso = Now.ToString
+ If TxtFechaIngreso.Text.Trim = NowADS().ToShortDateString Then
+ FechaIngreso = NowADS().ToString
End If
Dim ObjProspectos As New ClsProspectos
diff --git a/Prospectos/ProspectosRedes.aspx.vb b/Prospectos/ProspectosRedes.aspx.vb
index 3fcdd5eea..8bdc104fd 100644
--- a/Prospectos/ProspectosRedes.aspx.vb
+++ b/Prospectos/ProspectosRedes.aspx.vb
@@ -64,7 +64,7 @@ Partial Class Prospectos_ProspectosRedes
PnlBusquedaGral.Visible = True
Me.Form.DefaultButton = BtnBusqueda.UniqueID
TxtBusqueda.Focus()
- TxtFechaIngreso.Text = Now.ToShortDateString
+ TxtFechaIngreso.Text = NowADS().ToShortDateString
End If
@@ -218,8 +218,8 @@ Partial Class Prospectos_ProspectosRedes
If FechaIngreso = "__/__/____" Then FechaIngreso = "-1"
- If TxtFechaIngreso.Text.Trim = Now.ToShortDateString Then
- FechaIngreso = Now.ToString
+ If TxtFechaIngreso.Text.Trim = NowADS().ToShortDateString Then
+ FechaIngreso = NowADS().ToString
End If
Dim ObjProspectos As New ClsProspectos
diff --git a/Prospectos/ProspectosSIP.aspx.vb b/Prospectos/ProspectosSIP.aspx.vb
index 08bbe2ee7..161ced1dd 100644
--- a/Prospectos/ProspectosSIP.aspx.vb
+++ b/Prospectos/ProspectosSIP.aspx.vb
@@ -153,7 +153,7 @@ Partial Class Prospectos_ProspectosSIP
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
If ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
- TxtNombres.Text.Trim, Now, "", "", "", 0, TxtCalle.Text.Trim,
+ TxtNombres.Text.Trim, NowADS(), "", "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, "", TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", -1, DdlProspectoClasificacion.SelectedValue.ToEntero, -1, TxtEmpresaNombre.Text.Trim, "", "", "",
TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, "", DdlEmpresaMunicipios.SelectedValue.ToEntero, TxtEmpresaTelefono.Text.Trim, "", "", TxtEmpresaPuesto.Text.Trim, "", False, "", "", "", "", -1, "", -1, -1, -1, "", -1, 0, -1, "", 0, "", DdlVendedor.SelectedValue.ToEntero, DdlCalificacion.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then
@@ -164,7 +164,7 @@ Partial Class Prospectos_ProspectosSIP
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
- TxtNombres.Text.Trim, Now, "", "", "", 0, TxtCalle.Text.Trim,
+ TxtNombres.Text.Trim, NowADS(), "", "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, "", TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", -1, DdlProspectoClasificacion.SelectedValue.ToEntero, -1, TxtEmpresaNombre.Text.Trim, "", "", "",
TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, "", DdlEmpresaMunicipios.SelectedValue.ToEntero, TxtEmpresaTelefono.Text.Trim, "", "", TxtEmpresaPuesto.Text.Trim, "", False, "", "", "", "", -1, "", -1, -1, -1, "", -1, 0, 1, "", 0, "", DdlVendedor.SelectedValue.ToEntero, DdlCalificacion.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
diff --git a/Prospectos/ProspectosValidar.aspx.vb b/Prospectos/ProspectosValidar.aspx.vb
index 0bc4c473b..3e05ab5d1 100644
--- a/Prospectos/ProspectosValidar.aspx.vb
+++ b/Prospectos/ProspectosValidar.aspx.vb
@@ -190,7 +190,7 @@ Partial Class Prospectos_ProspectosValidar
Dim Prosp As New ClsProspectos
- If Prosp.UpdateProspectoProceso(CveProspectoProspectoProceso, RBLSolucion.SelectedValue.ToEntero, Now, IFE) Then
+ If Prosp.UpdateProspectoProceso(CveProspectoProspectoProceso, RBLSolucion.SelectedValue.ToEntero, NowADS(), IFE) Then
Alert("Registro Guardado", TipoMensaje.MsgInformacion)
LimpiaDatos()
GvBusq.DataBind()
diff --git a/Prospectos/RedesIndicadores.aspx.vb b/Prospectos/RedesIndicadores.aspx.vb
index a32194ea8..6bd525bc5 100644
--- a/Prospectos/RedesIndicadores.aspx.vb
+++ b/Prospectos/RedesIndicadores.aspx.vb
@@ -173,7 +173,7 @@ Partial Class Prospectos_RedesIndicadores
Dim Marcador2 As Integer = 1
Dim Marcador3 As Integer = 1
Dim TotalDias As Integer = (FechaFin - FechaInicio).Days
- Dim DiasTranscurridos As Integer = (DateTime.Now - FechaInicio).Days
+ Dim DiasTranscurridos As Integer = (NowADS() - FechaInicio).Days
Dim Str As New StringBuilder
Dim Total As Integer = 20000
diff --git a/Prospectos/RepAgendasBitacoras.aspx.vb b/Prospectos/RepAgendasBitacoras.aspx.vb
index f93b79744..abe6ea16a 100644
--- a/Prospectos/RepAgendasBitacoras.aspx.vb
+++ b/Prospectos/RepAgendasBitacoras.aspx.vb
@@ -36,8 +36,8 @@ Partial Class Prospectos_RepAgendasBitacoras
eventos.Dispose()
ddlAgenda.Items.Insert(0, New ListItem("Todos", "-1"))
ddlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
- TxtFechaI.Text = Now.AddDays(-1).ToShortDateString
- TxtFechaF.Text = Now.ToShortDateString
+ TxtFechaI.Text = NowADS().AddDays(-1).ToShortDateString
+ TxtFechaF.Text = NowADS().ToShortDateString
ddlTipoEvento.Items.Insert(0, New ListItem("Todos", "-1"))
ddlTipoEvento.Items.Insert(1, New ListItem("Agenda", "2"))
diff --git a/Prospectos/RepMetas2.aspx.vb b/Prospectos/RepMetas2.aspx.vb
index 6ede2e420..36708a1bd 100644
--- a/Prospectos/RepMetas2.aspx.vb
+++ b/Prospectos/RepMetas2.aspx.vb
@@ -171,11 +171,11 @@ Partial Class Prospectos_RepMetas2
e.Row.FCLiteral("LitPor").Text = (e.Row.DBCampo("Hijos").ToDouble / e.Row.DBCampo("MetaGlobal").ToDouble * 100).FormatoNumero(0)
- If e.Row.DBCampo("UltimoIngreso") <> "" AndAlso e.Row.DBCampo("UltimoIngreso").ToDate < Now.AddDays(-10) Then
+ If e.Row.DBCampo("UltimoIngreso") <> "" AndAlso e.Row.DBCampo("UltimoIngreso").ToDate < NowADS().AddDays(-10) Then
e.Row.Cells(4).ForeColor = System.Drawing.Color.Red
e.Row.Cells(4).ToolTip = "Ultimo ingreso mayor a 10 dias"
End If
- If e.Row.DBCampo("FechaIng") <> "" AndAlso e.Row.DBCampo("FechaIng").ToDate < Now.AddDays(-14) AndAlso e.Row.DBCampo("Hijos").ToEntero = 0 Then
+ If e.Row.DBCampo("FechaIng") <> "" AndAlso e.Row.DBCampo("FechaIng").ToDate < NowADS().AddDays(-14) AndAlso e.Row.DBCampo("Hijos").ToEntero = 0 Then
e.Row.Cells(0).BackColor = System.Drawing.Color.Red
e.Row.Cells(0).ToolTip = String.Format("No se han ingresado hijos. Fecha de ingreso: {0}", e.Row.DBCampo("FechaIng").ToDate.ToShortDateString)
End If
diff --git a/Prospectos/RepSimpatizantes.aspx.vb b/Prospectos/RepSimpatizantes.aspx.vb
index 041b03d33..dcaf93b06 100644
--- a/Prospectos/RepSimpatizantes.aspx.vb
+++ b/Prospectos/RepSimpatizantes.aspx.vb
@@ -132,6 +132,6 @@ Partial Class Prospectos_RepSimpatizantes
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As ImageClickEventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("RepEquipoJGM_" & Now.ToString("yyyy/MM/dd"))
+ GvDatos.ExportToExcel("RepEquipoJGM_" & NowADS().ToString("yyyy/MM/dd"))
End Sub
End Class
diff --git a/Proveedores/LogInProveedores.aspx.vb b/Proveedores/LogInProveedores.aspx.vb
index 6274b201c..71a92ac0e 100644
--- a/Proveedores/LogInProveedores.aspx.vb
+++ b/Proveedores/LogInProveedores.aspx.vb
@@ -22,7 +22,7 @@ Partial Class Portal_LogInProveedores
' If UrlParametros("CVEU") IsNot Nothing AndAlso UrlParametros("CVEU").ToString.ToEntero > 0 Then
' Dim CveUsr As Integer = UrlParametros("CVEU").ToString.ToEntero
' 'Activo el usuario y redirecciono para que pida la nueva contraseña
- ' Dim currentDate As Date = Date.Now
+ ' Dim currentDate As Date = NowADS()
' Dim elapsedTicks As Long = currentDate.Ticks - UrlParametros("HORA").ToString.ToLong
' Dim elapsedSpan As New TimeSpan(elapsedTicks)
' PnlLogin.Visible = False
diff --git a/Proveedores/PortalProveedor.aspx.vb b/Proveedores/PortalProveedor.aspx.vb
index b71dea89d..48f866941 100644
--- a/Proveedores/PortalProveedor.aspx.vb
+++ b/Proveedores/PortalProveedor.aspx.vb
@@ -652,7 +652,7 @@ Partial Class Portal_PortalProveedor
' If Not TieneError Then
' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL)
' Dim Liga As String = ObjParametro.Cadena1 & "Proveedores/LogInProveedores.aspx"
- ' Dim LigaActivar = String.Format("{0}?p={1}", Liga, Encripta(String.Format("CveU={0}&Clave={1}&Opcion=Activar&Hora={2}", cveUsuarioPortal, CveProveedor, DateTime.Now.Ticks)))
+ ' Dim LigaActivar = String.Format("{0}?p={1}", Liga, Encripta(String.Format("CveU={0}&Clave={1}&Opcion=Activar&Hora={2}", cveUsuarioPortal, CveProveedor, NowADS().Ticks)))
' Dim ObjMail As New ClsSisMail()
diff --git a/RH/ActualizacionMasiva.aspx.vb b/RH/ActualizacionMasiva.aspx.vb
index 2e455ab81..e2049c8e2 100644
--- a/RH/ActualizacionMasiva.aspx.vb
+++ b/RH/ActualizacionMasiva.aspx.vb
@@ -254,7 +254,7 @@ Partial Class RH_ActualizacionMasiva
ObjPersonal.RollBack()
Exit For
End If
- If ObjPersonal.UpdateSalarios(Row.DataKey("CvePersonal").ToEntero(), DateTime.Now.ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Row.FCTextBox("TxtSalarioDiario").Text.ToDecimal(),
+ If ObjPersonal.UpdateSalarios(Row.DataKey("CvePersonal").ToEntero(), NowADS().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Row.FCTextBox("TxtSalarioDiario").Text.ToDecimal(),
Row.FCTextBox("TxtSDI").Text.ToDecimal(), Row.FCTextBox("TxtSalarioCotizado").Text.ToDecimal(), Row.FCTextBox("TxtSalarioDiario").Text.ToDecimal(),
Row.FCCheckBox("ChkCalcularSDI").Checked) Then
@@ -410,7 +410,7 @@ Partial Class RH_ActualizacionMasiva
If Not IsNothing(drow) Then
Dim CvePersonal As Integer = drow("CvePersonal").ToString().ToEntero()
- If ObjPersonal.UpdateSalarios(CvePersonal, DateTime.Now.ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Row("SDD").ToString().ToDecimal(), Row("SDI").ToString().ToDecimal(),
+ If ObjPersonal.UpdateSalarios(CvePersonal, NowADS().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Row("SDD").ToString().ToDecimal(), Row("SDI").ToString().ToDecimal(),
Row("SD IMSS").ToString().ToDecimal(), Row("SDD").ToString().ToDecimal(), ChkCalcularSDIXLS.Checked) Then
contador = contador + 1
Else
diff --git a/RH/AsistenciaDetalle.aspx.vb b/RH/AsistenciaDetalle.aspx.vb
index c8ce16560..39c415354 100644
--- a/RH/AsistenciaDetalle.aspx.vb
+++ b/RH/AsistenciaDetalle.aspx.vb
@@ -210,7 +210,7 @@ Partial Class RH_AsistenciaDetalle
Dim ObjAsistencias As New ClsRH
Dim ObjAsistenciasDetalle As New ClsRH
- If ObjAsistencias.AddAsistencia(CvePersonal, -1, DdlSubProyectoAsignado.SelectedValue.ToEntero, Now, 6, 100, 0, 0, -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ If ObjAsistencias.AddAsistencia(CvePersonal, -1, DdlSubProyectoAsignado.SelectedValue.ToEntero, NowADS(), 6, 100, 0, 0, -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjAsistencias.CveAsistencia > 0 AndAlso
ObjAsistenciasDetalle.AddAsistenciasDetalle(ObjAsistencias.CveAsistencia, DdlSubProyectoAsignado.SelectedValue.ToEntero, TxtHoraInicio.Text.Trim.ToDateTime, TxtHoraFin.Text.Trim.ToDateTime, DdlTipoHora.SelectedValue.ToEntero) Then
TxtHoraInicio.Text = ""
diff --git a/RH/Asistencias.aspx.vb b/RH/Asistencias.aspx.vb
index 0b84823f6..e844708cd 100644
--- a/RH/Asistencias.aspx.vb
+++ b/RH/Asistencias.aspx.vb
@@ -29,7 +29,7 @@ Partial Class RH_Asistencias
GV.Columns(2).Visible = False
GV.Columns(3).Visible = True
End If
- txtFechaAsistencia.Text = Now.ToShortDateString
+ txtFechaAsistencia.Text = NowADS().ToShortDateString
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveUsuario = 2343 Then
PnlMasivo.Visible = True
End If
@@ -94,7 +94,7 @@ Partial Class RH_Asistencias
txtFechaAsistencia.Enabled = False
Calendario.Enabled = False
btnconsultarnew.Visible = True
- If txtFechaAsistencia.Text.Trim.ToDate.Year.Contiene(Now.Year - 1, Now.Year, Now.Year + 1) Then
+ If txtFechaAsistencia.Text.Trim.ToDate.Year.Contiene(NowADS().Year - 1, NowADS().Year, NowADS().Year + 1) Then
Dim objpersonal As New ClsRH
If objpersonal.GetAsistencias(-1, DdlCliente.SelectedValue.ToEntero, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlTurno.SelectedValue.ToEntero, 1, DdlTipoPeriodo.SelectedValue.ToEntero, txtFechaAsistencia.Text.Trim.ToDate, txtFechaAsistencia.Text.Trim.ToDate, UsuarioActual.CveEmpresa, DdlPuesto.SelectedValue.ToEntero) Then
Dim dt As DataTable = objpersonal.DtResultados
@@ -157,7 +157,7 @@ Partial Class RH_Asistencias
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Fecha", Fecha))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy HH:mm")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy HH:mm")))
params.Add(New ReportParameter("Filtros", Filtros))
Dim lrds As New List(Of ReportDataSource)
diff --git a/RH/BuzonCalidad.aspx.vb b/RH/BuzonCalidad.aspx.vb
index 973a2076e..d47d985d5 100644
--- a/RH/BuzonCalidad.aspx.vb
+++ b/RH/BuzonCalidad.aspx.vb
@@ -41,7 +41,7 @@ Partial Class RH_BuzonCalidad
' Else
' 'Configuración de Modalidad Insert
- ' LblFechaCaptura.Text = Now.ToShortDateString()
+ ' LblFechaCaptura.Text = NowADS().ToShortDateString()
' LblUsuarioCapturo.Text = UsuarioActual.Usuario
' ViewState("CvePersonal") = -1
' BtnEliminar.Visible = False
diff --git a/RH/BuzonCalidad.aspx.vb.exclude b/RH/BuzonCalidad.aspx.vb.exclude
index a5724c81e..b8259011c 100644
--- a/RH/BuzonCalidad.aspx.vb.exclude
+++ b/RH/BuzonCalidad.aspx.vb.exclude
@@ -41,7 +41,7 @@ Partial Class RH_BuzonCalidad
Else
'Configuración de Modalidad Insert
- LblFechaCaptura.Text = Now.ToShortDateString()
+ LblFechaCaptura.Text = NowADS().ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
ViewState("CvePersonal") = -1
BtnEliminar.Visible = False
diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs
index 52de72552..0e9ba31cc 100644
--- a/RH/CalculoSBC.aspx.cs
+++ b/RH/CalculoSBC.aspx.cs
@@ -40,7 +40,7 @@ public partial class RH_CalculoSBC : ClsPaginas
{
if (!IsPostBack)
{
- TxtFechaPago.Text = String.Format("{0:01/MM/yyyy}", DateTime.Now);
+ TxtFechaPago.Text = String.Format("{0:01/MM/yyyy}", NowADS());
ClsRH ObjRH = new ClsRH();
@@ -806,8 +806,8 @@ public partial class RH_CalculoSBC : ClsPaginas
libro.Range(2, 2, 2, 6).Style.Font.SetFontSize(14);
libro.Range(1, 2, 2, 6).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center;
//libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechai:dd/MM/yyyy} al {fechaf:dd/MM/yyyy}";
- libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}";
- libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}";
+ libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{NowADS():dd/MM/yyyy}";
+ libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{NowADS():HH:mm}";
libro.Range(5, 8, 5, 12).Merge().Value = "Actual";
libro.Range(5, 13, 5, 15).Merge().Value = "Nuevo";
diff --git a/RH/CatChecadorTipo.aspx.vb b/RH/CatChecadorTipo.aspx.vb
index 66859cc85..63ed3b6bd 100644
--- a/RH/CatChecadorTipo.aspx.vb
+++ b/RH/CatChecadorTipo.aspx.vb
@@ -31,7 +31,7 @@ Partial Class RH_ChecadorTipo
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf HdnModalidad.Value = "U" Then
- If ObjRH.ChecadorTipoUpdate(HdnID.Value.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, TxtChecadorTipo.Text, TxtDescripcion.Text, Estatus, Date.Now) Then
+ If ObjRH.ChecadorTipoUpdate(HdnID.Value.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, TxtChecadorTipo.Text, TxtDescripcion.Text, Estatus, NowADS()) Then
CargaDatos()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
End If
diff --git a/RH/CatConceptosViaticos.aspx.cs b/RH/CatConceptosViaticos.aspx.cs
index f72ba449f..cd938aaa6 100644
--- a/RH/CatConceptosViaticos.aspx.cs
+++ b/RH/CatConceptosViaticos.aspx.cs
@@ -123,7 +123,7 @@ public partial class RH_CatConceptosViaticos : ClsPaginas
Boolean Estatus = ChkEstatus.Checked;
int CveUsuarioIng = UsuarioActual.CveUsuario;
- DateTime FechaIng = DateTime.Now;
+ DateTime FechaIng = NowADS();
if (EsEditar == 0)
{
diff --git a/RH/CatCursos.aspx.vb b/RH/CatCursos.aspx.vb
index 68369b641..a6ad7bd0b 100644
--- a/RH/CatCursos.aspx.vb
+++ b/RH/CatCursos.aspx.vb
@@ -302,7 +302,7 @@ Partial Class RH_CatCursos
Dim RpNombreCurso As String = TxtCurso.Text
- Dim RpFechas As String = Now.ToString("dd/MM/yyyy")
+ Dim RpFechas As String = NowADS().ToString("dd/MM/yyyy")
Dim RpTema As String = DDlTema.SelectedItem.Text
Dim RpSubTema As String = DDLSubtema.SelectedItem.Text
Dim RpCapacitador As String = DDLCapacitador.SelectedItem.Text
@@ -418,7 +418,7 @@ Partial Class RH_CatCursos
ChkEstatus.Checked = True
ChkConstancias.Checked = False
- txtInicio.Text = Now.ToString("dd/MM/yyyy")
+ txtInicio.Text = NowADS().ToString("dd/MM/yyyy")
TxtHoraEntrada.Text = ""
TxtUbicacion.Text = ""
@@ -625,7 +625,7 @@ Partial Class RH_CatCursos
Response.Clear()
Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Constancia_Curso_" & _CveCurso & "_" & Now.ToString("yyyyMMddhhmmss") & ".docx")
+ Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Constancia_Curso_" & _CveCurso & "_" & NowADS().ToString("yyyyMMddhhmmss") & ".docx")
Response.BinaryWrite(DocumenBitArray)
Response.End()
End If
diff --git a/RH/CatPersonal.aspx.vb b/RH/CatPersonal.aspx.vb
index 0a03c35dc..f6f4e2b7e 100644
--- a/RH/CatPersonal.aspx.vb
+++ b/RH/CatPersonal.aspx.vb
@@ -42,7 +42,7 @@ Partial Class RH_CatPersonal
HplAddVenta.Visible = False
End If
LnkAddPersonalSimplificado.Visible = Not HplAddVenta.Visible
- TxtFechaIngreso.Text = String.Format("{0:dd/MM/yyyy}", DateTime.Now)
+ TxtFechaIngreso.Text = String.Format("{0:dd/MM/yyyy}", NowADS())
ViewState("Orden") = ""
CargaEscolaridad()
CargaEstadoCivil()
@@ -688,7 +688,7 @@ Partial Class RH_CatPersonal
'params.Add(New ReportParameter("FechaInicio", FechaI))
'params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
ImprimirPDF("Empresas\Grales\Formatos\RepPersonal.rdlc", DTDatos, params, "ReporteTareas", Formato:=Formato)
@@ -733,7 +733,7 @@ Partial Class RH_CatPersonal
Response.Clear()
- Response.AddHeader("content-disposition", $"attachment;filename=personalizado_{Now.ToString("yyyyMMddhhmmss")}.xls")
+ Response.AddHeader("content-disposition", $"attachment;filename=personalizado_{NowADS().ToString("yyyyMMddhhmmss")}.xls")
Response.AddHeader("Content-Length", memoryStream.Length.ToString())
Response.ContentType = "application/octet-stream"
memoryStream.WriteTo(Response.OutputStream)
@@ -1162,8 +1162,8 @@ Partial Class RH_CatPersonal
' libro.Range(1, 2, 2, 6).Style.Font.SetFontSize(16)
' libro.Range(2, 2, 2, 6).Style.Font.SetFontSize(14)
' libro.Range(1, 2, 2, 6).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center
- ' libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now}"
- ' libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now}"
+ ' libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{NowADS()}"
+ ' libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{NowADS()}"
' End If
'End Using
End Sub
diff --git a/RH/DocumentacionVencida.aspx.vb b/RH/DocumentacionVencida.aspx.vb
index 96c305c3c..cc51720c5 100644
--- a/RH/DocumentacionVencida.aspx.vb
+++ b/RH/DocumentacionVencida.aspx.vb
@@ -10,8 +10,8 @@ Partial Class RH_DocumentacionVencida
Private Sub RH_DocumentacionVencida_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
- TxtFechaI.Text = Now.AddDays(-15).ToString("dd/MM/yyyy")
- TxtFechaF.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaI.Text = NowADS().AddDays(-15).ToString("dd/MM/yyyy")
+ TxtFechaF.Text = NowADS().ToString("dd/MM/yyyy")
End If
End Sub
diff --git a/RH/ListaAsistenciaRH.aspx.vb b/RH/ListaAsistenciaRH.aspx.vb
index b4e574491..acf0aa119 100644
--- a/RH/ListaAsistenciaRH.aspx.vb
+++ b/RH/ListaAsistenciaRH.aspx.vb
@@ -23,7 +23,7 @@ Partial Class RH_ListaAsistenciaRH
Private Sub RH_ListaAsistencia_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFecha.Text = Now.ToShortDateString
+ txtFecha.Text = NowADS().ToShortDateString
CveSupervisor = UsuarioActual.CvePersonal
CargaCombos()
CargaDatos()
diff --git a/RH/MiPerfil.aspx.vb b/RH/MiPerfil.aspx.vb
index 8a4cdf9d8..cae26c273 100644
--- a/RH/MiPerfil.aspx.vb
+++ b/RH/MiPerfil.aspx.vb
@@ -104,7 +104,7 @@ Partial Class RH_MiPerfil
Private Property VacInicioPeriodo As Date
Get
If ViewState("VacInicioPeriodo") Is Nothing Then
- Return Now
+ Return NowADS()
Else
Return DirectCast(ViewState("VacInicioPeriodo"), Date)
End If
@@ -116,7 +116,7 @@ Partial Class RH_MiPerfil
Private Property VacFinPeriodo As Date
Get
If ViewState("VacFinPeriodo") Is Nothing Then
- Return Now
+ Return NowADS()
Else
Return DirectCast(ViewState("VacFinPeriodo"), Date)
End If
@@ -559,7 +559,7 @@ Partial Class RH_MiPerfil
Dim ObjRH As New ClsRH
- If ObjRH.ChecadorPermisosGet(-1, "-1", CvePersonal, Now.AddMonths(-3), Now.AddMonths(2), -1, -1, UsuarioActual.CveEmpresa) Then
+ If ObjRH.ChecadorPermisosGet(-1, "-1", CvePersonal, NowADS().AddMonths(-3), NowADS().AddMonths(2), -1, -1, UsuarioActual.CveEmpresa) Then
GvPermisos.DataSource = ObjRH.DtResultados
Else
GvPermisos.DataSource = Nothing
@@ -797,8 +797,8 @@ Partial Class RH_MiPerfil
VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString.ToEntero
Else
- VacInicioPeriodo = Now
- VacFinPeriodo = Now
+ VacInicioPeriodo = NowADS()
+ VacFinPeriodo = NowADS()
VacAnios = 0
VacDias = 0
VacDiasUsados = 0
@@ -851,7 +851,7 @@ Partial Class RH_MiPerfil
Dim diasPermiso As String = GvRow.DataKey("Dias")
Dim MotivoPermiso As String = GvRow.DataKey("Motivo")
Dim Puesto As String = puestoProp
- Dim Fecha As String = DateTime.Now.ToString("dd/MM/yyyy")
+ Dim Fecha As String = NowADS().ToString("dd/MM/yyyy")
Dim Solicitante As String = UsuarioActual.Nombre
Dim anio As Integer = GvRow.DataKey("FechaInicio").ToDate().Year
If Periodoingreso > PeriodoInicio Then
@@ -893,7 +893,7 @@ Partial Class RH_MiPerfil
Response.Clear()
Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicitud_Vacaciones_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
+ Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicitud_Vacaciones_" & NowADS().ToString("yyyyMMddhhmmss") & ".pdf")
Response.BinaryWrite(bytesInStream)
Response.End()
@@ -949,8 +949,8 @@ Partial Class RH_MiPerfil
ListaTagsDocumentost.Add(New TagsDocumentos("{CUIP}", ""))
ListaTagsDocumentost.Add(New TagsDocumentos("{Denominacion}", ""))
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaNacimiento}", objRH.DtResultados(0)("FechaNacimiento").ToString.ToDate.ToString("dd/MM/yyyy")))
- Dim fechaActual As String = " " & Now.Day & " del mes " & Now.Month & " del año " & Now.Year
- Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
+ Dim fechaActual As String = " " & NowADS().Day & " del mes " & NowADS().Month & " del año " & NowADS().Year
+ Dim FechaActualDF As String = NowADS().ToString("dd/MM/yyyy")
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
End If
@@ -1007,7 +1007,7 @@ Partial Class RH_MiPerfil
Response.Clear()
Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
+ Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & NowADS().ToString("yyyyMMddhhmmss") & ".pdf")
Response.BinaryWrite(bytesInStream)
Response.End()
Else
@@ -1545,7 +1545,7 @@ end_of_for:
Else
'GUARDA SOLICITUDES NUEVAS
- CveSolicitudViatico = ObjBancos.AddSolicitudesViaticos(TxtFolio.Text, DdlEstatus.SelectedValue.ToEntero(), DdlPersonal.SelectedValue.ToEntero(), TxtDestino.Text, TxtAsunto.Text, TxtFechaSalida.Text, TxtFechaRegreso.Text, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipoCarro:=TxtTipoCarro.Text, KM:=TxtKM.Text)
+ CveSolicitudViatico = ObjBancos.AddSolicitudesViaticos(TxtFolio.Text, DdlEstatus.SelectedValue.ToEntero(), DdlPersonal.SelectedValue.ToEntero(), TxtDestino.Text, TxtAsunto.Text, TxtFechaSalida.Text, TxtFechaRegreso.Text, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipoCarro:=TxtTipoCarro.Text, KM:=TxtKM.Text)
If (CveSolicitudViatico > 0) Then
For Each RowConcepto As DataRow In DTConceptosDetalles.Rows
@@ -1734,7 +1734,7 @@ end_of_for:
params.Add(New ReportParameter("TelefonoSolicitante", ObjBancos.DtResultados.FiltroPrimeroValor("TelefonoPersonal")))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToShortDateString()))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("TotalADepositar", If(ObjBancos.DtResultados.FiltroPrimeroValor("TotalADepositar").ToDouble() > 0, ObjBancos.DtResultados.FiltroPrimeroValor("TotalADepositar"), "0").ToString()))
@@ -1797,7 +1797,7 @@ end_of_for:
Else
'GUARDA SOLICITUDES NUEVAS
- CveSolicitudViatico = ObjBancos.AddSolicitudesViaticos(TxtFolio.Text, DdlEstatus.SelectedValue.ToEntero(), DdlPersonal.SelectedValue.ToEntero(), TxtDestino.Text, TxtAsunto.Text, TxtFechaSalida.Text, TxtFechaRegreso.Text, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipoCarro:=TxtTipoCarro.Text, KM:=TxtKM.Text)
+ CveSolicitudViatico = ObjBancos.AddSolicitudesViaticos(TxtFolio.Text, DdlEstatus.SelectedValue.ToEntero(), DdlPersonal.SelectedValue.ToEntero(), TxtDestino.Text, TxtAsunto.Text, TxtFechaSalida.Text, TxtFechaRegreso.Text, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TipoCarro:=TxtTipoCarro.Text, KM:=TxtKM.Text)
If (CveSolicitudViatico > 0) Then
For Each RowConcepto As DataRow In DTConceptosDetalles.Rows
diff --git a/RH/Personal.aspx b/RH/Personal.aspx
index 9bcecc251..c1a0d55b4 100644
--- a/RH/Personal.aspx
+++ b/RH/Personal.aspx
@@ -398,7 +398,7 @@
-
+
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb
index bc1bb755f..3c4d3394b 100644
--- a/RH/Personal.aspx.vb
+++ b/RH/Personal.aspx.vb
@@ -203,7 +203,7 @@ Partial Class RH_Personal
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
- Return Date.Now.AddDays(15)
+ Return NowADS().AddDays(15)
Else
Return ViewState("FechaLimite").ToString().ToDate
End If
@@ -438,7 +438,7 @@ Partial Class RH_Personal
Private Property VacInicioPeriodo As Date
Get
If ViewState("VacInicioPeriodo") Is Nothing Then
- Return Now
+ Return NowADS()
Else
Return DirectCast(ViewState("VacInicioPeriodo"), Date)
End If
@@ -450,7 +450,7 @@ Partial Class RH_Personal
Private Property VacFinPeriodo As Date
Get
If ViewState("VacFinPeriodo") Is Nothing Then
- Return Now
+ Return NowADS()
Else
Return DirectCast(ViewState("VacFinPeriodo"), Date)
End If
@@ -1009,7 +1009,7 @@ Partial Class RH_Personal
LoadDefaultValues()
ImgAddObs.Visible = False
- LblFechaCaptura.Text = Now.ToShortDateString()
+ LblFechaCaptura.Text = NowADS().ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
ViewState("CvePersonal") = -1
BtnEliminar.Visible = False
@@ -1106,13 +1106,13 @@ Partial Class RH_Personal
CargaClientes()
Dim fechainicioasistencia As String
Dim fechaFinasistencia As String
- If Now.Day >= 15 Then
- fechainicioasistencia = String.Format("{0:16/MM/yyyy}", Now)
- Dim dateendasis As DateTime = String.Format("{0:01/MM/yyyy}", Now).ToDateTime().AddMonths(1).AddDays(-1)
+ If NowADS().Day >= 15 Then
+ fechainicioasistencia = String.Format("{0:16/MM/yyyy}", NowADS())
+ Dim dateendasis As DateTime = String.Format("{0:01/MM/yyyy}", NowADS()).ToDateTime().AddMonths(1).AddDays(-1)
fechaFinasistencia = String.Format("{0:dd/MM/yyyy}", dateendasis)
Else
- fechainicioasistencia = String.Format("{0:01/MM/yyyy}", Now)
- fechaFinasistencia = String.Format("{0:15/MM/yyyy}", Now)
+ fechainicioasistencia = String.Format("{0:01/MM/yyyy}", NowADS())
+ fechaFinasistencia = String.Format("{0:15/MM/yyyy}", NowADS())
End If
If Request("FechaI") IsNot Nothing AndAlso IsDate(Request("FechaI")) Then
txtFechaI.Text = Request("FechaI")
@@ -1138,8 +1138,8 @@ Partial Class RH_Personal
End If
End If
- TxtFechaICredito.Text = $"01/01/{Now.Year}"
- TxtFechaFCredito.Text = Now.ToShortDateString
+ TxtFechaICredito.Text = $"01/01/{NowADS().Year}"
+ TxtFechaFCredito.Text = NowADS().ToShortDateString
If UsuarioActual.Empresa.Funcionalidad(509) = "1" Then
divCliente.Visible = True
@@ -1947,11 +1947,11 @@ Partial Class RH_Personal
End If
If VacDiasDisponibles > 0 Then
- TxtFechaInicioVac.Text = Now.AddDays(1).ToString("dd/MM/yyyy")
+ TxtFechaInicioVac.Text = NowADS().AddDays(1).ToString("dd/MM/yyyy")
Else
- TxtFechaInicioVac.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaInicioVac.Text = NowADS().ToString("dd/MM/yyyy")
End If
- TxtFechaFinVac.Text = Now.AddDays(VacDiasDisponibles).ToString("dd/MM/yyyy")
+ TxtFechaFinVac.Text = NowADS().AddDays(VacDiasDisponibles).ToString("dd/MM/yyyy")
'PERSONAL ALTAS
If ObjPersonal.GetPersonalAltas(CvePersonal) Then
@@ -2256,7 +2256,7 @@ Partial Class RH_Personal
' objRH.Dispose()
' Cuerpo.AppendLine("
")
diff --git a/RH/Reclutamiento.aspx.vb b/RH/Reclutamiento.aspx.vb
index a1e137583..bea4bc3d4 100644
--- a/RH/Reclutamiento.aspx.vb
+++ b/RH/Reclutamiento.aspx.vb
@@ -458,7 +458,7 @@ Partial Class RH_Reclutamiento
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
- Return Date.Now.AddDays(15)
+ Return NowADS().AddDays(15)
Else
Return ViewState("FechaLimite").ToString.ToDate
End If
@@ -1115,7 +1115,7 @@ Partial Class RH_Reclutamiento
If Not IsDBNull(objRH.DtResultados(0)("FechaInicioContrato")) Then
If objRH.DtResultados(0)("FechaInicioContrato").ToString.ToDate().ToString("dd/MM/yyyy") = "01/01/0001" Then
- TxtFechaInicio.Text = Now.ToShortDateString
+ TxtFechaInicio.Text = NowADS().ToShortDateString
Else
TxtFechaInicio.Text = objRH.DtResultados(0)("FechaInicioContrato").ToString.ToDate().ToString("dd/MM/yyyy")
End If
@@ -1586,7 +1586,7 @@ Partial Class RH_Reclutamiento
Dim _ParientesEmpresaDetalle As String
Dim _InfonavitNoCredito As String
Dim CveCaptacion As Integer = If(DdlCaptacion.SelectedValue.ToEntero = 0, -1, DdlCaptacion.SelectedValue.ToEntero)
- Edad = Now.Year - TxtFechaN4.Text.ToDate.Year
+ Edad = NowADS().Year - TxtFechaN4.Text.ToDate.Year
If TxtParientesEmpresaDetalle.Text.Trim.Length > 0 Then
_ParientesEmpresaDetalle = TxtParientesEmpresaDetalle.Text.Trim
@@ -3001,7 +3001,7 @@ Partial Class RH_Reclutamiento
Dim objDoc As New clsGemBoxDocument(pathDesti)
Dim objRH As New ClsRH
- Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString & " del " & Now.Year.ToString()
+ Dim FechaActual As String = NowADS().Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString & " del " & NowADS().Year.ToString()
objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
@@ -3725,7 +3725,7 @@ Partial Class RH_Reclutamiento
Dim CveCaracteristicaOpcion As Integer = -1
Dim CaracteristicaValor As String = ""
- Dim CaracteristicaValorDate As Date = Now
+ Dim CaracteristicaValorDate As Date = NowADS()
Dim CaracteristicaValorInt As Integer = -1
@@ -5363,7 +5363,7 @@ Partial Class RH_Reclutamiento
End If
Dim CveCaptacion As Integer = If(DdlCaptacion.SelectedValue.ToEntero = 0, -1, DdlCaptacion.SelectedValue.ToEntero)
- Edad = Now.Year - TxtFechaN4.Text.ToDate.Year
+ Edad = NowADS().Year - TxtFechaN4.Text.ToDate.Year
If ValidaGuardaFirmaContratoEvento() Then
If objRh.PersonalReclutamientoUpdate(CvePersonal, TxtNombres4.Text, TxtAPaterno4.Text, TxtAmaterno4.Text, TxtEstatura4.Text.ToDecimal, TxtPeso4.Text.ToDecimal,
@@ -5696,7 +5696,7 @@ Partial Class RH_Reclutamiento
objRH.Dispose()
Cuerpo.AppendLine("
diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx
index aaf580219..4bb8c6f7f 100644
--- a/TareasProgramadas/Tareas119.ashx
+++ b/TareasProgramadas/Tareas119.ashx
@@ -66,10 +66,10 @@ public class TareasJam : IHttpHandler
DataTable DTClientes = new DataTable();
DataTable DTAlmacenes = new DataTable();
- string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
- string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
- string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
- string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
+ string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{ClsPaginas.NowADS().ToString("yyyyMMdd")}.xlsx";
+ string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{ClsPaginas.NowADS().ToString("yyyyMMdd")}.xlsx";
+ string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{ClsPaginas.NowADS().ToString("yyyyMMdd")}.xlsx";
+ string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{ClsPaginas.NowADS().ToString("yyyyMMdd")}.xlsx";
string FormatoVentas = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoVentas.xlsx";
@@ -543,7 +543,7 @@ public class TareasJam : IHttpHandler
ClsSisMail Correo = new ClsSisMail();
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
// string Para = "oscar.irigoyen@adssistemas.mx";
- string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}";
+ string Asunto = ErrorProceso ? $"Carga Layout Corteva {ClsPaginas.NowADS().ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {ClsPaginas.NowADS().ToString("yyyy-MM-dd")}";
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);
this.GuardaLog($"EjecutaThalamus: MandaCorreo() correo enviado. ");
diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb
index 13a5a883a..90a638fc2 100644
--- a/Ventas/ActualizarPrecios.aspx.vb
+++ b/Ventas/ActualizarPrecios.aspx.vb
@@ -231,7 +231,7 @@ Partial Class Ventas_ActualizarPrecios
For Each row As GridViewRow In GVPrecios.Rows
If row.FCCheckBox("chkPS").Checked Then
- Correcto = ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
+ Correcto = ObjPS.UpdatePSPreciosLista(row.FCTextBox("TxtPrecio").Text.ToDecimal, DdlPrecioLista.SelectedValue.ToEntero, Porcentaje, row.DataKey("CvePS").ToEntero, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal)
If Correcto Then
TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.DataKey("PS"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text)
@@ -467,14 +467,14 @@ Partial Class Ventas_ActualizarPrecios
If CvePS > 0 AndAlso CvePrecioLista > 0 Then
- Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
+ Correcto = ObjPS.UpdatePSPreciosLista(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
If Correcto Then
RowsCargados += 1
TieneError = ActualizarPreciosFranquicia(ObjPS, row(0).ToString(), row(1).ToString(), PrecioNuevo, 0, DdlPrecioListaCarga.SelectedItem.Text)
End If
Else
If CvePS > 0 AndAlso CvePrecioLista = -2 Then
- Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, True)
+ Correcto = ObjPS.UpdatePSPrecios(PrecioNuevo, CvePrecioLista, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
If Correcto Then
RowsCargados += 1
End If
@@ -588,7 +588,7 @@ Partial Class Ventas_ActualizarPrecios
' Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa")
' StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}' ", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia)
'End If
- If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
+ If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, NowADS(), If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then
StrMsgError.AppendFormat("No se pudo actualizar el producto")
End If
Next
@@ -765,7 +765,7 @@ Partial Class Ventas_ActualizarPrecios
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = UsuarioActual.Nombre
worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(2).Value = NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
diff --git a/Ventas/AuxiliarCliente.aspx.vb b/Ventas/AuxiliarCliente.aspx.vb
index 19218064a..780126fa8 100644
--- a/Ventas/AuxiliarCliente.aspx.vb
+++ b/Ventas/AuxiliarCliente.aspx.vb
@@ -61,8 +61,8 @@ Partial Class Ventas_AuxiliarCliente
'DdlConceptosContables.Items.Insert(0, New ListItem("Todos", "-1"))
- txtFechaI.Text = Now.AddDays(-30).ToString("dd/MM/yyyy")
- txtFechaF.Text = Now.ToString("dd/MM/yyyy")
+ txtFechaI.Text = NowADS().AddDays(-30).ToString("dd/MM/yyyy")
+ txtFechaF.Text = NowADS().ToString("dd/MM/yyyy")
End Sub
diff --git a/Ventas/AuxiliarClienteVentas.aspx.vb b/Ventas/AuxiliarClienteVentas.aspx.vb
index c7fe00419..ebcb3c807 100644
--- a/Ventas/AuxiliarClienteVentas.aspx.vb
+++ b/Ventas/AuxiliarClienteVentas.aspx.vb
@@ -60,8 +60,8 @@ Partial Class Ventas_AuxiliarClienteVentas
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, Nothing)
- txtFechaI.Text = Now.AddDays(-30).ToString("dd/MM/yyyy")
- txtFechaF.Text = Now.ToString("dd/MM/yyyy")
+ txtFechaI.Text = NowADS().AddDays(-30).ToString("dd/MM/yyyy")
+ txtFechaF.Text = NowADS().ToString("dd/MM/yyyy")
End Sub
diff --git a/Ventas/CatAutorizacionLimites.aspx.vb b/Ventas/CatAutorizacionLimites.aspx.vb
index a20ae2377..d6c01ef17 100644
--- a/Ventas/CatAutorizacionLimites.aspx.vb
+++ b/Ventas/CatAutorizacionLimites.aspx.vb
@@ -31,8 +31,8 @@ Partial Class Ventas_CatAutorizacionLimites
#Region "CARGAS"
Private Sub CargaCombos()
- txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy")
- txtFechaI.Text = Now.ToString("dd/MM/yyyy")
+ txtFechaI.Text = NowADS().AddDays(-1).ToString("dd/MM/yyyy")
+ txtFechaI.Text = NowADS().ToString("dd/MM/yyyy")
DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True)
@@ -351,7 +351,7 @@ Partial Class Ventas_CatAutorizacionLimites
StrFiltro.AppendFormat("Vendedor: {0}, ", DdlVendedorFiltro.SelectedItem)
StrFiltro.AppendFormat("Fecha Inicio: {0}", txtFechaI.Text.ToDate.ToString("dd/MM/yyyy"))
'If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(", Fecha Fin: {0}", txtFechaF.Text.ToDate.ToString("dd/MM/yyyy"))
- Dim fechaFin As String = If(txtFechaF.Text <> "", txtFechaF.Text.ToDate.ToString("dd/MM/yyyy"), Now.ToString("dd/MM/yyyy"))
+ Dim fechaFin As String = If(txtFechaF.Text <> "", txtFechaF.Text.ToDate.ToString("dd/MM/yyyy"), NowADS().ToString("dd/MM/yyyy"))
StrFiltro.AppendFormat(", Fecha Fin: {0}", fechaFin)
'Oculta columnas en export sin afectar GridView en página
diff --git a/Ventas/CatClientes.aspx.vb b/Ventas/CatClientes.aspx.vb
index 2cb8f2b19..16d717016 100644
--- a/Ventas/CatClientes.aspx.vb
+++ b/Ventas/CatClientes.aspx.vb
@@ -169,7 +169,7 @@ Partial Class CatClientes
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("RepClientes_" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("RepClientes_" & NowADS().ToShortDateString)
End Sub
#Region "P D F"
@@ -200,7 +200,7 @@ Partial Class CatClientes
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
params.Add(New ReportParameter("DireccionEmpresa", UsuarioActual.Empresa.Direccion))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb
index b81da0b6a..b63444e01 100644
--- a/Ventas/CatMetasVendedores.aspx.vb
+++ b/Ventas/CatMetasVendedores.aspx.vb
@@ -24,7 +24,7 @@ Partial Class CatMetasVendedores
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
- txtMesAnio.Text = Now.FirstDayOfMonth.ToShortDateString
+ txtMesAnio.Text = NowADS().FirstDayOfMonth.ToShortDateString
CargaDatosModal()
CargaCombos()
CargaDatos()
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index 25dc5a555..d3edba22e 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -1438,17 +1438,18 @@
+
-
+
-
+
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 8b42bd4e3..56ad80409 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -528,7 +528,7 @@ Partial Class Clientes
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
- Return Date.Now.AddDays(15)
+ Return NowADS().AddDays(15)
Else
Return ViewState("FechaLimite").ToString().ToDate()
End If
@@ -820,7 +820,7 @@ Partial Class Clientes
End If
ImgAddObs.Visible = False
- LblFechaCaptura.Text = Now.ToShortDateString()
+ LblFechaCaptura.Text = NowADS().ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
ViewState("CveCliente") = -1
BtnEliminar.Visible = False
@@ -887,8 +887,8 @@ Partial Class Clientes
InicializaDevolverDinero()
- TxtFechaICredito.Text = Now.AddYears(-2).ToShortDateString()
- TxtFechaFCredito.Text = Now.ToShortDateString()
+ TxtFechaICredito.Text = NowADS().AddYears(-2).ToShortDateString()
+ TxtFechaFCredito.Text = NowADS().ToShortDateString()
If UsuarioActual.TienePermisoProceso(257) Then 'Falta agregar proceso
DivMapAddSucursal.Visible = True
@@ -981,10 +981,7 @@ Partial Class Clientes
DdlClasificacion.DataBind()
DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpDatos.Update()
- End Sub
-
-
-
+ End Sub
Private Sub CargaEstados(Optional ClaveSATPais As String = "MEX")
DdlEstadoSAT.Items.Clear()
@@ -1161,7 +1158,7 @@ Partial Class Clientes
Private Sub CargaDdlCuentasContables(Ddl As DropDownList, Optional CveFuncionalidad As Integer = -1)
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
If ObjContabilidad.GetCuentasRecursiva(CveFuncionalidad, 1) Then
- Dim Seleccionado = Ddl.SelectedValue
+ Dim Seleccionado As String = Ddl.SelectedValue
Ddl.Items.Clear()
Ddl.Items.Add(New ListItem("Seleccione", "0"))
Ddl.DataSource = ObjContabilidad.DtResultados
@@ -1757,7 +1754,9 @@ Partial Class Clientes
Dim ObjClientes As New ClsClientes()
If ObjClientes.GetHistorialVentas(CveCliente, UsuarioActual.CveEmpresa, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then
-
+ GVHistorial.Columns(3).Visible = UsuarioActual.Empresa.Funcionalidad(163) = "1" ' mostrar columna de descripción
+ GVHistorial.Columns(5).Visible = ObjClientes.DtResultados.SUMD("Descuento") > 0 ' mostrar columna de descuento
+ GVHistorial.Columns(6).Visible = ObjClientes.DtResultados.SUMD("Amortizacion") > 0 ' mostrar columna de amortización
'Carga Grid
DTHistorialVentas = ObjClientes.DtResultados
GVHistorial.DataSource = ObjClientes.DtResultados
@@ -2559,10 +2558,9 @@ Partial Class Clientes
' ObjContaAC.Dispose()
'End If
-
- Dim CodigoCuentaAltaCompaq As String = ""
- Dim NombreCuentaCuentaAltaCompaq As String = ""
- Dim IdCuentaAltaCompaq As Integer = -1
+ 'Dim CodigoCuentaAltaCompaq As String = ""
+ 'Dim NombreCuentaCuentaAltaCompaq As String = ""
+ 'Dim IdCuentaAltaCompaq As Integer = -1
'Si tiene contabilizacion automatica y la funcionalidad de carga cuenta automatica o UsaAC le agregamos automaticamente una cuenta al cliente
'If UsuarioActual.Empresa.Funcionalidad(211).ToEntero() > 0 AndAlso (UsuarioActual.Empresa.Funcionalidad(200).ToEntero() > 0 Or UsuarioActual.Empresa.UsaAC) AndAlso DdlCtaContableClientes.SelectedValue.ToEntero() < 1 Then
' If Not AgregarCuentaContable(BtnActivaRegistroClientes, DdlCtaContableClientes, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq) Then
@@ -2600,7 +2598,7 @@ Partial Class Clientes
'For Each gvr As GridViewRow In GvDocsVentas.Rows
' If gvr.FCCheckBox("ChkDoc").Checked Then
- ' objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").Toentero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, Now, Observacion2:=gvr.FCTextBox("TxtObs2").Text, FechaVigencia:=gvr.FCTextBox("TxtFechaVigencia").Text.ToDate())
+ ' objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").Toentero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, NowADS(), Observacion2:=gvr.FCTextBox("TxtObs2").Text, FechaVigencia:=gvr.FCTextBox("TxtFechaVigencia").Text.ToDate())
' End If
@@ -2701,7 +2699,7 @@ Partial Class Clientes
'For Each gvr As GridViewRow In GvDocsVentas.Rows
' 'sino está registrada y se selecciona, se va a insertar
' If gvr.DataKey("CveDocumentacionElectronica").Toentero() <= 0 Then
- ' objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").Toentero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, Now, Observacion2:=gvr.FCTextBox("TxtObs2").Text, FechaVigencia:=gvr.FCTextBox("TxtFechaVigencia").Text.ToDate())
+ ' objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").Toentero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, NowADS(), Observacion2:=gvr.FCTextBox("TxtObs2").Text, FechaVigencia:=gvr.FCTextBox("TxtFechaVigencia").Text.ToDate())
' Else
' ', Observacion2:=gvr.FCTextBox("TxtObs2").Text
' objDoc.DocumentacionElectronicaUpdate(gvr.DataKey("CveDocumentacionElectronica").Toentero(), gvr.DataKey("CveDocumentacion").Toentero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, gvr.DataKey("FechaLimite").ToDate(), Observacion2:=gvr.FCTextBox("TxtObs2").Text, FechaVigencia:=gvr.FCTextBox("TxtFechaVigencia").Text.ToDate())
@@ -2721,7 +2719,7 @@ Partial Class Clientes
If EstatusAnteriorCliente <> ChkEstado.Checked Then
Dim DTVendedor As New DataTable
- DTVendedor = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(" CveVendedor = " & DdlVendedor.SelectedValue.ToEntero())
+ DTVendedor = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(" CveVendedor = " & DdlVendedor.SelectedValue)
Dim ObjVendedores As New ClsVtaVendedores
Dim DtVendedores As DataTable = Nothing
@@ -2757,14 +2755,11 @@ Partial Class Clientes
MandaCorreo(Asunto, Para + "", SBBody.ToString())
End If
End If
-
End If
-
CargaHistorial()
CargaDatos()
UpDatos.Update()
UpnHistorial.Update()
-
End If
End If
ObjClientes.Dispose()
@@ -2920,7 +2915,7 @@ Partial Class Clientes
If UsuarioActual.TienePermisoProceso(247) Then
If CType(sender, GridView).ID = "GVAnticipos" And e.Row.DBCampo("CveVenta").ToEntero() > 0 And e.Row.DBCampo("Tipo") = "NC" Then
- Dim Parametros = Encripta($"CveVenta={e.Row.DBCampo("CveVenta").ToEntero()}&SerieFolio={e.Row.DBCampo("Folio")}&CveMoneda={e.Row.DBCampo("CveMoneda")}&CveCliente={CveCliente}&Saldo={e.Row.DBCampo("Saldo")}&Original={e.Row.DBCampo("Original")}&CvePrePoliza={e.Row.DBCampo("CvePrePoliza")}")
+ Dim Parametros As String = Encripta($"CveVenta={e.Row.DBCampo("CveVenta").ToEntero()}&SerieFolio={e.Row.DBCampo("Folio")}&CveMoneda={e.Row.DBCampo("CveMoneda")}&CveCliente={CveCliente}&Saldo={e.Row.DBCampo("Saldo")}&Original={e.Row.DBCampo("Original")}&CvePrePoliza={e.Row.DBCampo("CvePrePoliza")}")
e.Row.FCHyperLink("HLDevolverDinero").Visible = True
e.Row.FCHyperLink("HLDevolverDinero").NavigateUrl = $"/Bancos/IE.aspx?Opcion=DevDinV&P={Parametros}"
End If
@@ -3481,7 +3476,7 @@ Partial Class Clientes
' AGREGA PERMISO A MODULO PORTALCLIENTE
If ObjUsuario.UpdateUsuariosModulos(CveUsr, 1101, True, UsuarioActual.CveUsuario) Then
'AGREGAMOS PERMISOS A ADMIN
- For Each permiso In Permisos
+ For Each permiso As Integer In Permisos
If Not ObjUsuario.UpdateUsuariosProcesos(CveUsr, permiso, True, UsuarioActual.CveUsuario) Then
ErrorUsuario = True
Exit For
@@ -3502,7 +3497,7 @@ Partial Class Clientes
If ObjUsuario.UpdateUsuarioPortal(Usuario, "Admin", CorreoUsuario, True, ContraseñaPredeterminadaEncriptada, CveCliente, -1, CveUsr, UsuarioActual.CveUsuario) Then
'ACTUALIZAMOS PERMISOS A ADMIN
- For Each permiso In Permisos
+ For Each permiso As Integer In Permisos
If Not ObjUsuario.UpdateUsuariosProcesos(CveUsr, permiso, True, UsuarioActual.CveUsuario) Then
ErrorUsuario = True
Exit For
@@ -3537,7 +3532,7 @@ Partial Class Clientes
Liga = ObjParametro.Cadena1 & "AIMMGM/Portal.aspx"
End If
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsr & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & NowADS().Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
If UsuarioActual.Empresa.CvePlataforma = 3 Then
EnviaCorreoGPS(Liga, LigaActivar)
@@ -3604,7 +3599,7 @@ Partial Class Clientes
Else
ObjUsuario.Commit()
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & NowADS().Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
EnviaCorreo2(Liga, LigaActivar)
LimpiaAgregarUsuarioPortal()
@@ -3748,7 +3743,7 @@ Partial Class Clientes
'Private Function AgregarCuentaContable(btn As Button, ddl As DropDownList, ByRef CodigoCuentaAltaCompaq As String, ByRef NombreCuentaCuentaAltaCompaq As String, ByRef IdCuentaAltaCompaq As Integer) As Boolean
' Dim IdCuentaContable As Integer = -1
' Dim CtaCodigo As String = ""
- ' Dim TieneError = False
+ ' Dim TieneError as boolean= False
' Dim ProcesoCorrecto As Boolean
' Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa)
@@ -3888,7 +3883,7 @@ Partial Class Clientes
Private Sub GenerarRepCrystal(Formato As String)
Dim LogoRutaFisica As String = String.Format("Empresas\{0}\Logo.png", UsuarioActual.CveEmpresa)
- Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
+ Dim logouri As String = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta))
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -3916,16 +3911,14 @@ Partial Class Clientes
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.rpt", UsuarioActual.Empresa.Ruta))
Dim RutaReporteGrales As New System.IO.FileInfo($"{DirectorioEmpresas}Grales\Formatos\RepClientesCxC.rpt")
-
-
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'OBTENEMOS LOS DATOS
Dim DtCxCFact As DataTable = Nothing
- Dim FI = If(TxtFechaInicioCxP.Text = "" Or TxtFechaInicioCxP.Text = "__/__/____", "-1", TxtFechaInicioCxP.Text)
- Dim FF = If(TxtFechaFinCxP.Text = "" Or TxtFechaFinCxP.Text = "__/__/____", "-1", TxtFechaFinCxP.Text)
+ Dim FI As String = If(TxtFechaInicioCxP.Text = "" Or TxtFechaInicioCxP.Text = "__/__/____", "-1", TxtFechaInicioCxP.Text)
+ Dim FF As String = If(TxtFechaFinCxP.Text = "" Or TxtFechaFinCxP.Text = "__/__/____", "-1", TxtFechaFinCxP.Text)
Dim SaldoIngDolares As Double = 0
Dim SaldoIngPesos As Double = 0
@@ -4051,7 +4044,7 @@ Partial Class Clientes
If DtCxCFact2 IsNot Nothing AndAlso DtCxCFact2.Rows.Count > 0 Then
Dim dr As DataRow = DtCxCFact2.Rows(0)
- Dim lista = New List(Of CrystalParametro)
+ Dim lista As New List(Of CrystalParametro)
Dim SaldoDisponible As String = "0.00"
If TxtLimiteCredito.Text.ToDouble > 0 Then
SaldoDisponible = (TxtLimiteCredito.Text.ToDouble - DtCxCFact2.SUM("Saldo", "Tipo = 'Act'").ToString().ToDouble).FormatoNumero()
@@ -4060,7 +4053,7 @@ Partial Class Clientes
lista.Add(New CrystalParametro("TipoCuentas", DdlTipoCuentasCxC.SelectedItem.Text))
lista.Add(New CrystalParametro("NombreCliente", LtlCliente.Text))
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
- lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString(), FF)))
+ lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", NowADS().ToShortDateString(), FF)))
lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre))
lista.Add(New CrystalParametro("DireccionCliente", String.Format("Calle {0} #{1} Colonia {2}", TxtDireccion.Text, If(TxtNoExt.Text = "", "S/N", TxtNoExt.Text), TxtColonia.Text)))
lista.Add(New CrystalParametro("ClienteCP", TxtCP.Text))
@@ -4098,7 +4091,7 @@ Partial Class Clientes
rds.Value = DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha")
lrds.Add(rds)
- File = StreamBytesStimulsoft("Facturas", $"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", lrds, listass, NombreArchivo:="Estado de cuenta", Formato:=Formato)
+ File = StreamBytesStimul("Facturas", $"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", lrds, listass, NombreArchivo:="Estado de cuenta", Formato:=Formato)
Else
File = ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato)
End If
@@ -4147,7 +4140,7 @@ Partial Class Clientes
For Each item As CrystalParametro In lista
listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString()))
Next
- ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
+ ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
Else
ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
End If
@@ -4158,12 +4151,12 @@ Partial Class Clientes
End If
Else
- Dim lista = New List(Of CrystalParametro)
+ Dim lista As New List(Of CrystalParametro)
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
lista.Add(New CrystalParametro("TipoCuentas", DdlTipoCuentasCxC.SelectedItem.Text))
lista.Add(New CrystalParametro("NombreCliente", LtlCliente.Text))
lista.Add(New CrystalParametro("FechaInicio", If(FI = "-1", "-", FI)))
- lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", DateTime.Now.ToShortDateString(), FF)))
+ lista.Add(New CrystalParametro("FechaFin", If(FF = "-1", NowADS().ToShortDateString(), FF)))
lista.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre))
lista.Add(New CrystalParametro("DireccionCliente", String.Format("Calle {0} #{1} Colonia {2}", TxtDireccion.Text, If(TxtNoExt.Text = "", "S/N", TxtNoExt.Text), TxtColonia.Text)))
lista.Add(New CrystalParametro("ClienteCP", TxtCP.Text))
@@ -4200,7 +4193,7 @@ Partial Class Clientes
For Each item As CrystalParametro In lista
listass.Add(New ReportParameter(item.Nombre, item.Valor.ToString()))
Next
- ImprimirPDFStimulsoft($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
+ ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.mrt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), listass, "Estado de cuenta", Formato)
Else
ImprimirbytesPDF(ImprimirPDFCrystal($"{UsuarioActual.Empresa.Ruta}Formatos/RepClientesCxC.rpt", DtCxCFact2.FiltraParametros("", "CveMoneda,Fecha"), lista, "Estado de cuenta", Formato), "Estado de cuenta", Formato)
End If
@@ -4226,16 +4219,16 @@ Partial Class Clientes
End Using
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "E N V I O C O R R E O"
Private Sub EnviaCorreo(Liga As String, LigaActivar As String)
Try
- Dim Para = TxtEmail.Text.Trim
- Dim Asunto = "ACTIVACIÓN DEL PORTAL DE CLIENTE"
- Dim Usuario = TxtEmail.Text.Trim
+ Dim Para As String = TxtEmail.Text.Trim
+ Dim Asunto As String = "ACTIVACIÓN DEL PORTAL DE CLIENTE"
+ Dim Usuario As String = TxtEmail.Text.Trim
Dim SBBody As New StringBuilder
'Linia de estilos
@@ -4296,11 +4289,11 @@ Partial Class Clientes
a.GuardaLog()
Dim Mail As New ClsSisMail()
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
- End Sub
+ End Sub
#End Region
-
+
#Region " COTIZACIONES "
-
+
Protected Sub BtnVerMasCot_Click(sender As Object, e As EventArgs)
If BtnVerMasCot.Text = "Ver Más" Then
CargaCotizaciones(-1)
@@ -4370,11 +4363,11 @@ Partial Class Clientes
HLFacturar.HRef = $"/Ventas/Ventas.aspx?CveCotizacion={e.Row.DBCampo("CveVenta")}"
End If
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "D I R E C C I O N E N V I O "
-
+
Private Sub CargaCombosDirecionesClientesSAT()
CargaDirClientePais()
CargaDirClienteEstado()
@@ -4526,23 +4519,20 @@ Partial Class Clientes
End Sub
Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click
Dim ObjClientes As New ClsClientes
- Dim TieneError = False
- Dim Estatus = If(ChkEstatus.Checked, 1, 0)
+ Dim TieneError As Boolean = False
+ Dim Estatus As Integer = If(ChkEstatus.Checked, 1, 0)
If CveDireccionEnvio < 0 Then
CveDireccionEnvio = ObjClientes.DireccionEnvioAdd(CveCliente, TxtEnvioDireccion.Text.Trim, TxtEnvioNoExt.Text.Trim, TxtEnvioNoInt.Text.Trim, TxtEnvioColonia.Text.Trim, TxtEnvioCiudad.Text.Trim, TxtEnvioEstado.Text.Trim, TxtEnvioCP.Text.Trim(), TxtEnvioContacto.Text.Trim, UsuarioActual.CveUsuario, Estatus, CveClienteSucursal:=DdlClienteSucursalEnvio.SelectedValue.ToEntero(), EnvioTel:=TxtEnvioTel.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""),
- CvePais:=DdlDirClientePais.SelectedValue.ToEntero, CveEstado:=DdlDirClienteEstado.SelectedValue.ToEntero, CveMunicipio:=DdlDirClienteMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlDirClienteLocalidad.SelectedValue.ToEntero, CveColonia:=DdlDirClienteColonia.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectoClienteSucursal.SelectedValue.ToEntero, COM_NumRegIdTrib:=TxtCom_NumRegIdTrib.Text.Trim())
-
+ CvePais:=DdlDirClientePais.SelectedValue.ToEntero, CveEstado:=DdlDirClienteEstado.SelectedValue.ToEntero, CveMunicipio:=DdlDirClienteMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlDirClienteLocalidad.SelectedValue.ToEntero, CveColonia:=DdlDirClienteColonia.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectoClienteSucursal.SelectedValue.ToEntero, COM_NumRegIdTrib:=TxtCom_NumRegIdTrib.Text.Trim())
If CveDireccionEnvio < 0 Then
TieneError = True
End If
Else
-
If Not ObjClientes.DireccionEnvioUpdate(CveCliente, TxtEnvioDireccion.Text.Trim, TxtEnvioNoExt.Text.Trim, TxtEnvioNoInt.Text.Trim, TxtEnvioColonia.Text.Trim, TxtEnvioCiudad.Text.Trim, TxtEnvioEstado.Text.Trim, TxtEnvioCP.Text.Trim(), TxtEnvioContacto.Text.Trim, UsuarioActual.CveUsuario, Estatus, CveDireccionEnvio, CveClienteSucursal:=DdlClienteSucursalEnvio.SelectedValue.ToEntero(), EnvioTel:=TxtEnvioTel.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""),
CvePais:=DdlDirClientePais.SelectedValue.ToEntero, CveEstado:=DdlDirClienteEstado.SelectedValue.ToEntero, CveMunicipio:=DdlDirClienteMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlDirClienteLocalidad.SelectedValue.ToEntero, CveColonia:=DdlDirClienteColonia.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectoClienteSucursal.SelectedValue.ToEntero, COM_NumRegIdTrib:=TxtCom_NumRegIdTrib.Text.Trim()) Then
TieneError = True
End If
-
End If
If TieneError Then
@@ -4581,7 +4571,7 @@ Partial Class Clientes
End Sub
Private Sub GvDireccionesEnvio_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvDireccionesEnvio.RowDeleting
Dim ObjClientes As New ClsClientes
- Dim TieneError = False
+ Dim TieneError As Boolean = False
Dim CveDireccionEnvio As Integer = GvDireccionesEnvio.Rows(e.RowIndex).DataKey("CveDireccionEnvio").ToEntero()
@@ -4597,12 +4587,12 @@ Partial Class Clientes
End If
CargaDireccionesEnvio()
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region " IMPORTAR SALDOS "
-
+
Private Sub HLImportarSaldos_Click(sender As Object, e As EventArgs) Handles HLImportarSaldos.Click
CargaClientesImportarSaldos()
RegistraScript(String.Format("$('#{0}').modal();", "DivImportarSaldos"))
@@ -4633,7 +4623,7 @@ Partial Class Clientes
UpImportarSaldos.Update()
End Sub
Protected Sub BtnGuardarTransferencias_Click(sender As Object, e As EventArgs)
- Dim EsValida = False
+ Dim EsValida As Boolean = False
For Each Gvr As GridViewRow In GvImportarSaldos.Rows
If Gvr.FCCheckBox("Chk").Checked AndAlso Gvr.FCTextBox("TxtImporte").Text.ToDouble > 0 Then
@@ -4648,7 +4638,7 @@ Partial Class Clientes
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
- Dim TieneError = False
+ Dim TieneError As Boolean = False
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Clientes/ImportarSaldos", 53, TxtCantidad.Text.Trim.ToDouble, TxtCantidad.Text.Trim.ToDouble, 1, TxtFechaImportarSaldos.Text.ToDate(), "Traspaso de saldos de anticipos", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
@@ -4706,9 +4696,9 @@ Partial Class Clientes
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ChkSaldo(this,{0},{1});", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.DBCampo("Saldo")))
e.Row.FCTextBox("TxtImporte").Attributes.Add("onKeyUp", String.Format("CambiaSaldo({0},this,{1});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo")))
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "Cuentas/Equipos"
Public Sub BtnAgregarCtaEquipo_Click(sender As Object, e As EventArgs)
@@ -4726,7 +4716,7 @@ Partial Class Clientes
End Sub
Private Sub BtnGuardarCuenta_Click(sender As Object, e As EventArgs) Handles BtnGuardarCuenta.Click
Dim objCuentasEquipos As New ClsGenerales()
- Dim TieneError = False
+ Dim TieneError As Boolean = False
objCuentasEquipos.IniciaTransacSQL()
If HdnModalidad.Value = "I" Then
@@ -4844,7 +4834,7 @@ Partial Class Clientes
End Sub
Protected Sub GvCuentasEquipos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvCuentasEquipos.RowDeleting
Dim Objeto As New ClsGenerales
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If Objeto.RemoveCuentaEquipo(GvCuentasEquipos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
Alert("La cuenta Equipo se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
@@ -4922,7 +4912,7 @@ Partial Class Clientes
rfvDdlCarcateristicaOpcion1.Enabled = False
RdlCarcateristicaOpcion.Visible = False
- Dim rfvRdlCarcateristicaOpcion = e.Row.FCRequiredFieldValidator("rfvRdlCarcateristicaOpcion")
+ Dim rfvRdlCarcateristicaOpcion As RequiredFieldValidator = e.Row.FCRequiredFieldValidator("rfvRdlCarcateristicaOpcion")
rfvRdlCarcateristicaOpcion.Enabled = False
Dim CalendarioCaractersiticas As AjaxControlToolkit.CalendarExtender = e.Row.FCCalendarExtender("CalendarioCaractersiticas")
@@ -5056,7 +5046,7 @@ Partial Class Clientes
rfvDdlCarcateristicaOpcion2.Enabled = False
RdlCarcateristicaOpcion2.Visible = False
- Dim rfvRdlCarcateristicaOpcion = e.Row.FCRequiredFieldValidator("rfvRdlCarcateristicaOpcion2")
+ Dim rfvRdlCarcateristicaOpcion As RequiredFieldValidator = e.Row.FCRequiredFieldValidator("rfvRdlCarcateristicaOpcion2")
rfvRdlCarcateristicaOpcion.Enabled = False
Dim cvFechaF As CompareValidator = e.Row.FCCompareValidator("cvFechaF2")
@@ -5132,7 +5122,7 @@ Partial Class Clientes
End If
End Sub
Private Function GuardaCaracteristicas(Modalidad As String, CveCuentaEquipo As Integer, ByRef ObjCarac As ClsGenerales) As Boolean
- Dim Retorno = False
+ Dim Retorno As Boolean = False
If Modalidad.ToString() = "I" Then
For Each gvr As GridViewRow In GvAddCuentaCaracteristica.Rows
@@ -5146,7 +5136,7 @@ Partial Class Clientes
Dim CveCaracteristicaOpcion As Integer = -1
Dim CaracteristicaValor As String = ""
- Dim CaracteristicaValorDate As Date = Now
+ Dim CaracteristicaValorDate As Date = NowADS()
Dim CaracteristicaValorInt As Integer = -1
Dim AgregaCaracteristica As Boolean = False
@@ -5246,7 +5236,7 @@ Partial Class Clientes
Dim CveCaracteristicaOpcion As Integer = -1
Dim CaracteristicaValor As String = ""
- Dim CaracteristicaValorDate As Date = Now
+ Dim CaracteristicaValorDate As Date = NowADS()
Dim CaracteristicaValorInt As Integer = -1
Select Case _CveCaracteristicaTipo
@@ -5499,7 +5489,7 @@ Partial Class Clientes
RowSucursal("CveVendedorSucursal") = DdlVendedorSucursal.SelectedValue.ToEntero()
RowSucursal("CveMetodoPago") = DdlMetodoPagoSucursal.SelectedValue.ToEntero()
RowSucursal("CveUsuario") = UsuarioActual.CveUsuario
- RowSucursal("FechaIng") = Now.ToShortDateString()
+ RowSucursal("FechaIng") = NowADS().ToShortDateString()
RowSucursal("Usuario") = UsuarioActual.Usuario
RowSucursal("CveUsoCFDI") = DdlSucursalUsoCFDI.SelectedValue.ToEntero()
@@ -5525,7 +5515,7 @@ Partial Class Clientes
Dim Cuerpo As String = TxtBody2.Text
Dim Asunto As String = ""
- Dim TipoComprobante = ""
+ Dim TipoComprobante As String = ""
If HdnTipoDocto2.Value.ToString() = "Ing" Then TipoComprobante = "Factura"
If HdnTipoDocto2.Value.ToString() = "Egs" Then TipoComprobante = "Nota de Crédito"
@@ -5745,8 +5735,8 @@ Partial Class Clientes
Private Sub EnviaCorreoGPS(Liga As String, LigaActivar As String)
Try
- Dim Para = TxtEmail.Text.Trim
- Dim Asunto = "ACTIVACIÓN DEL PORTAL GPS"
+ Dim Para As String = TxtEmail.Text.Trim
+ Dim Asunto As String = "ACTIVACIÓN DEL PORTAL GPS"
Dim SBBody As New StringBuilder
'Linia de estilos
SBBody.Append("")
@@ -6010,12 +6000,12 @@ Partial Class Clientes
Private Sub SetValues()
ViewState("Orden") = ""
ViewState("OrdenUsuarios") = ""
- TxtFechaPago.Text = Now.ToShortDateString()
- txtFechaI.Text = Now.ToShortDateString()
- txtFechaF.Text = Now.ToShortDateString()
- TxtFechaImportarSaldos.Text = Now.ToShortDateString()
- TxtFechaIUsados.Text = Now.FirstDayOfMonth.ToShortDateString()
- TxtFechaFUsados.Text = Now.LastDayOfMonth.ToShortDateString()
+ TxtFechaPago.Text = NowADS().ToShortDateString()
+ txtFechaI.Text = NowADS().ToShortDateString()
+ txtFechaF.Text = NowADS().ToShortDateString()
+ TxtFechaImportarSaldos.Text = NowADS().ToShortDateString()
+ TxtFechaIUsados.Text = NowADS().FirstDayOfMonth.ToShortDateString()
+ TxtFechaFUsados.Text = NowADS().LastDayOfMonth.ToShortDateString()
CobranzaTelefono = ""
CodigoCliente = ""
@@ -6024,6 +6014,10 @@ Partial Class Clientes
divCorreoEntregaAlmacen.Visible = True
End If
+ If UsuarioActual.CveEmpresa = 119 Then
+ DdlSATPais.Items.Add(New ListItem("Guatemala", "GTM"))
+ End If
+
End Sub
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
@@ -6039,24 +6033,24 @@ Partial Class Clientes
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable
Dim Conexion As Odbc.OdbcConnection = Nothing
- Dim ErrorArchivo = False
+ Dim ErrorArchivo As Boolean = False
Try
Select Case Tipo
Case "CSV"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
Conexion.Open()
- Dim cmd = Conexion.CreateCommand()
+ Dim cmd As Odbc.OdbcCommand = Conexion.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = $"SELECT * FROM [{FileName}]"
- Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
+ Dim DataAdapter As New Odbc.OdbcDataAdapter(cmd)
DataAdapter.Fill(dt)
Case "EXCEL"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
Conexion.Open()
- Dim cmd = Conexion.CreateCommand()
+ Dim cmd As Odbc.OdbcCommand = Conexion.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT * FROM [Hoja1$]"
- Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
+ Dim DataAdapter As New Odbc.OdbcDataAdapter(cmd)
DataAdapter.Fill(dt)
Case Else
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
@@ -6116,8 +6110,8 @@ Partial Class Clientes
Private Sub EnviaCorreo2(Liga As String, LigaActivar As String)
Try
- Dim Para = TxtCorreoUsuarioPortal.Text.Trim
- Dim Asunto = "ACTIVACIÓN DEL PORTAL DE CLIENTE"
+ Dim Para As String = TxtCorreoUsuarioPortal.Text.Trim
+ Dim Asunto As String = "ACTIVACIÓN DEL PORTAL DE CLIENTE"
Dim SBBody As New StringBuilder
'Linia de estilos
SBBody.Append("")
@@ -6192,15 +6186,15 @@ Partial Class Clientes
End Sub
Protected Sub BtnCobranzaSMS_Click(sender As Object, e As EventArgs)
- Dim Telefono = CobranzaTelefono
+ Dim Telefono As String = CobranzaTelefono
If Telefono.Length <> 10 Then
Alert("El telefono de cobranza no tiene el formato correcto y es necesario.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim DtCxC As DataTable
- Dim FI = If(TxtFechaInicioCxP.Text = "" Or TxtFechaInicioCxP.Text = "__/__/____", "-1", TxtFechaInicioCxP.Text)
- Dim FF = If(TxtFechaFinCxP.Text = "" Or TxtFechaFinCxP.Text = "__/__/____", "-1", TxtFechaFinCxP.Text)
+ Dim FI As String = If(TxtFechaInicioCxP.Text = "" Or TxtFechaInicioCxP.Text = "__/__/____", "-1", TxtFechaInicioCxP.Text)
+ Dim FF As String = If(TxtFechaFinCxP.Text = "" Or TxtFechaFinCxP.Text = "__/__/____", "-1", TxtFechaFinCxP.Text)
Dim StrSaldo As String = ""
Dim ObjMovtos As New ClsMovimientos()
@@ -6220,10 +6214,10 @@ Partial Class Clientes
End If
If StrSaldo.Length > 0 Then
- Dim Mensaje = ""
+ Dim Mensaje As String = ""
Select Case UsuarioActual.CveEmpresa
Case 4
- Mensaje = $"Cliente de VSH Seguridad su saldo pendiente es de $ {StrSaldo} fecha limite 25/{Now.ToString("MM/yyyy")} llamar al 6622106400 #REFERENCIA {CodigoCliente} "
+ Mensaje = $"Cliente de VSH Seguridad su saldo pendiente es de $ {StrSaldo} fecha limite 25/{NowADS().ToString("MM/yyyy")} llamar al 6622106400 #REFERENCIA {CodigoCliente} "
End Select
Dim ObjSMS As New ClsTecnoMovil
@@ -6241,19 +6235,15 @@ Partial Class Clientes
Else
Alert("No hay saldo pendiente del cliente. Por lo cual no se envió el mensaje.", TipoMensaje.MsgInformacion)
End If
-
-
End Sub
#End Region
#Region "IMPRIMIR GVHistorial"
-
-
- Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
+ Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
Dim retorno As Byte() = Nothing
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
- Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+ Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'OBTENEMOS LOS DATOS
@@ -6294,7 +6284,7 @@ Partial Class Clientes
Protected Function ImprimirReporteHistorial() As Byte()
Dim retorno As Byte() = Nothing
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
- Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+ Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim ObjClientes As New ClsClientes()
'OBTENEMOS LOS DATOS
@@ -6403,7 +6393,7 @@ Partial Class Clientes
CargaMonedas()
End Sub
Protected Sub LbAgregarCuentaBanco_Click(sender As Object, e As EventArgs)
- Dim EsBancomer = False
+ Dim EsBancomer As Boolean = False
If TxtNombreBanco.Text.ToUpper.Contains("BBVA") Or TxtNombreBanco.Text.ToUpper.Contains("BANCOMER") Or (TxtCLABE.Text.Length = 18 AndAlso TxtCLABE.Text.Substring(0, 3) = "012") Then
EsBancomer = True
@@ -6515,7 +6505,7 @@ Partial Class Clientes
Else
- Dim index = CveCuentaBancaria
+ Dim index As Integer = CveCuentaBancaria
Dim Row As DataRow = TempDTCuentasBancos.Rows(index)
Row("BancoNombre") = NombreBanco
Row("Sucursal") = NumeroSucursal
@@ -6555,7 +6545,7 @@ Partial Class Clientes
If e.Row.RowType = DataControlRowType.DataRow Then
If CveCliente < 0 Then
- For index = 1 To TempDTCuentasBancos.Rows.Count
+ For index As Integer = 1 To TempDTCuentasBancos.Rows.Count
TempDTCuentasBancos.Rows(index - 1)("CveCuentaDeposito") = index
Next
TempDTCuentasBancos.AcceptChanges()
@@ -6585,7 +6575,7 @@ Partial Class Clientes
Alert("No se pudo borrar la Cuenta Bancaria. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
Else
- Dim index = GvRow.RowIndex
+ Dim index As Integer = GvRow.RowIndex
TempDTCuentasBancos.Rows.RemoveAt(index)
Alert("Cuenta Bancaria borrada con éxito.", TipoMensaje.MsgInformacion)
End If
@@ -6615,16 +6605,12 @@ Partial Class Clientes
UpCuentasBancos.Update()
End Sub
-
Private Sub CargaMonedas()
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
DdlMoneda.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
-
-
-
Private Sub LnkCuentasBancarias_Click(sender As Object, e As EventArgs) Handles LnkCuentasBancarias.Click
Modalidad = "A"
TxtNombreBanco.Text = ""
@@ -6675,14 +6661,14 @@ Partial Class Clientes
Dim params As New List(Of ReportParameter)
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
- Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+ Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("AgrupadoPor", String.Format("Cliente: {0}", TxtNombreComercial.Text)))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime().ToShortDateString()))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime().ToShortDateString()))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
+ ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & NowADS().ToString("yyyyMMddhhmmss"), Formato:=Formato)
End Sub
@@ -6694,12 +6680,12 @@ Partial Class Clientes
Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing
- Dim TmpDTImpuestos = New DataTable
+ Dim TmpDTImpuestos As New DataTable
TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
- Dim TmpDTImpuestosIVAIEPS = New DataTable
+ Dim TmpDTImpuestosIVAIEPS As New DataTable
TmpDTImpuestosIVAIEPS.Columns.Add("Impuesto", GetType(String))
TmpDTImpuestosIVAIEPS.Columns.Add("tasa", GetType(String))
TmpDTImpuestosIVAIEPS.Columns.Add("Importe", GetType(Double))
@@ -6814,7 +6800,7 @@ Partial Class Clientes
Dim dtImpuesto As DataTable = ObjVentas.DtResultados
If dtImpuesto.Rows.Count > 0 Then
For Each Row As DataRow In dtImpuesto.Rows
- Dim Orden = 80
+ Dim Orden As Integer = 80
If Row("Importe").ToString().ToDouble <> 0 Then
DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString()
DR("Importe") = Row("Importe").ToString().ToDouble
@@ -7317,24 +7303,21 @@ Partial Class Clientes
'Dim DDLEstatus As DropDownList = DirectCast(GvRow.FindControl("DDLEstatus"), DropDownList)
Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
- Dim UrlArchivo = UsuarioActual.Empresa.Ruta & "\DocElectronica\Clientes\" & CveCliente & "/" & _Adjunto
+ Dim UrlArchivo As String = UsuarioActual.Empresa.Ruta & "\DocElectronica\Clientes\" & CveCliente & "/" & _Adjunto
If File.Exists(UrlArchivo) Then
Try
File.Delete(UrlArchivo)
Catch ex As Exception
End Try
-
End If
Dim ObjEdoc As New ClsEdocumentacion
-
If Not _CveDocumentacionElectronica = -1 Then
If ObjEdoc.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, -1, CveCliente, -1, 0, "", "", UsuarioActual.CveUsuario, _fechaLimite) Then
Alert("Documento Eliminado Correctamente.", TipoMensaje.MsgInformacion)
End If
-
End If
CargaDocumentacionCliente()
@@ -7349,7 +7332,6 @@ Partial Class Clientes
If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then
-
stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx"
linkDescargaPagare = stringDescargaDocumento
TxtDireccionAval.Text = ""
@@ -7364,10 +7346,9 @@ Partial Class Clientes
linkDescargaPagare = stringDescargaDocumento
- Dim File = New FileInfo(linkDescargaPagare)
+ Dim File As New FileInfo(linkDescargaPagare)
If File.Exists Then
-
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + File.Name)
Response.AddHeader("Content-Length", File.Length.ToString())
@@ -7375,13 +7356,8 @@ Partial Class Clientes
Response.Flush()
Response.TransmitFile(File.FullName)
Response.End()
-
End If
End If
-
-
-
-
End Sub
Protected Sub ImprimirPagare(sender As Object, e As EventArgs) Handles BtnAgregarPagare.Click
@@ -7409,7 +7385,7 @@ Partial Class Clientes
Dim estado As String = ""
Dim Telefono As String = ""
Dim mesArray = New String() {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}
- Dim hoy As DateTime = DateTime.Now
+ Dim hoy As DateTime = NowADS()
Dim fechaConFormato As String = String.Format("{0} de {1} del {2}", hoy.Day, mesArray(hoy.Month), hoy.Year)
Dim cpCliente As String = ""
@@ -7507,15 +7483,10 @@ Partial Class Clientes
Dim existeAdjunto As Boolean = False
Dim TxtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
- Dim imgCalendario As LinkButton = e.Row.FCLinkButton("imgCalendario")
-
-
-
-
-
-
- ' FechaVigencia
-
+ Dim imgCalendario As LinkButton = e.Row.FCLinkButton("imgCalendario")
+
+ ' FechaVigencia
+
Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString().ToEntero()
Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString() = "1", True, False)
Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False)
@@ -7548,16 +7519,14 @@ Partial Class Clientes
Else
LnkDownLoadDoc.Visible = True
ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
-
-
End If
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString().ToDate().ToString("dd/MM/yyyy")
If Adjunto.Trim.Length > 0 Or (Documentacion = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140) Then
- Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "\DocElectronica\Clientes\" & CveCliente & "/" & Adjunto
- Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\DocElectronica\Clientes\" & CveCliente & "/" & Adjunto
+ Dim linkDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "\DocElectronica\Clientes\" & CveCliente & "/" & Adjunto
+ Dim linkDescargaArchivo As String = UsuarioActual.Empresa.Ruta & "\DocElectronica\Clientes\" & CveCliente & "/" & Adjunto
If File.Exists(linkDescargaArchivo) Or (Documentacion = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140) Then
LnkDownLoadDoc.Visible = True
@@ -7590,50 +7559,31 @@ Partial Class Clientes
End Sub
Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
-
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim Adjunto As String = GvRow.DataKey("Adjunto")
-
- Dim stringDescargaDocumento As String = ""
-
- Dim asdasd = GvRow.DataKey("Documentacion")
-
- If GvRow.DataKey("Documentacion").ToUpper = "Pagaré".ToUpper AndAlso UsuarioActual.CveEmpresa = 140 Then
-
-
- stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx"
- linkDescargaPagare = stringDescargaDocumento
+ Dim Adjunto As String = GvRow.DataKey("Adjunto")
+
+ If GvRow.DataKey("Documentacion").ToUpper = "Pagaré".ToUpper AndAlso UsuarioActual.CveEmpresa = 140 Then
+
+ linkDescargaPagare = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx"
TxtDireccionAval.Text = ""
TxtAval.Text = ""
TxtCiudadAval.Text = ""
TxtTelefonoAval.Text = ""
-
RegistraScript("$('#ModalDivPagare').modal('show')")
Else
-
-
- Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero()
+ 'Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero()
Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato")
-
DescarFormato(DocumentacionFormato)
- End If
-
-
-
-
-
-
+ End If
+
End Sub
Public Sub DescarFormato(documento As String)
Dim PathRoot As String = Server.MapPath("/")
Dim PathSource As String
Dim pathDesti As String
- Dim fname As String = ""
-
-
-
+ Dim fname As String = ""
PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
pathDesti = PathRoot & "Temp\" & CveCliente & documento
@@ -7652,7 +7602,7 @@ Partial Class Clientes
Try
Dim objDoc As New clsGemBoxDocument(pathDesti)
Dim objRH As New ClsRH
- Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
+ Dim FechaActual As String = NowADS().Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & NowADS().Year.ToString()
objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(-1, UsuarioActual.CveEmpresa)) ' Pendiente
@@ -7662,14 +7612,10 @@ Partial Class Clientes
Catch ex As Exception
End Try
-
-
-
End If
- Dim FileD = New FileInfo(pathDesti)
-
+ Dim FileD As New FileInfo(pathDesti)
If FileD.Exists Then
Response.Clear()
@@ -7721,7 +7667,7 @@ Partial Class Clientes
For Each gvr As GridViewRow In GvDocsVentas.Rows
If gvr.FCCheckBox("ChkDoc").Checked Then
- If objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").ToEntero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, Now, Observacion2:=gvr.FCTextBox("TxtObs2").Text) <= 0 Then HuboError = True
+ If objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").ToEntero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, NowADS(), Observacion2:=gvr.FCTextBox("TxtObs2").Text) <= 0 Then HuboError = True
End If
@@ -7731,7 +7677,7 @@ Partial Class Clientes
For Each gvr As GridViewRow In GvDocsVentas.Rows
'sino está registrada y se selecciona, se va a insertar
If gvr.DataKey("CveDocumentacionElectronica").ToEntero() <= 0 AndAlso gvr.FCCheckBox("ChkDoc").Checked Then
- If objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").ToEntero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, Now, Observacion2:=gvr.FCTextBox("TxtObs2").Text) <= 0 Then HuboError = True
+ If objDoc.DocumentacionElectronicaAdd(gvr.DataKey("CveDocumentacion").ToEntero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, NowADS(), Observacion2:=gvr.FCTextBox("TxtObs2").Text) <= 0 Then HuboError = True
Else
', Observacion2:=gvr.FCTextBox("TxtObs2").Text
If Not objDoc.DocumentacionElectronicaUpdate(gvr.DataKey("CveDocumentacionElectronica").ToEntero(), gvr.DataKey("CveDocumentacion").ToEntero(), -1, CveCliente, -1, 1, gvr.FCTextBox("TxtObs").Text, "", UsuarioActual.CveUsuario, gvr.DataKey("FechaLimite").ToDate(), Observacion2:=gvr.FCTextBox("TxtObs2").Text) Then HuboError = True
@@ -7827,10 +7773,7 @@ Partial Class Clientes
Next
Else
Respuesta = True
- End If
-
-
-
+ End If
UpModalCXCClienteDocumento.Update()
Return Respuesta
@@ -8397,7 +8340,7 @@ Partial Class Clientes
Return
End If
Dim TieneError As Boolean = False
- Dim ObjGPS = New ClsGPS()
+ Dim ObjGPS As New ClsGPS()
Dim ObjEventos As New ClsOIEventos(ObjGPS.IniciaTransacSQL())
If ObjGPS.UpdateClienteDispositivo(CveDispositivo, CveCliente) Then
@@ -8427,7 +8370,7 @@ Partial Class Clientes
#Region "CRM"
Protected Sub CargaDatosCRM()
- Dim ObjCRM = New ClsCRM()
+ Dim ObjCRM As New ClsCRM()
If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, CveEmpresaCRM) And ObjCRM.DtResultados.Rows.Count > 0 Then
TxtNombre.Text = ObjCRM.DtResultados.FiltroPrimeroValor("Empresa").ToString()
@@ -8447,7 +8390,7 @@ Partial Class Clientes
End Sub
Protected Sub VerificaVinculacion()
- Dim ObjCRM = New ClsCRM()
+ Dim ObjCRM As New ClsCRM()
If ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa, -1) And ObjCRM.DtResultados.Rows.Count > 0 Then
If ObjCRM.DtResultados.FiltraParametros(String.Format("CveCliente = {0}", CveCliente)).Rows.Count > 0 Then
@@ -8461,8 +8404,8 @@ Partial Class Clientes
Protected Function VincularEmpresaCRM() As Boolean
Dim Ok As Boolean = False
- Dim ObjCRM = New ClsCRM()
- Dim ObjBitacora = New ClsOIEventos(ObjCRM.IniciaTransacSQL())
+ Dim ObjCRM As New ClsCRM()
+ Dim ObjBitacora As New ClsOIEventos(ObjCRM.IniciaTransacSQL())
If (CveCliente > 0) Then
Dim CveEmpresaCRMVincular As Integer = If(CveEmpresaCRM > 0, CveEmpresaCRM, If(CveEmpresaCRMUnificar > 0, CveEmpresaCRMUnificar, -1))
@@ -8490,7 +8433,7 @@ Partial Class Clientes
End Function
Protected Sub CargaModalEmpresasCRM()
- Dim ObjCRM = New ClsCRM()
+ Dim ObjCRM As New ClsCRM()
If (ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa) And ObjCRM.DtResultados.Rows.Count > 0) Then
DtEmpresasCRM = ObjCRM.DtResultados.FiltraParametros(String.Format("CveCliente IS NULL"))
@@ -8826,7 +8769,7 @@ Partial Class Clientes
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
If drPS IsNot Nothing Then
- Dim Precio = drPS("Precio").ToString().ToDouble
+ Dim Precio As Double = drPS("Precio").ToString().ToDouble
LbPrecioG.Text = Precio.FormatoNumero()
LbPrecioA.Text = ((Precio * TxtPorcentajePS.Text.ToDecimal()) / 100).FormatoNumero()
End If
@@ -9084,8 +9027,8 @@ Partial Class Clientes
If ObjFactura.CveCliente > 0 Then
If TmpDT.Rows.Count > 0 Then
- Dim Retorno = ObjFactura.EmitirFactura(False)
- For Each Mensaje In Retorno.Mensajes
+ Dim Retorno As Modelos.Factura.MMensajeFactura = ObjFactura.EmitirFactura(False)
+ For Each Mensaje As String In Retorno.Mensajes
Alert(Mensaje, If(Retorno.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion))
Next
End If
@@ -9501,7 +9444,7 @@ Partial Class Clientes
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
ObjFactura.CveVenta = -1
- ObjFactura.Version = "3.3"
+ ObjFactura.Version = "4.0"
ObjFactura.TipoCambio = 1
ObjFactura.TipoCambioDolares = 0
ObjFactura.ConvertirPesos = False
@@ -9514,7 +9457,7 @@ Partial Class Clientes
ObjFactura.Folio = Folio
ObjFactura.Serie = Serie
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = NowADS()
ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate()
ObjFactura.CveMetodoPago33 = DdlMetodoPago33.SelectedValue.ToEntero()
@@ -9556,26 +9499,26 @@ Partial Class Clientes
ObjFactura.TipoDocumento = ""
End Select
- ObjFactura.Fech1 = Now
- ObjFactura.Fech2 = Now
- ObjFactura.Fech3 = Now
+ ObjFactura.Fech1 = NowADS()
+ ObjFactura.Fech2 = NowADS()
+ ObjFactura.Fech3 = NowADS()
'NUM 1- CARGO 2- BONIFICACION
ObjFactura.Num1 = Tipo
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = NowADS()
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero()
- ObjFactura.Vigencia = Now
+ ObjFactura.Vigencia = NowADS()
ObjFactura.CveVendedor = DdlVendedor.SelectedValue.ToEntero()
If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False
End If
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = NowADS()
ObjFactura.CveSubProyecto = UsuarioActual.CveSubProyecto
ObjFactura.CveSubProyectoCobranza = UsuarioActual.CveSubProyecto
ObjFactura.CveSubProyectoEjecucion = UsuarioActual.CveSubProyecto
@@ -9612,7 +9555,6 @@ Partial Class Clientes
ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "03"
ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
-
End If
If ObjFactura.TipoDocto.Contiene("Egs", "RNC") Then
@@ -9692,7 +9634,7 @@ Partial Class Clientes
params.Add(New ReportParameter("AgrupadoPor", "Cliente: " & LtlCliente.Text))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas\Grales\Formatos\" & NombreFormato & ".rdlc", DtTemp, params, NombreFormato & "_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
+ ImprimirPDF("Empresas\Grales\Formatos\" & NombreFormato & ".rdlc", DtTemp, params, NombreFormato & "_" & NowADS().ToString("yyyyMMddhhmmss"), Formato:=Formato)
Else
Alert("No se encontró información.", TipoMensaje.MsgAdvertencia)
End If
@@ -9701,7 +9643,7 @@ Partial Class Clientes
Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
Dim Acum As New ClsAcumuladores
Dim Puntos As Decimal = -GvUsadosResumen.Rows.Cast(Of GridViewRow).Where(Function(x) x.RowType = DataControlRowType.DataRow).FirstOrDefault(Function(gvr) gvr.RowIndex = 3).DataKey("Puntos").ToEntero()
- If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, Puntos, 0, 0, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado", Now) Then
+ If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, Puntos, 0, 0, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado", NowADS()) Then
Alert("Puntuación Inicializada")
End If
Acum.Dispose()
@@ -9870,12 +9812,12 @@ Partial Class Clientes
New JProperty("TipoDocto", "-1")
)
- Dim Url = New Uri(String.Format("{0}api/cliente/GetHistorialVentas?CveCliente={1}&SelectTop={2}&CveClienteSucursal={3}&TipoDocto={4}", "https://localhost:5001/", CveCliente, SelectTop, CveClienteSucursal, "-1"))
+ Dim Url As New Uri(String.Format("{0}api/cliente/GetHistorialVentas?CveCliente={1}&SelectTop={2}&CveClienteSucursal={3}&TipoDocto={4}", "https://localhost:5001/", CveCliente, SelectTop, CveClienteSucursal, "-1"))
- Dim response = cliente.GetAsync(Url).Result
+ Dim response As HttpResponseMessage = cliente.GetAsync(Url).Result
If response.StatusCode = 200 Then
- Dim json = response.Content.ReadAsStringAsync().Result
+ Dim json As String = response.Content.ReadAsStringAsync().Result
retorno = Newtonsoft.Json.JsonConvert.DeserializeObject(Of DataTable)(json)
End If
@@ -9907,9 +9849,9 @@ Partial Class Clientes
Dim response As HttpResponseMessage = cliente.PostAsync(Url, New StringContent(Parametros.ToString(), Encoding.UTF8, "application/json")).Result
If response.StatusCode = 200 Then
- Dim json = response.Content.ReadAsStringAsync().Result
+ Dim json As String = response.Content.ReadAsStringAsync().Result
- Dim result = JsonConvert.DeserializeObject(Of MResult)(json)
+ Dim result As MResult = JsonConvert.DeserializeObject(Of MResult)(json)
If result.isSuccess Then
@@ -10277,7 +10219,7 @@ Partial Class Clientes
End If
Else
If DdlTipoLineaAdicionalModal.SelectedValue = "2" Then
- TxtFechaVencimientoLineaAdicionalModal.Text = Now.AddDays(TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero()).ToString("dd/MM/yyyy")
+ TxtFechaVencimientoLineaAdicionalModal.Text = NowADS().AddDays(TxtDiasVencimientoLineaAdicionalModal.Text.ToEntero()).ToString("dd/MM/yyyy")
End If
If Not ObjVentas.AddLineasAdicionales(TxtLineaAdicionalModal.Text, CveCliente, DdlProveedorLineaAdicionalModal.SelectedValue.ToEntero, DdlTipoLineaAdicionalModal.SelectedValue.ToEntero, TxtImporteLineaAdicionalModal.Text.ToDecimal,
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index c3c42f32b..b46a81102 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -187,10 +187,10 @@ Partial Class Ventas_ClientesAbonar
DdlProveedorIntermediario.SelectedText = "Seleccione"
DdlProveedorIntermediario.SelectedValue = "-1"
- FechaCorteIE = DateTime.Now
+ FechaCorteIE = NowADS()
- Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day)
- Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate
+ Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, NowADS().Day - 1, NowADS().Day)
+ Fecha = (dia.ToString + "/" + NowADS().Month.ToString + "/" + NowADS().Year.ToString).ToDate
'If UsuarioActual.Empresa.Funcionalidad(712) = "1" Then
' PorletIntermediario.Visible = True
@@ -230,7 +230,7 @@ Partial Class Ventas_ClientesAbonar
RegistraScript($"TipoCambioActual = {GlobalTipoCambio(Fecha).FormatoNumero(4)}")
End If
- RVTxtFechaDocumento.MaximumValue = Now.ToString("dd/MM/yyyy")
+ RVTxtFechaDocumento.MaximumValue = NowADS().ToString("dd/MM/yyyy")
If UsuarioActual.CveEmpresa.Contiene(13, 83, 158) Then
LnkAccionesModalSeleccionLayout.Visible = True
End If
@@ -297,7 +297,7 @@ Partial Class Ventas_ClientesAbonar
CargaCuentas()
CargaTipoTransaccion()
- TxtFechaDocumento.Text = Now.ToShortDateString.ToString
+ TxtFechaDocumento.Text = NowADS().ToShortDateString.ToString
TxtAboneA.Enabled = False
LbEncabezado.Text = String.Format("{1}", CveCliente, ObjCliente.NombreComercial)
@@ -355,7 +355,7 @@ Partial Class Ventas_ClientesAbonar
Dim FechaI As String = IfNull(Request("FechaI"), "-1").ToString
Dim FechaF As String = IfNull(Request("FechaF"), "-1").ToString
- Dim FechaCorte As Date = DateTime.Now.AddYears(1).ToShortDateString.ToString.ToDate
+ Dim FechaCorte As Date = NowADS().AddYears(1).ToShortDateString.ToString.ToDate
Dim SumDescuentoProntoPago As Double = 0.0
If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte) Then
@@ -1367,21 +1367,21 @@ Partial Class Ventas_ClientesAbonar
Dim Serie As String = "-1"
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
- ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
+ ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(NowADS()).FormatoNumero(4).ToDecimal())
ObjFacturaDevolucion.ConvertirPesos = False
ObjFacturaDevolucion.CveMoneda = CveMoneda
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
ObjFacturaDevolucion.Serie = Serie
ObjFacturaDevolucion.Folio = Folio
- ObjFacturaDevolucion.Fecha = Now
+ ObjFacturaDevolucion.Fecha = NowADS()
ObjFacturaDevolucion.CvePrePoliza = -1
ObjFacturaDevolucion.CveMetodoPago = 0
ObjFacturaDevolucion.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
ObjFacturaDevolucion.FormaPago = 0
ObjFacturaDevolucion.TipoDocto = "Egs"
- ObjFacturaDevolucion.Fecha = Now
+ ObjFacturaDevolucion.Fecha = NowADS()
ObjFacturaDevolucion.Version = "4.0"
@@ -1458,7 +1458,7 @@ Partial Class Ventas_ClientesAbonar
ObjFacturaDevolucion.TipoDocumento = ""
End Select
- ObjFacturaDevolucion.FechaPago = Now
+ ObjFacturaDevolucion.FechaPago = NowADS()
ObjFacturaDevolucion.CveCorte = -1
'ObjFacturaDevolucion.CveMesa = -1
@@ -1959,12 +1959,12 @@ Partial Class Ventas_ClientesAbonar
TxtObservaciones.Text = ""
TxtImporte.Text = ""
TxtTotal.Text = ""
- TxtFechaDocumento.Text = Now.ToShortDateString
+ TxtFechaDocumento.Text = NowADS().ToShortDateString
DdlCuenta.SelectedValue = "-1"
DdlTipoTransaccion.SelectedValue = "-1"
CFDIRelacionadoSustitucion = "-1"
- FechaCorteIE = DateTime.Now.ToDate
+ FechaCorteIE = NowADS().ToDate
IDPoliza = -1
FolioIECancelado = ""
@@ -2204,7 +2204,7 @@ Partial Class Ventas_ClientesAbonar
'For i = 0 To CveVentas.Count - 1
Dim ObjBancos As New ClsBancos
- If ObjBancos.GetComplementoPagosRep(-1, Now.AddYears(-2), Now, CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then
+ If ObjBancos.GetComplementoPagosRep(-1, NowADS().AddYears(-2), NowADS(), CveIE, -1, 1, UsuarioActual.CveEmpresa, -1) Then
If Not ObjBancos.DtResultados.Rows.Count > 0 Then
ObjBancos.Dispose()
Alert("No se generaron complementos de pago porque no hay facturas con método de pago PPD", TipoMensaje.MsgAdvertencia)
@@ -2586,8 +2586,8 @@ Partial Class Ventas_ClientesAbonar
End Sub
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
- RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
- Calendario.EndDate = DateTime.Now
+ RVTxtFechaDocumento.MaximumValue = NowADS().ToShortDateString
+ Calendario.EndDate = NowADS()
End Sub
diff --git a/Ventas/FacturacionAcarreos.aspx.vb b/Ventas/FacturacionAcarreos.aspx.vb
index dc5bccc2d..014548d4b 100644
--- a/Ventas/FacturacionAcarreos.aspx.vb
+++ b/Ventas/FacturacionAcarreos.aspx.vb
@@ -23,7 +23,7 @@ Partial Class Ventas_FacturacionAcarreos
CveCliente = DdlClientes.SelectedValue.ToEntero()
End If
Using ObjVentas As New ClsVentas
- If ObjVentas.GetFacturacionAcarreos(-1, CveCliente, -1, DdlEstatus.SelectedValue.ToEntero(), Now, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.GetFacturacionAcarreos(-1, CveCliente, -1, DdlEstatus.SelectedValue.ToEntero(), NowADS(), UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjVentas.DtResultados
End If
End Using
diff --git a/Ventas/MetasVendedores.aspx.vb b/Ventas/MetasVendedores.aspx.vb
index 181ecb94b..8bf8abec4 100644
--- a/Ventas/MetasVendedores.aspx.vb
+++ b/Ventas/MetasVendedores.aspx.vb
@@ -20,7 +20,7 @@ Partial Class MetasVendedores
End If
End Sub
Private Sub CargaDatosFiltros()
- Dim dNow As Date = Now
+ Dim dNow As Date = NowADS()
TxtFechaMes.Text = dNow.ToString("dd/MM/yyyy")
DdlSubProyectoFiltro.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index de98864d3..51ff78109 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -1108,7 +1108,7 @@ Partial Class PV
End If
'proceso 163, que activa al edicion de folios.
- TxtFecha.Text = Now.ToShortDateString()
+ TxtFecha.Text = NowADS().ToShortDateString()
LblUsuario.Text = UsuarioActual.Usuario
TxtCantidad.Attributes.Add("onKeyUp ", "Recalcula();")
TxtPrecio.Attributes.Add("onKeyUp ", "Recalcula();")
@@ -2157,7 +2157,7 @@ Partial Class PV
If ObjPVenta.DtResultados.Rows.Count > 0 Then
CveCorte = ObjPVenta.CveCorte
Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-1)
- If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < Now.Date Then
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then
DebeCerrarCorte = True
LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte."
Else
@@ -2187,9 +2187,9 @@ Partial Class PV
Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click
Dim ObjPVenta As New ClsPuntoVenta
- ObjPVenta.AddVtaCortes(Now, TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa)
+ ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa)
CveCorte = ObjPVenta.CveCorte
- LblEstatusCaja.Text = Now.ToShortDateString
+ LblEstatusCaja.Text = NowADS().ToShortDateString
TrEstatusCaja.Visible = True
LkbEstadodeCaja.Visible = True
LkbIngreso.Visible = True
@@ -2303,7 +2303,7 @@ Partial Class PV
Private Sub BtnAceptarIE_Click(sender As Object, e As EventArgs) Handles BtnAceptarIE.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtCantidadIE.Text.ToEntero > 0 Then
- If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero, Now) Then
+ If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero, NowADS()) Then
TxtCantidadIE.Text = ""
TxtDescripcionIE.Text = ""
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
@@ -2316,7 +2316,7 @@ Partial Class PV
Private Sub BtnCerrarTurno_Click(sender As Object, e As EventArgs) Handles BtnCerrarTurno.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtEfectivoEnCaja.Text.Trim <> "" Then
- If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, Now, UsuarioActual.CveEmpresa) Then
+ If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
Dim Liga As String = "document.location.href=""/Ventas/PV.aspx"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
@@ -2327,7 +2327,7 @@ Partial Class PV
Private Sub BtnCerrarBloqueo_Click(sender As Object, e As EventArgs) Handles BtnCerrarBloqueo.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtEfectivoCajaBloqueo.Text.Trim <> "" Then
- If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, Now, UsuarioActual.CveEmpresa) Then
+ If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
Dim Liga As String = "document.location.href=""/Ventas/PV.aspx"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
@@ -2673,7 +2673,7 @@ Partial Class PV
ClienteCodigoRegimenFiscal = "616"
End If
End If
- TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
+ TxtFechaPago.Text = (NowADS().AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
If ObjCliente.DtResultados(0)("CveVendedor").ToString.ToEntero > 0 Then
@@ -3047,7 +3047,7 @@ Partial Class PV
Dim x509 As New X509Certificate2()
x509.Import(Data)
- If x509.NotAfter <= Now() Then
+ If x509.NotAfter <= NowADS() Then
BtnEmitirImprimir.Enabled = False
Alert("La fecha del certificado ha expirado", TipoMensaje.MsgAdvertencia)
End If
@@ -3601,7 +3601,7 @@ Partial Class PV
ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero, -1)
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero, -1)
ObjFactura.Serie = If(VistaPrevia, "VistaPrevia", LblSerie.Text)
- ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
+ ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, NowADS().Hour, NowADS().Minute, NowADS().Second)
ObjFactura.CveMetodoPago = DdlMetodoPago.SelectedValue.ToEntero
ObjFactura.MetodoPago = DdlMetodoPago.SelectedItem.Text
ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {DdlMetodoPago.SelectedValue}")
@@ -3642,9 +3642,9 @@ Partial Class PV
End Select
- ObjFactura.Fech1 = Now
- ObjFactura.Fech2 = Now
- ObjFactura.Fech3 = Now
+ ObjFactura.Fech1 = NowADS()
+ ObjFactura.Fech2 = NowADS()
+ ObjFactura.Fech3 = NowADS()
ObjFactura.Alfa1 = ""
ObjFactura.Alfa2 = ""
ObjFactura.Alfa3 = ""
@@ -3659,7 +3659,7 @@ Partial Class PV
ObjFactura.CveContrato = If(CveContrato > 0, CveContrato, CvePresupuesto)
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero
ObjFactura.Entrega = Entrega
- ObjFactura.Vigencia = Now
+ ObjFactura.Vigencia = NowADS()
ObjFactura.CveVentaPadre = If(CveDevolucion > 0, CveDevolucion, CvePedido)
ObjFactura.CveVendedor = DdlVendedor.SelectedValue.ToEntero
@@ -3667,7 +3667,7 @@ Partial Class PV
DdlVendedor.Enabled = False
End If
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = NowADS()
ObjFactura.CveSucursalEjecucion = DdlSubProyectoDatos.SelectedValue.ToEntero
ObjFactura.CveSucursalCobranza = -1
@@ -4535,7 +4535,7 @@ Partial Class PV
End If
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
TabAlmacen.Enabled = DdlTipoComprobante.SelectedValue <> "Ant"
@@ -4857,7 +4857,7 @@ Partial Class PV
DivRecepcionUsados.Visible = False
DdlMarca.SelectedValueExist("-1")
- TxtFechaVigencia.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaVigencia.Text = NowADS().ToString("dd/MM/yyyy")
LimpiaAjuste()
@@ -5289,7 +5289,7 @@ Partial Class PV
Return False
End If
- If TxtFechaAjuste.Text.ToDate > Now Then
+ If TxtFechaAjuste.Text.ToDate > NowADS() Then
Alert("La fecha de compra no puede ser mayor a la de hoy.", TipoMensaje.MsgAdvertencia)
Return False
End If
@@ -5433,7 +5433,7 @@ Partial Class PV
Exit Sub
End If
- If TxtAnioVehiculo.Text.ToDecimal() > Now.Year Then
+ If TxtAnioVehiculo.Text.ToDecimal() > NowADS().Year Then
Alert("El campo año no puede ser mayor al año actual.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -6086,16 +6086,16 @@ Partial Class PV
Select Case RBLPago.SelectedValue.ToEntero
Case 1 'CREDITO
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
Case 2 'CONTADO
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") Then
DivContado.Visible = True
TxtImporteContado.Text = TxtTotal.Text
End If
- TxtFechaPago.Text = Now.ToShortDateString
+ TxtFechaPago.Text = NowADS().ToShortDateString
Case 3 ' TERMINAL
DivTerminal.Visible = True
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
End Select
LimpiaContado()
@@ -6989,7 +6989,7 @@ Partial Class PV
DdlRecepcionUsados.DataSource = DtTamanios
GvRecepcionUsadosModal.DataSource = DtTamanios
- TxtFechaVigencia.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaVigencia.Text = NowADS().ToString("dd/MM/yyyy")
DdlTipoUso.DataBind()
DdlTipoDefecto.DataBind()
@@ -7084,8 +7084,8 @@ Partial Class PV
DdlTipoUso.SelectedIndex = -1
TxtCodLinea.Text = ""
'TxtPrecio.Text = ""
- TxtFechaAjuste.Text = Now.ToShortDateString
- CEEFechaAjuste.EndDate = Now
+ TxtFechaAjuste.Text = NowADS().ToShortDateString
+ CEEFechaAjuste.EndDate = NowADS()
TxtCodInspeccion.Text = ""
TxtMesesUso.Text = ""
DdlTipoDefecto.SelectedIndex = -1
@@ -7167,7 +7167,7 @@ Partial Class PV
'End Sub
Private Function CalculaMesesUso() As Boolean
- Dim FechaI As Date = Now
+ Dim FechaI As Date = NowADS()
If IsDate(TxtFechaAjuste.Text) Then
FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1)
@@ -7177,7 +7177,7 @@ Partial Class PV
Return False
End If
- Dim FechaF As Date = Now
+ Dim FechaF As Date = NowADS()
If FechaI.AddDays(-1) > FechaF Then
TxtMesesUso.Text = ""
@@ -7686,7 +7686,7 @@ Partial Class PV
Dim Total As Decimal = ((Cantidad * PU) - Descuento).RoundSQL(2)
Dim TipoServicio As Integer = DdlTipoServicio.SelectedValue.ToEntero()
- Dim FechaUsado As DateTime = If(TxtFechaVigencia.Text.ToDateTime() < MinFecha, Now, TxtFechaVigencia.Text.ToDateTime())
+ Dim FechaUsado As DateTime = If(TxtFechaVigencia.Text.ToDateTime() < MinFecha, NowADS(), TxtFechaVigencia.Text.ToDateTime())
Dim CveModeloAuto As Integer = DdlModeloAuto.SelectedValue.ToEntero()
Dim AnioVehiculo As Integer = TxtAnioVehiculo.Text.ToEntero()
Dim TipoPoliza As Integer = 1 'VENTA
@@ -8162,7 +8162,7 @@ Partial Class PV
''Informacion de Garantia o ajuste
'params.Add(New ReportParameter("FechaInst", TxtFechaAjuste.Text.Trim))
- 'params.Add(New ReportParameter("Fecha", Now.ToShortDateString))
+ 'params.Add(New ReportParameter("Fecha", NowADS().ToShortDateString))
'params.Add(New ReportParameter("Defecto", If(DdlTipoDefecto.SelectedValue.ToEntero = -1, "", DdlTipoDefecto.SelectedItem.Text)))
'params.Add(New ReportParameter("MesesUso", TxtMesesUso.Text.Trim))
'params.Add(New ReportParameter("PorcentajeAjuste", TxtPorcentajeAjuste.Text.Trim))
@@ -8222,7 +8222,7 @@ Partial Class PV
Dim URLDescarga As New StringBuilder
URLDescarga.Append($"OP=AJUSTE&CVEPSAJUSTE={DdlPSAjuste.SelectedValue.ToEntero}&CVECLIENTE={CveCliente}&CVECLIENTEDISTRIBUIDOR={DdlDistribuidor.SelectedValue.ToEntero()}&CONSEC={TxtConsecutivoAjuste.Text.Trim}")
- URLDescarga.Append($"&FOLIOGARANTIA={If(DdlFolioGarantia.SelectedValue.ToEntero = -1, "", DdlFolioGarantia.SelectedItem.Text)}&FECHAAJUSTE={TxtFechaAjuste.Text.Trim}&FECHARECLAMACION={Now.ToString("dd/MM/yyyy")}")
+ URLDescarga.Append($"&FOLIOGARANTIA={If(DdlFolioGarantia.SelectedValue.ToEntero = -1, "", DdlFolioGarantia.SelectedItem.Text)}&FECHAAJUSTE={TxtFechaAjuste.Text.Trim}&FECHARECLAMACION={NowADS().ToString("dd/MM/yyyy")}")
URLDescarga.Append($"&TIPODEFECTO={If(DdlTipoDefecto.SelectedValue.ToEntero = -1, "", DdlTipoDefecto.SelectedItem.Text)}&CVETIPOUSO={DdlTipoUso.SelectedValue.ToEntero()}&CODIGOENSAMBLE={TxtCodEnsamble.Text.Trim}&CODIGOLINEA={TxtCodLinea.Text.Trim}")
URLDescarga.Append($"&CODIGOINSPECCION={TxtCodInspeccion.Text.Trim}&PORCENTAJEAJUSTE={TxtPorcentajeAjuste.Text.Trim}&BCIAJUSTE={DdlBCIAjuste.SelectedItem.Text}&ETIQUETA={TxtEtiqueta.Text.Trim}&AÑO={TxtAnioVehiculo.Text}&COMPROBANTE={TxtComprobante.Text}")
URLDescarga.Append($"&MODELOAUTO={If(DdlPS.SelectedValue.ToEntero > 0, DtModelosAuto.FiltroPrimeroValor("Modelo", $"CveModeloAuto ={DdlModeloAuto.SelectedValue}"), "")}&MARCAAUTO={If(DdlPS.SelectedValue.ToEntero > 0, DtModelosAuto.FiltroPrimeroValor("Marca", $"CveModeloAuto ={DdlModeloAuto.SelectedValue}"), "")}&CODIGOTD={TxtCodigoTD.Text.Trim}")
diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb
index ee4647234..11512efc6 100644
--- a/Ventas/PopUpBuscarFolio.aspx.vb
+++ b/Ventas/PopUpBuscarFolio.aspx.vb
@@ -17,7 +17,7 @@ Partial Class PopUpBuscarFolio
CType(Me.Master, BaseMasterPage).EsPopup = True
CType(Me.Master, BaseMasterPage).PopupWidth = 800
- txtFechaI.Text = Now.AddMonths(-12).ToShortDateString
+ txtFechaI.Text = NowADS().AddMonths(-12).ToShortDateString
'RegistraScript("$get('tdContenido').style.height='500px'")
CargaSubProyectos()
CargaEstatus()
diff --git a/Ventas/ProductosFinancieros.aspx.vb b/Ventas/ProductosFinancieros.aspx.vb
index 0761458ea..0f0dc2e3c 100644
--- a/Ventas/ProductosFinancieros.aspx.vb
+++ b/Ventas/ProductosFinancieros.aspx.vb
@@ -318,8 +318,8 @@ Partial Class Bancos_ProductosFinancieros
If CveIE > 0 Then
'MOVIMIENTOS PREPOLIZA
- 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Importe, "", DdlTipoMovimiento.SelectedValue.ToEntero, TxtConcepto.Text.Trim, Now, 0, -1, CveIE) Then
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 30, TxtConcepto.Text.Trim, Now, 0, -1, CveIE) Then
+ 'If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovto, Importe, "", DdlTipoMovimiento.SelectedValue.ToEntero, TxtConcepto.Text.Trim, NowADS(), 0, -1, CveIE) Then
+ ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 30, TxtConcepto.Text.Trim, NowADS(), 0, -1, CveIE) Then
' ErrorTransaccion = True
' End If
'Else
diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx
index c470944d7..570c23b81 100644
--- a/Ventas/ProductosServicios.aspx
+++ b/Ventas/ProductosServicios.aspx
@@ -530,6 +530,58 @@
+
+
+
+
+
+
+ Ecommerce
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index ad3d30557..4815e1a3a 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -202,7 +202,7 @@ Partial Class ProductosyServicios
ChkEstado.Enabled = False
ChkEstado.Checked = True
- LblFechaCaptura.Text = Now.ToShortDateString()
+ LblFechaCaptura.Text = NowADS().ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
BtnEliminar.Visible = False
@@ -287,8 +287,6 @@ Partial Class ProductosyServicios
End If
-
-
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
TxtPS.CssClass = "form-control Mayuscula"
End If
@@ -430,6 +428,9 @@ Partial Class ProductosyServicios
DivCitricos.Visible = True
CargaPanelCitricos()
End If
+ If UsuarioActual.CveEmpresa = 119 Then
+ DiveCommerce.Visible = True
+ End If
End Sub
@@ -968,26 +969,23 @@ Partial Class ProductosyServicios
DdlRin.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveRinTamaño").ToString)
DdlObjetoImpuesto.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveObjetoImpuesto").ToString)
- 'If ObjProductosServicios.CvePSAdicional > 0 Then
- ' DdlPSAdicional.SelectedValue = ObjProductosServicios.CvePSAdicional.ToString
- ' DdlPSAdicional.SelectedText = ObjProductosServicios.PSCodigoAdicional
- 'Else
- ' DdlPSAdicional.SelectedValue = "-1"
- ' DdlPSAdicional.SelectedText = "Seleccione"
- 'End If
DdlEmpacado.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveTipoEmpacado").ToString)
DdlTipoOrganico.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveTipoOrganico").ToString)
+ TxtNombreComercial.Text = ObjProductosServicios.DtResultados.Rows(0)("NombreComercial").ToString
+
+ ChkActivoEcommerce.Checked = ObjProductosServicios.DtResultados.Rows(0)("ActivoEcommerce").ToString = "True"
+ TxtEcommerceNota.Text = ObjProductosServicios.DtResultados.Rows(0)("NotasAdicionales").ToString
+ TxtEcommerceEtiquetas.Text = ObjProductosServicios.DtResultados.Rows(0)("EcommerceEtiquetas").ToString
+ TxtEcommercePrecio.Text = ObjProductosServicios.DtResultados.Rows(0)("EcommercePrecio").ToString.ToDecimal.ToString("#,###.####")
Try
DdlClasificacion_SelectedIndexChanged(DdlClasificacion, Nothing)
-
DdlTamanio.SelectedValueExist(ObjProductosServicios.DtResultados.Rows(0)("CveTamaño").ToString)
If DdlTamanio.SelectedValue.ToEntero() > 0 Then
Dim Dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
Dim DebeTenerTamanio As Boolean = Boolean.Parse(Dr("EsAcumulador").ToString)
-
'SI ES MOTOBATERIA
If DdlClasificacion.SelectedValue = "20517" Then
DebeTenerTamanio = True
@@ -1004,15 +1002,11 @@ Partial Class ProductosyServicios
If DebeTenerTamanio AndAlso DdlTamanio.SelectedValue.ToEntero() <= 0 Then
Alert($"Un producto/servicio con la clasificación '{Dr("Clasificacion")}' debe tener especificado un tamaño.", TipoMensaje.MsgAdvertencia)
End If
-
DvTamanio.Visible = True
End If
-
-
Catch ex As Exception
End Try
-
ChkAplicaIeps.Checked = ObjProductosServicios.AplicaIEPS
If ObjProductosServicios.AplicaIEPS = True Then
DdlIEPSPorcentaje.Enabled = True
@@ -1469,7 +1463,8 @@ Partial Class ProductosyServicios
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad,
CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
- CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal, RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked) > 0 Then
+ CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal, RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked,
+ NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim, EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal) > 0 Then
ViewState("CvePS") = ObjProductosServicios.CvePS
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
If GVR.FCCheckBox("ChkDeduccion").Checked Then
@@ -1526,7 +1521,7 @@ Partial Class ProductosyServicios
If ObjProductosServicios.UpdatePS(DdlClasificacion.SelectedValue.ToEntero, -1, DdlUnidadMedida.SelectedValue.ToEntero, TxtCodigo.Text.Trim, TxtCodigo2.Text.Trim, TxtCodigoBarras.Text.Trim, PSS,
TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble, (TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, CveProveedor, True,
- ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv, EsPaquete, DdlSATPS.SelectedValue.ToEntero,
+ ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv, EsPaquete, DdlSATPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarca, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim,
AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, IEPSGrabaIVA:=ChkIepsIVA.Checked, VentaMinima:=TxtVentaMinima.Text.ToDecimal,
@@ -1540,7 +1535,8 @@ Partial Class ProductosyServicios
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal,
- RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked) Then
+ RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked,
+ NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim, ActivoEcommerce:=ChkActivoEcommerce.Checked, EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal) Then
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True
@@ -1704,7 +1700,7 @@ Partial Class ProductosyServicios
#Region "GV ALIAS"
Protected Sub GVAlias_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GVAlias.RowDeleting
Dim ObjAliasDelete As New ClsProductosServicios
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If ObjAliasDelete.RemovePSAlias(GVAlias.Rows(e.RowIndex).DataKey("CvePS").ToString.ToEntero, GVAlias.Rows(e.RowIndex).DataKey("PSAlias").ToString, UsuarioActual.CveUsuario) Then
GVAlias.EditIndex = -1
@@ -1783,11 +1779,11 @@ Partial Class ProductosyServicios
CargaGvEquivalencias()
End Sub
Private Sub GvEquivalencia_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvEquivalencia.RowUpdating
- Dim TieneError = False
+ Dim TieneError As Boolean = False
- Dim CveUM = GvEquivalencia.Rows(e.RowIndex).DataKey("CveUM").ToEntero
- Dim UnidadBase = GvEquivalencia.Rows(e.RowIndex).DataKey("UnidadBase").ToString = "True"
- Dim Cantidad = DirectCast(GvEquivalencia.Rows(e.RowIndex).FindControl("TxtCantidadEquivalencia"), TextBox).Text.Trim.ToDecimal
+ Dim CveUM As Integer = GvEquivalencia.Rows(e.RowIndex).DataKey("CveUM").ToEntero
+ Dim UnidadBase As Boolean = GvEquivalencia.Rows(e.RowIndex).DataKey("UnidadBase").ToString = "True"
+ Dim Cantidad As Decimal = DirectCast(GvEquivalencia.Rows(e.RowIndex).FindControl("TxtCantidadEquivalencia"), TextBox).Text.Trim.ToDecimal
Dim ObjProductosServicios As New ClsProductosServicios()
If Not ObjProductosServicios.UpdatePSEquivalencias(CvePS, CveUM, Cantidad, UnidadBase, 0, UsuarioActual.CveUsuario) Then
@@ -1807,9 +1803,9 @@ Partial Class ProductosyServicios
End Sub
Private Sub GvEquivalencia_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvEquivalencia.RowDeleting
- Dim TieneError = False
+ Dim TieneError As Boolean = False
- Dim CveUM = GvEquivalencia.Rows(e.RowIndex).DataKey("CveUM").ToEntero
+ Dim CveUM As Integer = GvEquivalencia.Rows(e.RowIndex).DataKey("CveUM").ToEntero
Dim ObjProductosServicios As New ClsProductosServicios()
If Not ObjProductosServicios.RemovePSEquivalencias(CvePS, CveUM) Then
@@ -2349,7 +2345,7 @@ Partial Class ProductosyServicios
Public Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClasificacion.SelectedIndexChanged
If DdlClasificacion.SelectedValue.ToEntero > 0 Then
If Me.CvePS <= 0 AndAlso (Not CveSATPS > 0 Or CveSATPS = 46920) Then
- Dim Dr = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
+ Dim Dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
If Dr IsNot Nothing Then
DdlSATPS.SelectedValue = Dr("CveSATPS").ToString
@@ -2367,7 +2363,7 @@ Partial Class ProductosyServicios
If DdlClasificacion.SelectedValue.ToEntero > 0 Then
Try
- Dim Dr = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
+ Dim Dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0)
If Boolean.Parse(Dr("EsAcumulador").ToString) Then
MostarOcultarDivTamanio(True)
Else
@@ -2381,10 +2377,6 @@ Partial Class ProductosyServicios
OnError("Ocurrió un error al mostrar los tamaños", ex)
End Try
End If
-
-
-
-
End Sub
Private Sub MostarOcultarDivTamanio(Mostrar As Boolean)
@@ -2479,7 +2471,7 @@ Partial Class ProductosyServicios
UpEcommercePSRelacionados.Update()
End Sub
Private Function GuardaEcommerce() As Boolean
- Dim TieneError = False
+ Dim TieneError As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(700) = "1" Then
@@ -2494,10 +2486,10 @@ Partial Class ProductosyServicios
End If
End If
- Dim Descripcion = TxtEcommerceDescripcion.Text.Trim
- Dim PrecioBase = TxtEcommercePrecioBase.Text.Trim.ToDouble
- Dim PrecioPromocion = TxtEcommercePrecioPromocion.Text.Trim.ToDouble
- Dim Disponible = ChkEcommerceDisponible.Checked
+ Dim Descripcion As String = TxtEcommerceDescripcion.Text.Trim
+ Dim PrecioBase As Double = TxtEcommercePrecioBase.Text.Trim.ToDouble
+ Dim PrecioPromocion As Double = TxtEcommercePrecioPromocion.Text.Trim.ToDouble
+ Dim Disponible As Boolean = ChkEcommerceDisponible.Checked
Dim ObjEcommerce As New ClsECommerce
If Not ObjEcommerce.ProductosAddUpdate(CvePS, Descripcion, PrecioBase, PrecioPromocion, Disponible, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
@@ -2510,11 +2502,11 @@ Partial Class ProductosyServicios
Return TieneError
End Function
Private Function ValidaGuardarEcommerce() As Boolean
- Dim Retorno = True
+ Dim Retorno As Boolean = True
Dim Mensaje As New StringBuilder
'DESCRIPCION
- Dim Descripcion = TxtEcommerceDescripcion.Text.Trim
+ Dim Descripcion As String = TxtEcommerceDescripcion.Text.Trim
If Descripcion.Length = 0 Then
Mensaje.Append("- El campo Descripción es obligatorio. Por favor introduzcalo y vuelva a intentar. ")
End If
@@ -2523,7 +2515,7 @@ Partial Class ProductosyServicios
End If
'PRECIO BASE
- Dim PrecioBase = TxtEcommercePrecioBase.Text.Trim.ToDouble
+ Dim PrecioBase As Double = TxtEcommercePrecioBase.Text.Trim.ToDouble
If PrecioBase = 0 Then
Mensaje.Append("- El campo Precio es obligatorio. Por favor verifique y vuelva a intentar. ")
End If
@@ -2532,7 +2524,7 @@ Partial Class ProductosyServicios
End If
'PRECIO FINAL
- Dim PrecioPromocion = TxtEcommercePrecioPromocion.Text.Trim.ToDouble
+ Dim PrecioPromocion As Double = TxtEcommercePrecioPromocion.Text.Trim.ToDouble
If PrecioPromocion < 0 Then
Mensaje.Append("- El campo Precio Final no puede ser negativo. Por favor verifique y vuelva a intentar. ")
End If
@@ -2567,8 +2559,8 @@ Partial Class ProductosyServicios
Exit Sub
End If
- Dim TieneError = False
- Dim CveInsignia = DdlEcommerceInsignia.SelectedValue.ToEntero
+ Dim TieneError As Boolean = False
+ Dim CveInsignia As Integer = DdlEcommerceInsignia.SelectedValue.ToEntero
'AGREGAR
Dim ObjEcommerce As New ClsECommerce
@@ -2585,11 +2577,11 @@ Partial Class ProductosyServicios
End If
End Sub
Private Function ValidaAgregarProductosInsigniasEcommerce() As Boolean
- Dim Retorno = True
+ Dim Retorno As Boolean = True
Dim Mensaje As New StringBuilder
'INSIGNIA
- Dim CveInsignia = DdlEcommerceInsignia.SelectedValue.ToEntero
+ Dim CveInsignia As Integer = DdlEcommerceInsignia.SelectedValue.ToEntero
If CveInsignia = 0 Then
Mensaje.Append("- El campo Insignia es obligatorio. Por favor introduzcalo y vuelva a intentar. ")
End If
@@ -2609,8 +2601,8 @@ Partial Class ProductosyServicios
Return Retorno
End Function
Protected Sub GvEcommercePSInsignias_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvEcommercePSInsignias.RowDeleting
- Dim TieneError = False
- Dim GvRow = GvEcommercePSInsignias.Rows(e.RowIndex)
+ Dim TieneError As Boolean = False
+ Dim GvRow As GridViewRow = GvEcommercePSInsignias.Rows(e.RowIndex)
Dim ObjEcommerce As New ClsECommerce
If ObjEcommerce.ProductosInsigniasRemove(GvRow.DataKey("CvePS").ToString.ToEntero, GvRow.DataKey("CveInsignia").ToString.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
@@ -2645,18 +2637,18 @@ Partial Class ProductosyServicios
Protected Sub BtnEcommerceImagenes_Click(sender As Object, e As EventArgs)
Dim FilesGral As List(Of Archivo) = TxtEcommerceImagenes.getfiles().Archivos
- Dim FileMove = ""
- Dim Archivo = ""
- Dim DirectorioTemporal = ""
+ Dim FileMove As String = ""
+ Dim Archivo As String = ""
+ Dim DirectorioTemporal As String = ""
- Dim DirectorioDestino = $"{UsuarioActual.Empresa.Ruta}\Ecommerce\Productos\Imagenes\"
+ Dim DirectorioDestino As String = $"{UsuarioActual.Empresa.Ruta}\Ecommerce\Productos\Imagenes\"
If Not Directory.Exists(DirectorioDestino) Then
Directory.CreateDirectory(DirectorioDestino)
End If
Dim ObjEcommerce As New ClsECommerce
For Each FileItem As Archivo In FilesGral
- Archivo = DateTime.Now.Ticks.ToString
+ Archivo = NowADS().Ticks.ToString
Try
FileMove = FileItem.filename
DirectorioTemporal = $"{AppDomain.CurrentDomain.BaseDirectory}Temp\{FileMove}"
@@ -2712,8 +2704,8 @@ Partial Class ProductosyServicios
Exit Sub
End If
- Dim TieneError = False
- Dim CvePS = DdlEcommercePSRelacionado.SelectedValue.ToEntero
+ Dim TieneError As Boolean = False
+ Dim CvePS As Integer = DdlEcommercePSRelacionado.SelectedValue.ToEntero
'AGREGAR
Dim ObjEcommerce As New ClsECommerce
@@ -2731,11 +2723,11 @@ Partial Class ProductosyServicios
End If
End Sub
Private Function ValidaAgregarProductosRelacionadosEcommerce() As Boolean
- Dim Retorno = True
+ Dim Retorno As Boolean = True
Dim Mensaje As New StringBuilder
'PS
- Dim CvePS = DdlEcommercePSRelacionado.SelectedValue.ToEntero
+ Dim CvePS As Integer = DdlEcommercePSRelacionado.SelectedValue.ToEntero
If CvePS = 0 Then
Mensaje.Append("- El campo Producto es obligatorio. Por favor introduzcalo y vuelva a intentar. ")
End If
@@ -2755,8 +2747,8 @@ Partial Class ProductosyServicios
Return Retorno
End Function
Protected Sub GvEcommercePSRealacionados_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvEcommercePSRealacionados.RowDeleting
- Dim TieneError = False
- Dim GvRow = GvEcommercePSRealacionados.Rows(e.RowIndex)
+ Dim TieneError As Boolean = False
+ Dim GvRow As GridViewRow = GvEcommercePSRealacionados.Rows(e.RowIndex)
Dim ObjEcommerce As New ClsECommerce
If ObjEcommerce.ProductosRelacionadosRemove(GvRow.DataKey("CvePS1").ToString.ToEntero, GvRow.DataKey("CvePS2").ToString.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
@@ -3142,7 +3134,7 @@ Partial Class ProductosyServicios
Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero()
If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtCodigo2.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble,
(TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv,
- EsPaquete, DdlSATPS.SelectedValue.ToEntero, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
+ EsPaquete, DdlSATPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia,
AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal,
CveCompuesto:=DdlCompuesto.SelectedValue.ToEntero, IEPSGrabaIVA:=ChkIepsIVA.Checked,
VentaMinima:=TxtVentaMinima.Text.ToDecimal, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, RetISR:=(TxtRetISR.Text.Trim.ToDouble / 100), PrecioMinimo:=TxtPrecioMinimo.Text.ToDecimal,
diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx
index df074117d..eef11b484 100644
--- a/Ventas/Promociones.aspx
+++ b/Ventas/Promociones.aspx
@@ -8,6 +8,9 @@
Generar a partir de
+
+ Cargar Productos
+
@@ -439,6 +442,44 @@
+
+
+
+
+
+
+
+
Agregar Producto/Servicio Plantilla
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb
index 9c3b88a19..75d2249dc 100644
--- a/Ventas/Promociones.aspx.vb
+++ b/Ventas/Promociones.aspx.vb
@@ -2,8 +2,10 @@
Option Strict On
Imports System.Data
+Imports DocumentFormat.OpenXml.Drawing.Diagrams
Imports Extensiones
-
+Imports iText.StyledXmlParser.Css.Resolve.Shorthand.Impl
+Imports Microsoft.Owin.Security.Provider
Partial Class Ventas_Promociones
Inherits ClsPaginas
@@ -73,19 +75,22 @@ Partial Class Ventas_Promociones
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
+
CvePromocion = -1
CargaValoresIniciales()
CargaMonedas()
+
If Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
+
CvePromocion = Request("CvePromocion").ToString.ToEntero
CargaDatos()
+ LnkAgrgarPlantillaPS.Visible = False
Else
ChkEstatus.Enabled = True
ChkEstatus.Checked = True
CreaDT()
End If
-
CargaGvBitacora()
End If
@@ -146,8 +151,8 @@ Partial Class Ventas_Promociones
'DdlCliente.Items.Insert(0, New ListItem("todos", "-1"))
DdlClientes.setEsWebService(True)
- TxtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ TxtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ TxtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarca.DataSource = ObjPS.DtResultados
@@ -414,8 +419,8 @@ Partial Class Ventas_Promociones
If ChkRestricciones.Checked Then
Dr("AplicaRestriccionTexto") = "Si"
Dr("AplicaRestriccion") = True
- Dr("HoraInicio") = Now.ToShortDateString.ToDate.AddHours(TxtHoraInicio.Text.Trim.Substring(0, 2).ToEntero).AddMinutes(TxtHoraInicio.Text.Trim.Substring(2, 2).ToEntero)
- Dr("HoraFin") = Now.ToShortDateString.ToDate.AddHours(TxtHoraFin.Text.Trim.Substring(0, 2).ToEntero).AddMinutes(TxtHoraFin.Text.Trim.Substring(2, 2).ToEntero)
+ Dr("HoraInicio") = NowADS().ToShortDateString.ToDate.AddHours(TxtHoraInicio.Text.Trim.Substring(0, 2).ToEntero).AddMinutes(TxtHoraInicio.Text.Trim.Substring(2, 2).ToEntero)
+ Dr("HoraFin") = NowADS().ToShortDateString.ToDate.AddHours(TxtHoraFin.Text.Trim.Substring(0, 2).ToEntero).AddMinutes(TxtHoraFin.Text.Trim.Substring(2, 2).ToEntero)
Dr("AplicaLunes") = ChkLunes.Checked
Dr("AplicaMartes") = ChkMartes.Checked
Dr("AplicaMiercoles") = ChkMiercoles.Checked
@@ -917,4 +922,273 @@ Partial Class Ventas_Promociones
End If
End Sub
+
+ Protected Sub LnkAgrgarPlantillaPS_Click(sender As Object, e As EventArgs)
+ TxtExcel.Text = "[]"
+ UpAgregarPlantilla.Update()
+ RegistraScript("$('#DivAgregarPlantilla').modal('show');")
+ End Sub
+
+ Protected Sub LnkDecargaPlatilla_Click(sender As Object, e As EventArgs)
+
+ Dim rutaArchivoPlantilla As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\CargaPromociones.xlsx"
+
+ Dim nombreArchivo As String = "CargaPromociones.xlsx"
+
+ ' Configurar la respuesta HTTP
+ Response.Clear()
+ Response.ContentType = "application/octet-stream"
+ Response.AppendHeader("Content-Disposition", "attachment; filename=" & nombreArchivo)
+
+ Dim contenido As Byte() = System.IO.File.ReadAllBytes(rutaArchivoPlantilla)
+ Response.BinaryWrite(contenido)
+
+
+ Response.Flush()
+ Response.End()
+
+ End Sub
+
+
+
+ Protected Sub BrnAgregarPlantilla_Click(sender As Object, e As EventArgs)
+
+ If TxtExcel.getfiles().Archivos.Count > 0 Then
+ Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
+ Dim Directorio As String = Server.MapPath("~") & file.path
+ Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
+
+ CargarArchivo(Directorio, file.filename, Tipo)
+ Else
+ Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError)
+ End If
+
+ End Sub
+
+ Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
+
+ TempDT.Clear()
+
+ CveConsecutivo = TempDT.Rows.Count + 1
+
+ Dim ProcesoOK As Boolean = False
+ Dim DTPlantilla As New DataTable
+ Dim ErrorArchivo = False
+ Dim ErrorExcel = False
+ DTPlantilla = ReadExcelFile(Ruta + FileName, True)
+ 'Alert(DT.Rows.Count.ToString)
+
+ If DTPlantilla.Rows.Count = 0 Then
+ Alert("No encontraron registros.")
+ Exit Sub
+ End If
+
+ If Not ValidaDTPlantilla(DTPlantilla) Then
+ Exit Sub
+ End If
+
+ For Each dRowTemplate As DataRow In DTPlantilla.Rows
+
+ 'Clasificacion Codigo TipoPromocion Promocion CantidadMinima Rin IncluyeImpuestos
+
+ Dim CveClasificacion As Integer = dRowTemplate("CveClasificacion").ToString.ToEntero
+ Dim CvePS As Integer = dRowTemplate("CvePS").ToString.ToEntero
+ Dim CveTipoPromosicion As Integer = dRowTemplate("CveTipoPromosicion").ToString.ToEntero
+ Dim Promocion As Decimal = dRowTemplate("Promocion").ToString.ToDecimal
+ Dim CantidadMinima As Decimal = dRowTemplate("CantidadMinima").ToString.ToDecimal
+ Dim CveRin As Integer = dRowTemplate("CveRin").ToString.ToEntero
+ Dim IncluyeImpuestos As Boolean = Boolean.Parse(dRowTemplate("IncluyeImpuestos").ToString)
+
+
+ Dim Dr As DataRow = TempDT.NewRow
+ Dr = TempDT.NewRow
+ Dr("Estatus") = 0
+
+ If CveClasificacion > 0 Then
+ Dr("CveClasificacion") = CveClasificacion
+ Dr("Clasificacion") = dRowTemplate("Clasificacion").ToString
+ Dr("CvePS") = -1
+ Else
+ Dr("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion")
+ Dr("Clasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("Clasificacion")
+ Dr("CvePS") = CvePS
+ End If
+
+
+ Dr("CodigoPS") = dRowTemplate("CodigoPS").ToString
+ Dr("PUAnterior") = 0
+
+ Dr("CveTipoPromocion") = CveTipoPromosicion
+ Dr("TipoPromocion") = dRowTemplate("TipoPromocion").ToString
+ Dr("Promocion") = Promocion
+
+ Dr("PUPromocion") = 0
+
+ Dr("CantidadMinima") = CantidadMinima
+
+ Dr("AplicaRestriccionTexto") = "No"
+ Dr("AplicaRestriccion") = False
+ Dr("HoraInicio") = MinFecha.ToDateTime
+ Dr("HoraFin") = MaxFecha.ToDateTime
+ Dr("AplicaLunes") = False
+ Dr("AplicaMartes") = False
+ Dr("AplicaMiercoles") = False
+ Dr("AplicaJueves") = False
+ Dr("AplicaViernes") = False
+ Dr("AplicaSabado") = False
+ Dr("AplicaDomingo") = False
+
+ Dr("IncluyeImpuestos") = IncluyeImpuestos
+
+ If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
+ Dr("CveRinTamaño") = CveRin
+ Dr("RinTamaño") = dRowTemplate("RinTamaño").ToString
+ Else
+ Dr("CveRinTamaño") = -1
+ End If
+
+ TempDT.Rows.Add(Dr)
+
+ Next
+
+
+
+ CargaGrid()
+ RegistraScript("$('#DivAgregarPlantilla').modal('hide')")
+
+
+
+ End Sub
+
+ Private Function ValidaDTPlantilla(ByRef DTPlantilla As DataTable) As Boolean
+
+ Dim Errores As New StringBuilder
+
+
+ DTPlantilla.Columns.Add("CveClasificacion", GetType(Integer))
+ DTPlantilla.Columns.Add("CvePS", GetType(Integer))
+ DTPlantilla.Columns.Add("CveTipoPromosicion", GetType(Integer))
+ 'DTPlantilla.Columns.Add("Promocion", GetType(Decimal))
+ 'DTPlantilla.Columns.Add("CantidadMinima", GetType(Decimal))
+ DTPlantilla.Columns.Add("CveRin", GetType(Integer))
+ 'DTPlantilla.Columns.Add("IncluyeImpuestos", GetType(Boolean))
+ DTPlantilla.Columns.Add("CodigoPS", GetType(String))
+ DTPlantilla.Columns.Add("RinTamaño", GetType(String))
+
+
+ Dim DTPS As DataTable = New DataTable
+ Dim DTRines As DataTable = New DataTable
+ Dim ObjPS As New ClsProductosServicios
+ If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
+ DTPS = ObjPS.DtResultados
+ End If
+ ObjPS.Dispose()
+
+
+ Dim ObjGral As New ClsGenerales
+ If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
+ DTRines = ObjGral.DtResultados
+ End If
+ ObjGral.Dispose()
+
+
+ Dim RegistroActual As Integer = 1
+ For Each dRow As DataRow In DTPlantilla.Rows
+
+ Dim SBErrorRegistro As New StringBuilder
+
+ Dim ClasificacionStr, CodigoStr, TipoPromocionStr, PromocionStr, CantidadMinimaStr, RinStr, IncluyeImpuestosStr As String
+
+
+
+ ClasificacionStr = dRow("Clasificacion").ToString.Trim
+ CodigoStr = dRow("Codigo").ToString.Trim
+ TipoPromocionStr = dRow("TipoPromocion").ToString.Trim
+ PromocionStr = dRow("Promocion").ToString.Trim
+ CantidadMinimaStr = dRow("CantidadMinima").ToString.Trim
+ RinStr = dRow("Rin").ToString.Trim
+ IncluyeImpuestosStr = dRow("IncluyeImpuestos").ToString.Trim
+
+ If ClasificacionStr.Length > 0 Or CodigoStr.Length > 0 Then
+
+ Dim CveClasificacion As Integer = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{ClasificacionStr}'").ToString().ToEntero()
+ Dim CvePS As Integer = DTPS.FiltroPrimeroValor("CvePS", $"Codigo = '{CodigoStr}'").ToString().ToEntero()
+ Dim CodigoPS As String = DTPS.FiltroPrimeroValor("PSCodigo", $"Codigo = '{CodigoStr}'").ToString()
+ Dim CveTipoPromocion As Integer = -1
+ Dim Promocion As Decimal = PromocionStr.ToDecimal
+ Dim CantidadMinima As Decimal = CantidadMinimaStr.ToDecimal
+ Dim CveRin As Integer = If(RinStr <> "", DTRines.FiltroPrimeroValor("CveRinTamaño", $"Codigo = '{RinStr}'").ToString.ToEntero(), -1)
+ Dim RinTamaño As String = If(RinStr <> "", DTRines.FiltroPrimeroValor("RinTamaño", $"Codigo = '{RinStr}'").ToString(), "")
+ Dim IncluyeImpuestos As Boolean = If(IncluyeImpuestosStr.ToUpper.Contiene("´SÍ", "SI", "1"), True, False)
+
+ ' SBErrorRegistro.Append($"")
+ If ClasificacionStr.Length > 0 And CodigoStr.Length > 0 Then
+ SBErrorRegistro.Append($"No se puede agregar Clasificación y codigo en un mismo registro. ")
+ Else
+
+ If ClasificacionStr.Length > 0 Then
+ SBErrorRegistro.Append(If(CveClasificacion > 0, "", $"No se encontro Clasificación '{ClasificacionStr}'. "))
+ Else
+ SBErrorRegistro.Append(If(CvePS > 0, "", $"No se encontro código de Producto/Servicio '{CodigoStr }'. "))
+ End If
+ End If
+
+ If TipoPromocionStr.ToUpper.Contiene("IMPORTE $", "IMPORTE") Then
+ CveTipoPromocion = 1
+ ElseIf TipoPromocionStr.ToUpper.Contiene("DESCUENTO %", "DESCUENTO") Then
+ CveTipoPromocion = 2
+ ElseIf TipoPromocionStr.ToUpper = "CANTIDAD" Then
+ CveTipoPromocion = 3
+ Else
+ SBErrorRegistro.Append($"Tipo Promoción no encontrada '{TipoPromocionStr}'. ")
+ End If
+
+ If Not Promocion > 0 Then
+ SBErrorRegistro.Append($"La Promoción debe de ser mayor a 0. ")
+ End If
+
+ If CantidadMinimaStr.Length > 0 And Not CantidadMinima > 0 Then
+ SBErrorRegistro.Append($"La Cantidad MÍnima debe de ser mayor a 0. ")
+ End If
+
+ If RinStr.Length > 0 And Not CveRin > 0 Then
+ SBErrorRegistro.Append($"Tamaño de Rin no encontrado '{RinStr}'. ")
+ End If
+
+ If Not IncluyeImpuestosStr.ToUpper.Contiene("´SÍ", "SI", "1", "NO", "0") Then
+ SBErrorRegistro.Append($"Campo IncluyeImpuestos no válido '{IncluyeImpuestosStr}'. ")
+ End If
+
+ If SBErrorRegistro.ToString.Length > 0 Then
+ Errores.AppendLine($"Registro {RegistroActual}, {SBErrorRegistro.ToString}")
+ Else
+ dRow("CveClasificacion") = CveClasificacion
+ dRow("CvePS") = CvePS
+ dRow("CveTipoPromosicion") = CveTipoPromocion
+ dRow("Promocion") = Promocion
+ dRow("CantidadMinima") = CantidadMinima
+ dRow("RinTamaño") = RinTamaño
+ dRow("CveRin") = CveRin
+ dRow("IncluyeImpuestos") = IncluyeImpuestos
+ dRow("CodigoPS") = If(CveClasificacion > 0, "Todos", CodigoPS)
+ End If
+
+ End If
+ RegistroActual = RegistroActual + 1
+
+ Next
+
+
+ If Errores.ToString.Length = 0 Then
+ DTPlantilla.AcceptChanges()
+ Return True
+ Else
+ Alert(Errores.ToString, TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+
+
+
+
+ End Function
End Class
\ No newline at end of file
diff --git a/Ventas/PuntoVenta.aspx.vb b/Ventas/PuntoVenta.aspx.vb
index 130cf399f..ebe54aab6 100644
--- a/Ventas/PuntoVenta.aspx.vb
+++ b/Ventas/PuntoVenta.aspx.vb
@@ -5,7 +5,7 @@ Partial Class Ventas_PuntoVenta
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If Request("PV_CveUsuario") Is Nothing Then
- Dim fe As String = Now().ToString("dd-MM-yyyy HH:mm:ss")
+ Dim fe As String = NowADS().ToString("dd-MM-yyyy HH:mm:ss")
Dim fi As String = encriptarHEX("AD_SISTEMAS_PV_" + fe)
Response.Redirect(String.Format("/Ventas/PuntoVenta.aspx?PV_CveUsuario={0}&PV_fe={1}&PV_fi={2}", UsuarioActual.CveUsuario, fe, fi))
diff --git a/Ventas/RepAnticipo-NC-IXC.aspx.cs b/Ventas/RepAnticipo-NC-IXC.aspx.cs
index 2725224ba..2cd819006 100644
--- a/Ventas/RepAnticipo-NC-IXC.aspx.cs
+++ b/Ventas/RepAnticipo-NC-IXC.aspx.cs
@@ -145,7 +145,7 @@ public partial class Ventas_RepAnticipo_NC_IXC : ClsPaginas
List para = new List();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ para.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
para.Add(new ReportParameter("AgrupadoPor", $"Agrupado Por: {Cliente}{Sucursal}{FechaI}{FechaF}{FechaICorte}{FechaFCorte}"));
if (Imagen.Exists)
{
@@ -211,7 +211,7 @@ public partial class Ventas_RepAnticipo_NC_IXC : ClsPaginas
if (TipoCambio == 3)
{
LiEspecifico.Visible = true;
- TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble();
+ TCEspecifico = get_GlobalTipoCambio(NowADS()).ToString().ToDouble();
TxtEspecifico.Text = TCEspecifico.ToString();
}else
{
diff --git a/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs b/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs
index 6e176275d..d37500623 100644
--- a/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs
+++ b/Ventas/RepAnticipo-NC-IXCDetalle.aspx.cs
@@ -64,8 +64,8 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
DdlSucursal.SelectedValueExist(Request["CveSubProyecto"] == null ? "-1" : Request["CveSubProyecto"].ToString());
DdlTipo.SelectedValueExist(Request["Tipo"] == null ? "-1" : Request["Tipo"].ToString());
CveMoneda = Request["CveMoneda"] == null ? -1 : Request["CveMoneda"].ToString().ToEntero();
- txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.ToString() : Request["FechaI"].ToString();
- txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.ToString() : Request["FechaF"].ToString();
+ txtFechaI.Text = Request["FechaI"] == null ? NowADS().ToString() : Request["FechaI"].ToString();
+ txtFechaF.Text = Request["FechaF"] == null ? NowADS().ToString() : Request["FechaF"].ToString();
TipoCambio = Request["TipoCambio"] == null ? 1 : Request["TipoCambio"].ToString().ToEntero();
TCEspecifico = Request["TCEspecifico"] == null ? -1 : Request["TCEspecifico"].ToString().ToDouble();
DdlConSaldo.SelectedValueExist(Request["ConSaldo"] == null ? "-1" : Request["ConSaldo"].ToString());
@@ -140,7 +140,7 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
ObjVenta.Dispose();
GvDatos.DataBind();
UpDatos.Update();
- if (TxtFechaFCorte.Text != DateTime.Now.ToShortDateString() && txtFechaI.Text != "") { LnkHabilitarSaldar.Visible = false; LnkSaldar.Visible = false; } else { LnkHabilitarSaldar.Visible = true; }
+ if (TxtFechaFCorte.Text != NowADS().ToShortDateString() && txtFechaI.Text != "") { LnkHabilitarSaldar.Visible = false; LnkSaldar.Visible = false; } else { LnkHabilitarSaldar.Visible = true; }
if (LnkSaldar.Visible) { HabilitarCheckbox(); }
Tipo = DdlTipo.SelectedValue.ToEntero();
}
@@ -185,7 +185,7 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
List para = new List();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ para.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
para.Add(new ReportParameter("Tipo", Tipo.ToString()));
para.Add(new ReportParameter("AgrupadoPor", $"Agrupado Por: {Cliente}{Sucursal}{ConSaldo}{Tipo2}{FechaI}{FechaF}{FechaICorte}{FechaFCorte}"));
if (Imagen.Exists)
@@ -427,7 +427,7 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
if (TipoCambio == 3)
{
LiEspecifico.Visible = true;
- TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToString().ToDouble();
+ TCEspecifico = get_GlobalTipoCambio(NowADS()).ToString().ToDouble();
TxtEspecifico.Text = TCEspecifico.ToString();
}
else
diff --git a/Ventas/RepAnticiposEspeciales.aspx.vb b/Ventas/RepAnticiposEspeciales.aspx.vb
index 01f5728f0..e2ff0b924 100644
--- a/Ventas/RepAnticiposEspeciales.aspx.vb
+++ b/Ventas/RepAnticiposEspeciales.aspx.vb
@@ -35,8 +35,8 @@ Partial Class Ventas_RepAnticiposEspeciales
End Sub
Private Sub Cargadatos()
- TxtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
- TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ TxtFechaI.Text = FirstDayOfMonth(NowADS()).ToShortDateString
+ TxtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
DdlSucursal.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSucursal.DataBind()
diff --git a/Ventas/RepAuxiliarFacturas.aspx.vb b/Ventas/RepAuxiliarFacturas.aspx.vb
index 7d2b84137..68420878c 100644
--- a/Ventas/RepAuxiliarFacturas.aspx.vb
+++ b/Ventas/RepAuxiliarFacturas.aspx.vb
@@ -50,7 +50,7 @@ Partial Class Ventas_RepAuxiliarFacturas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
- txtFechaI.Text = String.Format("01{0:/MM/yyyy}", DateTime.Now)
+ txtFechaI.Text = String.Format("01{0:/MM/yyyy}", NowADS())
CargaCombos()
End If
End Sub
@@ -197,7 +197,7 @@ Partial Class Ventas_RepAuxiliarFacturas
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("RepAuxiliarFacturas" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("RepAuxiliarFacturas" & NowADS().ToShortDateString)
End Sub
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
@@ -231,7 +231,7 @@ Partial Class Ventas_RepAuxiliarFacturas
params.Add(New ReportParameter("FechaFin", If(txtFechaF.Text <> "", FechaF.ToShortDateString, "")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", $"{Cliente}{FechaInicio}{FechaFin}{Clasificacion}{PS}{Proyecto}{Estatus}"))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
ImprimirPDF("Empresas/Grales/Formatos/RepAuxiliarFacturas.rdlc", DtVentas, params, "ReporteAuxiliarFacturas")
diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx b/Ventas/RepCancelacionesPorRespuesta.aspx
index e21dd27cd..e21a239ee 100644
--- a/Ventas/RepCancelacionesPorRespuesta.aspx
+++ b/Ventas/RepCancelacionesPorRespuesta.aspx
@@ -127,12 +127,7 @@
-
-
-
-
-
-
+
diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
index 4cc9ff651..d10f9c911 100644
--- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs
+++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
@@ -1,11 +1,14 @@
using Extensiones;
+using StackExchange.Redis;
using System;
+using System.Activities.Expressions;
using System.Collections.Generic;
using System.Data;
using System.Net.Http;
using System.Text;
using System.Web.UI.WebControls;
using static Extensiones.ModExtensiones;
+using static Stimulsoft.Report.Export.DeflaterHuffman;
public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
{
@@ -184,27 +187,30 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
string TipoDocto = GvRow.DataKey("TipoDocto");
string Nombre = GvRow.DataKey("Nombre");
string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
+ int CveVentaSustitucion = GvRow.DataKey("CveVentaSustitucion").ToEntero();
+ string RFCReceptorSustitucion = GvRow.DataKey("RFCReceptorSustitucion");
int CveMotivoCancelacion = -1;
int CveEstatusRefacturacion = GvRow.DataKey("CveEstatusRefacturacion").ToEntero();
int CveEstatusFacturaSustitucion = GvRow.DataKey("CveEstatusFacturaSustitucion").ToEntero();
- //SI NO SE PUDO CANCELAR O LA FACTURA NUEVA FUE CANCELADA, CANCELAR CON EL 02
- if (CveEstatusRefacturacion == 4 || CveEstatusFacturaSustitucion == 5)
+ if (CveEstatusRefacturacion > 0)
{
- //CUANDO LAS REFACTURACIONES NO SE PUEDEN CANCELAR, DEBE SER CANCELADO CON EL MOTIVO 02
- FolioSustitucion = "";
- CveMotivoCancelacion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 2).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
+ CveMotivoCancelacion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 1).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
}
- else
- {
- CveEstatusRefacturacion = 2;
- }
-
+ //CveEstatusRefacturacion = 2;
if (CveVenta > 0)
{
- var respCancelacion = CancelarDocumento(CveVenta, -1, CveCliente, Folio, Uuid, "", DateTime.Now, TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusRefacturacion: CveEstatusRefacturacion);
+ //VERIFICA EL ESTATUS DE LA FACTURA NUEVA, SI ESTA ESTÁ CANCELADA, SE MANDA UNA CANCELACIÓN SIN FOLIO DE SUSTITUCIÓN Y CON EL CÓDIGO 02
+ Timbrado.AcuseCancelacionSAT VigenciaExtra = Timbrado.VerificarVigenciaSAT(FolioSustitucion, UsuarioActual.Empresa.RFC, RFCReceptorSustitucion, Total.ToString(), true);
+ if (VigenciaExtra.Estado.ToUpper() == "CANCELADO")
+ {
+ FolioSustitucion = "";
+ CveMotivoCancelacion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 2).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
+ }
+
+ var respCancelacion = CancelarDocumento(CveVenta, -1, CveCliente, Folio, Uuid, "", NowADS(), TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusRefacturacion: CveEstatusRefacturacion, CveMotivoCancelacion: CveMotivoCancelacion);
if (!respCancelacion.HuboError)
{
@@ -311,7 +317,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
var sb = new StringBuilder();
string CancelacionAcuse = "";
- DateTime CancelacionFecha = DateTime.Now;
+ DateTime CancelacionFecha = NowADS();
int CveEstatus = 4;
try
@@ -811,127 +817,127 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
}
- protected void LnkCancelarFolioSustitucion_Click(object sender, EventArgs e)
- {
- //this.HdnLigaRefacturar.Value = "";
- this.CveVenta = -1;
+ //protected void LnkCancelarFolioSustitucion_Click(object sender, EventArgs e)
+ //{
+ // //this.HdnLigaRefacturar.Value = "";
+ // this.CveVenta = -1;
- GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
- this.CveVenta = GvRow.DataKey("CveVentaSustitucion").ToEntero();
+ // GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
+ // this.CveVenta = GvRow.DataKey("CveVentaSustitucion").ToEntero();
- int CveCliente = GvRow.DataKey("CveClienteSustitucion").ToEntero();
- string Total = GvRow.DataKey("TotalSustitucion");
- string RFCReceptor = GvRow.DataKey("RFCReceptorSustitucion");
- string TipoDocto = GvRow.DataKey("TipoDocto");
- string Nombre = GvRow.DataKey("Nombre");
- string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
- string SerieFolioSustitucion = GvRow.DataKey("SerieFolioSustitucion");
+ // int CveCliente = GvRow.DataKey("CveClienteSustitucion").ToEntero();
+ // string Total = GvRow.DataKey("TotalSustitucion");
+ // string RFCReceptor = GvRow.DataKey("RFCReceptorSustitucion");
+ // string TipoDocto = GvRow.DataKey("TipoDocto");
+ // string Nombre = GvRow.DataKey("Nombre");
+ // string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
+ // string SerieFolioSustitucion = GvRow.DataKey("SerieFolioSustitucion");
- int CveVentaOriginal = GvRow.DataKey("CveVenta").ToEntero();
- string SerieFolioOriginal = GvRow.DataKey("SerieFolio");
+ // int CveVentaOriginal = GvRow.DataKey("CveVenta").ToEntero();
+ // string SerieFolioOriginal = GvRow.DataKey("SerieFolio");
- //CUANDO LAS REFACTURACIONES NO SE PUEDEN CANCELAR, DEBE SER CANCELADO CON EL MOTIVO 02
- int CveMotivoCancelacion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 2).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
+ // //CUANDO LAS REFACTURACIONES NO SE PUEDEN CANCELAR, DEBE SER CANCELADO CON EL MOTIVO 02
+ // int CveMotivoCancelacion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 2).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
- if (CveVenta > 0 && FolioSustitucion != "")
- {
- var respCancelacion = CancelarDocumento(CveVenta, -2, CveCliente, "", FolioSustitucion, "", DateTime.Now, TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: "", CveEstatusRefacturacion: 4, CveMotivoCancelacion: CveMotivoCancelacion);
+ // if (CveVenta > 0 && FolioSustitucion != "")
+ // {
+ // var respCancelacion = CancelarDocumento(CveVenta, -2, CveCliente, "", FolioSustitucion, "", NowADS(), TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: "", CveEstatusRefacturacion: 4, CveMotivoCancelacion: CveMotivoCancelacion);
- if (!respCancelacion.HuboError)
- {
- var sb = new StringBuilder();
- var EnviarAcuse = false;
- if (respCancelacion.CveEstatus > 0)
- {
- if (respCancelacion.CveEstatus.Contiene(5, 20))
- {
- EnviarAcuse = true;
- }
+ // if (!respCancelacion.HuboError)
+ // {
+ // var sb = new StringBuilder();
+ // var EnviarAcuse = false;
+ // if (respCancelacion.CveEstatus > 0)
+ // {
+ // if (respCancelacion.CveEstatus.Contiene(5, 20))
+ // {
+ // EnviarAcuse = true;
+ // }
- var CveEstatus = respCancelacion.CveEstatus;
- var ObjVentas = new ClsVentas();
- if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
- {
- if (respCancelacion.CveEstatus == 20)
- {
- sb.Append($"El estatus de la factura {SerieFolioSustitucion} fue cambiado a 'Cancelación en proceso'.");
+ // var CveEstatus = respCancelacion.CveEstatus;
+ // var ObjVentas = new ClsVentas();
+ // if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
+ // {
+ // if (respCancelacion.CveEstatus == 20)
+ // {
+ // sb.Append($"El estatus de la factura {SerieFolioSustitucion} fue cambiado a 'Cancelación en proceso'.");
- sb.Append($" Imprimir Acuse");
- }
- else if (respCancelacion.CveEstatus == 23)
- {
- sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.");
- }
- else if (respCancelacion.CveEstatus == 5)
- {
- sb.Append($"El estatus de la factura {SerieFolioSustitucion} fue cambiado a 'Cancelada'.");
- sb.Append("El documento se canceló correctamente.");
- sb.Append($" Imprimir Acuse");
- }
+ // sb.Append($" Imprimir Acuse");
+ // }
+ // else if (respCancelacion.CveEstatus == 23)
+ // {
+ // sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.");
+ // }
+ // else if (respCancelacion.CveEstatus == 5)
+ // {
+ // sb.Append($"El estatus de la factura {SerieFolioSustitucion} fue cambiado a 'Cancelada'.");
+ // sb.Append("El documento se canceló correctamente.");
+ // sb.Append($" Imprimir Acuse");
+ // }
- if (respCancelacion.CveEstatus.Contiene(5, 20))
- {
- if (ObjVentas.UpdateEstatusVenta(CveVentaOriginal, 23, UsuarioActual.CveEmpresa, CveEstatusRefacturacion: 4, CveMotivoCancelacion: CveMotivoCancelacion))
- {
- sb.Append($"La Factura {SerieFolioOriginal} fue desligada.");
- }
- }
+ // if (respCancelacion.CveEstatus.Contiene(5, 20))
+ // {
+ // if (ObjVentas.UpdateEstatusVenta(CveVentaOriginal, 23, UsuarioActual.CveEmpresa, CveEstatusRefacturacion: 4, CveMotivoCancelacion: CveMotivoCancelacion))
+ // {
+ // sb.Append($"La Factura {SerieFolioOriginal} fue desligada.");
+ // }
+ // }
- }
- else
- {
- sb.Append("Ocurrió un error al cambiar el estatus de la factura.");
- }
- ObjVentas.Dispose();
+ // }
+ // else
+ // {
+ // sb.Append("Ocurrió un error al cambiar el estatus de la factura.");
+ // }
+ // ObjVentas.Dispose();
- if (respCancelacion.CveEstatus == 23)
- {
- var resp = Timbrado.VerificarVigenciaSAT(FolioSustitucion, UsuarioActual.Empresa.RFC, RFCReceptor, Total, true);
- if (resp != null)
- {
- sb.AppendFormat(" Folio Fiscal: {0} ", FolioSustitucion);
- sb.AppendFormat("Código Estado: {0} ", resp.CodigoEstatus);
- sb.AppendFormat("Estado: {0} ", resp.Estado);
- sb.AppendFormat("Es Cancelable: {0} ", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable);
- sb.AppendFormat("Estatus de Cancelación: {0}
", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion);
+ // }
- sb.Append(respCancelacion.Mensaje);
- }
+ // sb.Append(respCancelacion.Mensaje);
+ // }
- if (EnviarAcuse)
- {
- sb.Append(" ¿Desea enviar el Acuse de Cancelación al Cliente?");
- Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion: "Enviar", TextoSegundoBoton: "Cancelar");
- }
- else
- {
- Alert(sb.ToString());
- }
- }
- else
- {
- Alert(respCancelacion.Mensaje, TipoMensaje.MsgError);
- }
+ // if (EnviarAcuse)
+ // {
+ // sb.Append(" ¿Desea enviar el Acuse de Cancelación al Cliente?");
+ // Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion: "Enviar", TextoSegundoBoton: "Cancelar");
+ // }
+ // else
+ // {
+ // Alert(sb.ToString());
+ // }
+ // }
+ // else
+ // {
+ // Alert(respCancelacion.Mensaje, TipoMensaje.MsgError);
+ // }
- CargaDatos();
- }
- UPDatos.Update();
+ // CargaDatos();
+ // }
+ // UPDatos.Update();
- }
+ //}
}
public class MRespuestaSAT
{
diff --git a/Ventas/RepCancelacionesVentas.aspx.vb b/Ventas/RepCancelacionesVentas.aspx.vb
index a42833c13..0f61868f1 100644
--- a/Ventas/RepCancelacionesVentas.aspx.vb
+++ b/Ventas/RepCancelacionesVentas.aspx.vb
@@ -33,8 +33,8 @@ Partial Class Compras_RepCancelacionesVentas
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
- TxtFiltrosFechaInicio.Text = Now.FirstDayOfMonth.ToShortDateString
- TxtFiltrosFechaFin.Text = Now.ToShortDateString
+ TxtFiltrosFechaInicio.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ TxtFiltrosFechaFin.Text = NowADS().ToShortDateString
diff --git a/Ventas/RepComisiones.aspx.vb b/Ventas/RepComisiones.aspx.vb
index e377dfb71..d41a3c2e6 100644
--- a/Ventas/RepComisiones.aspx.vb
+++ b/Ventas/RepComisiones.aspx.vb
@@ -23,11 +23,11 @@ Partial Class Ventas_RepComisiones
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
- txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = FirstDayOfMonth(NowADS()).ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
- TxtAnio.Text = Now.Year.ToString()
- DdlMes.SelectedValueExist(Now.Month)
+ TxtAnio.Text = NowADS().Year.ToString()
+ DdlMes.SelectedValueExist(NowADS().Month)
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
@@ -200,7 +200,7 @@ Partial Class Ventas_RepComisiones
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReporteComisiones_" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteComisiones_" & NowADS().ToShortDateString)
End Sub
#End Region
diff --git a/Ventas/RepComisionesDetalle.aspx.vb b/Ventas/RepComisionesDetalle.aspx.vb
index 570c9d1d3..28042f430 100644
--- a/Ventas/RepComisionesDetalle.aspx.vb
+++ b/Ventas/RepComisionesDetalle.aspx.vb
@@ -17,8 +17,8 @@ Partial Class Ventas_RepComisionesDetalle
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
- txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = FirstDayOfMonth(NowADS()).ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
@@ -108,7 +108,7 @@ Partial Class Ventas_RepComisionesDetalle
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReporteComisionesDetalle_" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteComisionesDetalle_" & NowADS().ToShortDateString)
End Sub
#End Region
diff --git a/Ventas/RepComisionesDetallePS.aspx.vb b/Ventas/RepComisionesDetallePS.aspx.vb
index f6ffe2dda..ef613ee2b 100644
--- a/Ventas/RepComisionesDetallePS.aspx.vb
+++ b/Ventas/RepComisionesDetallePS.aspx.vb
@@ -62,7 +62,7 @@ Partial Class Ventas_RepComisionesDetallePS
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReporteComisionesDetalle_" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteComisionesDetalle_" & NowADS().ToShortDateString)
End Sub
#End Region
diff --git a/Ventas/RepComisionesJAM.aspx.cs b/Ventas/RepComisionesJAM.aspx.cs
index ac4f49186..74dc3f6dd 100644
--- a/Ventas/RepComisionesJAM.aspx.cs
+++ b/Ventas/RepComisionesJAM.aspx.cs
@@ -25,8 +25,8 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
private void InicializaValores()
{
- txtFechaI.Text = String.Format("01/{0}/{1}", DateTime.Now.Month, DateTime.Now.Year);
- txtFechaF.Text = String.Format("{0}/{1}/{2}", DateTime.Now.AddMonths(1).FirstDayOfMonth().AddDays(-1).Day, DateTime.Now.Month, DateTime.Now.Year);
+ txtFechaI.Text = String.Format("01/{0}/{1}", NowADS().Month, NowADS().Year);
+ txtFechaF.Text = String.Format("{0}/{1}/{2}", NowADS().AddMonths(1).FirstDayOfMonth().AddDays(-1).Day, NowADS().Month, NowADS().Year);
if (UsuarioActual.CveUsuario == 1835) // usuario de alejandra alvarez
{
@@ -332,7 +332,7 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
lista.Add(new CrystalParametro("Filtros", String.Format("{0}{1}{2}{3}{4}{5}", Sucursal, Cliente, Vendedor, FechaIn, FechaFn, TipoSaldo)));
lista.Add(new CrystalParametro("UsuarioImprimio", UsuarioActual.Nombre));
- lista.Add(new CrystalParametro("FechaImpresion", DateTime.Now.ToString()));
+ lista.Add(new CrystalParametro("FechaImpresion", NowADS().ToString()));
string PermisoCosto = "";
if (UsuarioActual.TienePermisoProceso(201)) { PermisoCosto = "1";} else { PermisoCosto = "0"; }
diff --git a/Ventas/RepComisionesJAM2.aspx.cs b/Ventas/RepComisionesJAM2.aspx.cs
index 28fd05fdb..e229ca065 100644
--- a/Ventas/RepComisionesJAM2.aspx.cs
+++ b/Ventas/RepComisionesJAM2.aspx.cs
@@ -17,8 +17,8 @@ public partial class Ventas_RepComisionesJAM2 : ClsPaginas
private void InicializaValores()
{
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().LastDayOfMonth().ToShortDateString();
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
DdlVendedor.DataBind();
diff --git a/Ventas/RepComisionesJAM2Detalle.aspx.cs b/Ventas/RepComisionesJAM2Detalle.aspx.cs
index 9d11dd255..264d49e2b 100644
--- a/Ventas/RepComisionesJAM2Detalle.aspx.cs
+++ b/Ventas/RepComisionesJAM2Detalle.aspx.cs
@@ -17,8 +17,8 @@ public partial class Ventas_RepComisionesJAM2Detalle : ClsPaginas
private void InicializaValores()
{
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().LastDayOfMonth().ToShortDateString();
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
DdlVendedor.DataBind();
@@ -29,8 +29,8 @@ public partial class Ventas_RepComisionesJAM2Detalle : ClsPaginas
DdlVendedor.SelectedValueExist(Request["CveVendedor"] == null ? "-1" : Request["CveVendedor"].ToString());
DdlSubProyecto.SelectedValueExist(Request["CveSubProyecto"] == null ? "-1" : Request["CveSubProyecto"].ToString());
- txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.FirstDayOfMonth().ToShortDateString() : Request["FechaI"].ToString();
- txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.LastDayOfMonth().ToShortDateString() : Request["FechaF"].ToString();
+ txtFechaI.Text = Request["FechaI"] == null ? NowADS().FirstDayOfMonth().ToShortDateString() : Request["FechaI"].ToString();
+ txtFechaF.Text = Request["FechaF"] == null ? NowADS().LastDayOfMonth().ToShortDateString() : Request["FechaF"].ToString();
CargaDatos();
}
diff --git a/Ventas/RepComisionesServec.aspx.vb b/Ventas/RepComisionesServec.aspx.vb
index 92a427978..420d5906c 100644
--- a/Ventas/RepComisionesServec.aspx.vb
+++ b/Ventas/RepComisionesServec.aspx.vb
@@ -21,8 +21,8 @@ Partial Class Ventas_RepComisionesServec
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
- txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = FirstDayOfMonth(NowADS()).ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
@@ -90,7 +90,7 @@ Partial Class Ventas_RepComisionesServec
StrFiltro.AppendFormat(" Fecha Inicio: {0}, ", txtFechaI.Text)
StrFiltro.AppendFormat(" Fecha Fin: {0}", txtFechaF.Text)
- ExportToExcelG(GvDatos, $"ReporteComisiones{Now.ToString("yyyyMMddhhmmss")}.xlsx", "", UsuarioActual, StrFiltro.ToString, 100, 200)
+ ExportToExcelG(GvDatos, $"ReporteComisiones{NowADS().ToString("yyyyMMddhhmmss")}.xlsx", "", UsuarioActual, StrFiltro.ToString, 100, 200)
End Sub
@@ -169,7 +169,7 @@ Partial Class Ventas_RepComisionesServec
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(3).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(3).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(3).Value = NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
diff --git a/Ventas/RepComisionesServecDetalle.aspx.vb b/Ventas/RepComisionesServecDetalle.aspx.vb
index c4b69ae2e..ff1a0aa0d 100644
--- a/Ventas/RepComisionesServecDetalle.aspx.vb
+++ b/Ventas/RepComisionesServecDetalle.aspx.vb
@@ -107,7 +107,7 @@ Partial Class Ventas_RepComisionesServecDetalle
StrFiltro.AppendFormat(" Fecha Inicio: {0}, ", txtFechaI.Text)
StrFiltro.AppendFormat(" Fecha Fin: {0}", txtFechaF.Text)
- ExportToExcelG(GvDatos, $"ReporteComisiones{Now.ToString("yyyyMMddhhmmss")}.xlsx", "", UsuarioActual, StrFiltro.ToString, 100, 200)
+ ExportToExcelG(GvDatos, $"ReporteComisiones{NowADS().ToString("yyyyMMddhhmmss")}.xlsx", "", UsuarioActual, StrFiltro.ToString, 100, 200)
End Sub
@@ -191,7 +191,7 @@ Partial Class Ventas_RepComisionesServecDetalle
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(8).Value = "Fecha Impresión"
- worksheet.Rows(IndexEndTable + 1).Cells(8).Value = DateTime.Now.ToString("dd/MM/yyyy")
+ worksheet.Rows(IndexEndTable + 1).Cells(8).Value = NowADS().ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
diff --git a/Ventas/RepCostoPromedioVenta.aspx.cs b/Ventas/RepCostoPromedioVenta.aspx.cs
index 3c4e081ea..37b51af12 100644
--- a/Ventas/RepCostoPromedioVenta.aspx.cs
+++ b/Ventas/RepCostoPromedioVenta.aspx.cs
@@ -22,8 +22,8 @@ public partial class Ventas_RepCostoPromedioVenta : ClsPaginas
private void InicializaValores()
{
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().ToShortDateString();
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
DdlSubProyecto.DataBind();
@@ -94,7 +94,7 @@ public partial class Ventas_RepCostoPromedioVenta : ClsPaginas
List para = new List();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ para.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
para.Add(new ReportParameter("Filtros", $"Filtros: {FechaI}{FechaF}{Proveedor}{SubProyecto}"));
if (Imagen.Exists)
{
diff --git a/Ventas/RepCotizaciones.aspx.vb b/Ventas/RepCotizaciones.aspx.vb
index c8b834483..c24e23028 100644
--- a/Ventas/RepCotizaciones.aspx.vb
+++ b/Ventas/RepCotizaciones.aspx.vb
@@ -66,7 +66,7 @@ Partial Class RepRemisiones
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & ""
- If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then
+ If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
' e.Row.Cells(2).CssClass = "danger"
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
@@ -135,10 +135,10 @@ Partial Class RepRemisiones
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepCotizaciones.rdlc", DtVentas, params, String.Format("RepCotizaciones-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepCotizaciones.rdlc", DtVentas, params, String.Format("RepCotizaciones-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -151,6 +151,6 @@ Partial Class RepRemisiones
End Sub
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("Reporte de Coizaciones por Facturar" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("Reporte de Coizaciones por Facturar" & NowADS().ToShortDateString)
End Sub
End Class
diff --git a/Ventas/RepCotizacionesDetalle.aspx.vb b/Ventas/RepCotizacionesDetalle.aspx.vb
index 0ee292ff3..bbcc650be 100644
--- a/Ventas/RepCotizacionesDetalle.aspx.vb
+++ b/Ventas/RepCotizacionesDetalle.aspx.vb
@@ -68,7 +68,7 @@ Partial Class RepRemisionesDetalle
#Region "G V - D A T O S "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then
+ If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
' e.Row.Cells(2).CssClass = "danger"
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
@@ -97,10 +97,10 @@ Partial Class RepRemisionesDetalle
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepCotizacionesDetalle.rdlc", DtVentas, params, String.Format("RepCotizacionesDetalle-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepCotizacionesDetalle.rdlc", DtVentas, params, String.Format("RepCotizacionesDetalle-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -112,6 +112,6 @@ Partial Class RepRemisionesDetalle
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("Reporte de Cotizaciones por Facturar Detalle" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("Reporte de Cotizaciones por Facturar Detalle" & NowADS().ToShortDateString)
End Sub
End Class
diff --git a/Ventas/RepCotizacionesxFacturar.aspx.vb b/Ventas/RepCotizacionesxFacturar.aspx.vb
index cbc10e2fd..6f734ab3f 100644
--- a/Ventas/RepCotizacionesxFacturar.aspx.vb
+++ b/Ventas/RepCotizacionesxFacturar.aspx.vb
@@ -53,8 +53,8 @@ Partial Class RepCotizacionesxFacturar
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaI.Text = Now.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargaSucursales()
CargaCliente()
@@ -108,7 +108,7 @@ Partial Class RepCotizacionesxFacturar
Else
e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & ""
- If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then
+ If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
' e.Row.Cells(2).CssClass = "danger"
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
@@ -173,14 +173,14 @@ Partial Class RepCotizacionesxFacturar
' params.Add(New ReportParameter("FechaInicio", FechaI))
' params.Add(New ReportParameter("FechaFin", FechaF))
' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- ' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ ' params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
' params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
- ' ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", Now.ToDateTime.ToShortDateString))
+ ' ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", NowADS().ToDateTime.ToShortDateString))
' Else
' Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
' End If
@@ -191,6 +191,6 @@ Partial Class RepCotizacionesxFacturar
End Sub
'Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- ' GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & Now.ToShortDateString)
+ ' GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & NowADS().ToShortDateString)
'End Sub
End Class
diff --git a/Ventas/RepDocumentacionVencidaClientes.aspx.vb b/Ventas/RepDocumentacionVencidaClientes.aspx.vb
index e734a54e8..7d9417d55 100644
--- a/Ventas/RepDocumentacionVencidaClientes.aspx.vb
+++ b/Ventas/RepDocumentacionVencidaClientes.aspx.vb
@@ -135,7 +135,7 @@ Partial Class Vta_RepDocumentacionVencidaClientes
End If
If objEDoc.DocumentacionVencidaDinamicaGet(1, -1, CveCliente, -1, UsuarioActual.Empresa.CveEmpresa, DDlDocumentacion.SelectedValue.ToEntero, DDLDocumentacionTipo.SelectedValue.ToEntero,
- Now, Now, DDLSucursal.SelectedValue.ToEntero, -1, DDLVencidos.SelectedValue.ToEntero,
+ NowADS(), NowADS(), DDLSucursal.SelectedValue.ToEntero, -1, DDLVencidos.SelectedValue.ToEntero,
-1, -1, -1, Modulo:=2, GPO:=DdlGpo.SelectedValue.ToEntero, PermiteCredito:=If(ChkPermiteCredito.Checked, 1, -1),
FechaVI:=FechaInicio, FechaVF:=FechaFin) Then
@@ -312,7 +312,7 @@ Partial Class Vta_RepDocumentacionVencidaClientes
Dim documento As ExcelFile
Dim ws As ExcelWorksheet
Dim NombreReporte As String = "REPORTE DE DOCUMENTACIÓN"
- Dim TextoFecha As String = "Fecha: " & Now.ToString(" dd/MM/yyyy hh:mm:ss tt")
+ Dim TextoFecha As String = "Fecha: " & NowADS().ToString(" dd/MM/yyyy hh:mm:ss tt")
documento = New ExcelFile
ws = documento.Worksheets.Add("ReporteDocumentacion")
@@ -371,7 +371,7 @@ Partial Class Vta_RepDocumentacionVencidaClientes
Response.Clear()
Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & NombreReporte & "_" & Now.ToString("yyyyMMddhhmmss") & ".xlsx")
+ Response.AddHeader("content-disposition", "attachment; filename=" & NombreReporte & "_" & NowADS().ToString("yyyyMMddhhmmss") & ".xlsx")
Response.BinaryWrite(bytesInStream)
Response.End()
memoryStream.Dispose()
@@ -381,7 +381,7 @@ Partial Class Vta_RepDocumentacionVencidaClientes
'ExportaExcel()
If DTDatos.Rows.Count > 0 Then
- GvDocumentos.ExportToExcel("AvanceDocumentacion" & Now.ToString("yyyyMMddhhmmss") & ".xls")
+ GvDocumentos.ExportToExcel("AvanceDocumentacion" & NowADS().ToString("yyyyMMddhhmmss") & ".xls")
End If
End Sub
diff --git a/Ventas/RepIndicadoresPorProyecto.aspx.vb b/Ventas/RepIndicadoresPorProyecto.aspx.vb
index 29af6b202..eaece06b4 100644
--- a/Ventas/RepIndicadoresPorProyecto.aspx.vb
+++ b/Ventas/RepIndicadoresPorProyecto.aspx.vb
@@ -24,8 +24,8 @@ Partial Class Ventas_RepIndicadoresPorProyecto
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
- txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = FirstDayOfMonth(NowADS()).ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
End Sub
diff --git a/Ventas/RepLineasAdicionales.aspx.cs b/Ventas/RepLineasAdicionales.aspx.cs
index f742824ee..604b1878a 100644
--- a/Ventas/RepLineasAdicionales.aspx.cs
+++ b/Ventas/RepLineasAdicionales.aspx.cs
@@ -312,14 +312,14 @@ public partial class Ventas_RepLineasAdicionales : ClsPaginas
if(TipoLinea == 1)
{
GridView gvTemp = GvLineasAdicionales;
- //gvTemp.ExportToExcelX("RepLineasAdicionales" + DateTime.Now.ToShortDateString());
+ //gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString());
gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150);
}
else if(TipoLinea == 2)
{
GridView gvTemp = GvLAPO;
gvTemp.Columns[12].Visible = false;
- //gvTemp.ExportToExcelX("ReportePO" + DateTime.Now.ToShortDateString());
+ //gvTemp.ExportToExcelX("ReportePO" + NowADS().ToShortDateString());
gvTemp.ExportToExcelGembox( "ReportePO", UsuarioActual, "Reporte PO ", AnchoImagen:150);
}
}
diff --git a/Ventas/RepNCxAplicar.aspx.cs b/Ventas/RepNCxAplicar.aspx.cs
index 17364dc3b..e1f32d2d0 100644
--- a/Ventas/RepNCxAplicar.aspx.cs
+++ b/Ventas/RepNCxAplicar.aspx.cs
@@ -129,7 +129,7 @@ public partial class Ventas_RepNCxAplicar : ClsPaginas
@params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
@params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- @params.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ @params.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
@params.Add(new ReportParameter("Filtros", $"{Sucursal}{Cliente}{FechaI}{FechaF}{Saldo}"));
//@params.Add(new ReportParameter("Sucursal", DdlSucursal.SelectedItem.Text));
diff --git a/Ventas/RepPS.aspx.vb b/Ventas/RepPS.aspx.vb
index 495a4d7d0..43fb8e8ac 100644
--- a/Ventas/RepPS.aspx.vb
+++ b/Ventas/RepPS.aspx.vb
@@ -47,10 +47,10 @@ Partial Class Ventas_RepPS
End If
End Sub
Private Sub CargaDatosIniciales()
- txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
- txtFechaF.Text = Now.ToString("dd/MM/yyyy")
+ txtFechaI.Text = $"01/{NowADS().Month}/{NowADS().Year}"
+ txtFechaF.Text = NowADS().ToString("dd/MM/yyyy")
- TxtFechaConsulta.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaConsulta.Text = NowADS().ToString("dd/MM/yyyy")
End Sub
Private Sub CargaCombos()
@@ -159,7 +159,7 @@ Partial Class Ventas_RepPS
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReporteProductosServicios" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteProductosServicios" & NowADS().ToShortDateString)
End Sub
Private Sub GenerarPDF()
Dim FechaI, FechaF As Date
@@ -178,7 +178,7 @@ Partial Class Ventas_RepPS
params.Add(New ReportParameter("FechaFin", If(txtFechaF.Text <> "", FechaF.ToShortDateString, "")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("Parametros", SbParametros.ToString()))
@@ -440,7 +440,7 @@ Partial Class Ventas_RepPS
Dim columnRefFranquiciasResumen As Integer = 6
'PRM 19
- worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen).Value = $"PRM {Now.Year - 1}"
+ worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen).Value = $"PRM {NowADS().Year - 1}"
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 1).Value = "ALM PS"
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 2).Value = ""
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Value = TotalFranquicias
@@ -448,10 +448,10 @@ Partial Class Ventas_RepPS
'TOMA EL VALOR DE DIF LLANTAS
worksheet.Cells(IdxRefFranquiciasResumen + 1, columnRefFranquiciasResumen).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen - 4, 3).Name})"
- worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 1).Value = $"FRANQ {Now.Year}"
+ worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 1).Value = $"FRANQ {NowADS().Year}"
worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Value = 4988
- worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen).Value = $"PRM {Now.Year}"
+ worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen).Value = $"PRM {NowADS().Year}"
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 1).Value = ""
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2).Formula = $"=({worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Name} - {worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Name})"
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 3).Formula = $"+({worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2)})"
@@ -488,26 +488,26 @@ Partial Class Ventas_RepPS
Dim columnRefAnioResumen As Integer = columnRefFranquiciasResumen + 5
'AÑO ANTERIOR
- worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen).Value = Now.Year - 1
+ worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen).Value = NowADS().Year - 1
Dim CellAnioAnterior = worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1)
CellAnioAnterior.Value = 0
'AÑO ACTUAL
- worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen).Value = Now.Year
+ worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen).Value = NowADS().Year
Dim CellAnioActual = worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen + 1)
CellAnioActual.Value = 0
worksheet.Cells(IdxRefAnioResumen + 2, columnRefAnioResumen + 1).Formula = $"=({CeldaTotalVentaAcumulada.Name} - {worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1).Name})"
- worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen).Value = $"X DIA {Now.Year - 1}"
- worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen).Value = $"X DIA {Now.Year}"
+ worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen).Value = $"X DIA {NowADS().Year - 1}"
+ worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen).Value = $"X DIA {NowADS().Year}"
Dim DiasFinMes As Integer = 0
- Dim Day As Integer = Now.Day
- Dim DaysMonth As Integer = DateTime.DaysInMonth(Now.Year, Now.Month)
- Dim Month As Integer = Now.Month
- Dim Year As Integer = Now.Year
+ Dim Day As Integer = NowADS().Day
+ Dim DaysMonth As Integer = DateTime.DaysInMonth(NowADS().Year, NowADS().Month)
+ Dim Month As Integer = NowADS().Month
+ Dim Year As Integer = NowADS().Year
For i = Day To DaysMonth
Dim DayRef As DateTime = New DateTime(Year, Month, i)
diff --git a/Ventas/RepPUESinPago.aspx.vb b/Ventas/RepPUESinPago.aspx.vb
index 2a4b822b6..80cb746cf 100644
--- a/Ventas/RepPUESinPago.aspx.vb
+++ b/Ventas/RepPUESinPago.aspx.vb
@@ -24,8 +24,8 @@ Partial Class Ventas_RepPUESinPago
End Sub
Private Sub InicializaValores()
- TxtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
- TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ TxtFechaI.Text = FirstDayOfMonth(NowADS()).ToShortDateString
+ TxtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
diff --git a/Ventas/RepPedidos2.aspx.cs b/Ventas/RepPedidos2.aspx.cs
index b66bc3f7c..242414e67 100644
--- a/Ventas/RepPedidos2.aspx.cs
+++ b/Ventas/RepPedidos2.aspx.cs
@@ -33,9 +33,9 @@ public partial class Ventas_RepPedidos2 : ClsPaginas
DdlVendedor.DataBind();
if (UsuarioActual.CveVendedor > 0) { DdlVendedor.SelectedValuesIfExistM(UsuarioActual.CveVendedor.ToString()); }
- txtFechaI.Text = DateTime.Now.AddMonths(-12).ToShortDateString();
- txtFechaF.Text = DateTime.Now.AddMonths(6).ToShortDateString();
- //TxtFechaVencimiento.Text = DateTime.Now.ToShortDateString();
+ txtFechaI.Text = NowADS().AddMonths(-12).ToShortDateString();
+ txtFechaF.Text = NowADS().AddMonths(6).ToShortDateString();
+ //TxtFechaVencimiento.Text = NowADS().ToShortDateString();
}
protected void GenerarPDF(String Opcion)
@@ -60,7 +60,7 @@ public partial class Ventas_RepPedidos2 : ClsPaginas
List para = new List();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ para.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
para.Add(new ReportParameter("Filtros", $"Filtros: {FechaI}{FechaF}{FechaV}{Cliente}{SubProyectos}{Vendedores}"));
if (Imagen.Exists)
{
@@ -115,7 +115,7 @@ public partial class Ventas_RepPedidos2 : ClsPaginas
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
- if (e.Row.DBCampo("FechaVencimiento").ToDate() < DateTime.Now)
+ if (e.Row.DBCampo("FechaVencimiento").ToDate() < NowADS())
{
e.Row.Cells[2].ForeColor = System.Drawing.Color.Red;
diff --git a/Ventas/RepPedidos2Detalle.aspx.cs b/Ventas/RepPedidos2Detalle.aspx.cs
index 6dc91dcee..920cf598b 100644
--- a/Ventas/RepPedidos2Detalle.aspx.cs
+++ b/Ventas/RepPedidos2Detalle.aspx.cs
@@ -39,13 +39,13 @@ public partial class Ventas_RepPedidos2Detalle : ClsPaginas
DdlVendedor.DataBind();
if (UsuarioActual.CveVendedor > 0) { DdlVendedor.SelectedValuesIfExistM(UsuarioActual.CveVendedor.ToString()); }
- txtFechaI.Text = DateTime.Now.ToShortDateString();
- txtFechaF.Text = DateTime.Now.AddMonths(1).ToShortDateString();
- //TxtFechaVencimiento.Text = DateTime.Now.ToShortDateString();
+ txtFechaI.Text = NowADS().ToShortDateString();
+ txtFechaF.Text = NowADS().AddMonths(1).ToShortDateString();
+ //TxtFechaVencimiento.Text = NowADS().ToShortDateString();
CveVenta = Request["CveVenta"] == null ? -1 : Request["CveVenta"].ToString().ToEntero();
- txtFechaI.Text = Request["FechaI"] == null ? DateTime.Now.ToString() : Request["FechaI"].ToString();
- txtFechaF.Text = Request["FechaF"] == null ? DateTime.Now.ToString() : Request["FechaF"].ToString();
+ txtFechaI.Text = Request["FechaI"] == null ? NowADS().ToString() : Request["FechaI"].ToString();
+ txtFechaF.Text = Request["FechaF"] == null ? NowADS().ToString() : Request["FechaF"].ToString();
TxtFechaVencimiento.Text = Request["FechaV"] == null ? "" : Request["FechaV"].ToString();
if (TxtFechaVencimiento.Text.ToDate() >= MaxFecha) { TxtFechaVencimiento.Text = ""; }
DdlClientes.SelectedValue =Request["CveCliente"] == null ? "-1" : Request["CveCliente"].ToString();
@@ -76,7 +76,7 @@ public partial class Ventas_RepPedidos2Detalle : ClsPaginas
List para = new List();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ para.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
para.Add(new ReportParameter("Filtros", $"Filtros: {FechaI}{FechaF}{FechaV}{Cliente}{SubProyectos}{Vendedores}"));
if (Imagen.Exists)
{
@@ -136,7 +136,7 @@ public partial class Ventas_RepPedidos2Detalle : ClsPaginas
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
- if (e.Row.DBCampo("FechaVencimiento").ToDate() < DateTime.Now)
+ if (e.Row.DBCampo("FechaVencimiento").ToDate() < NowADS())
{
e.Row.Cells[2].ForeColor = System.Drawing.Color.Red;
}
diff --git a/Ventas/RepProductosServicios.aspx b/Ventas/RepProductosServicios.aspx
index e372cf0b1..2941e38cb 100644
--- a/Ventas/RepProductosServicios.aspx
+++ b/Ventas/RepProductosServicios.aspx
@@ -379,6 +379,11 @@
+
+
+
+
+
diff --git a/Ventas/RepProductosServicios.aspx.vb b/Ventas/RepProductosServicios.aspx.vb
index ed6a05dc5..257116385 100644
--- a/Ventas/RepProductosServicios.aspx.vb
+++ b/Ventas/RepProductosServicios.aspx.vb
@@ -194,8 +194,8 @@ Partial Class Ventas_RepProductosServicios
DdlVendedor.Enabled = False
End If
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
If UsuarioActual.TienePermisoProceso(339) Then
GvDatos.Columns(2).Visible = False
@@ -240,6 +240,9 @@ Partial Class Ventas_RepProductosServicios
ServicioDomicilio:=DdlServicioDomicilio.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjVentas.DtResultados
DtVentas = ObjVentas.DtResultados
+ If UsuarioActual.CveEmpresa = 140 Then
+ GvDatos.Columns(1).Visible = True
+ End If
Else
GvDatos.DataSource = Nothing
End If
@@ -291,13 +294,15 @@ Partial Class Ventas_RepProductosServicios
Else
If e.Row.DBCampo("Orden") = "" Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
- e.Row.Cells(0).Width = Unit.Pixel(200)
+ e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).Width = Unit.Pixel(60)
- e.Row.Cells(2).Width = Unit.Pixel(90)
+ e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
+ e.Row.Cells(2).Width = Unit.Pixel(60)
e.Row.Cells(3).Width = Unit.Pixel(90)
- e.Row.Cells(5).Width = Unit.Pixel(80)
- e.Row.Cells(8).Width = Unit.Pixel(100)
+ e.Row.Cells(4).Width = Unit.Pixel(90)
+ e.Row.Cells(6).Width = Unit.Pixel(80)
+ e.Row.Cells(9).Width = Unit.Pixel(100)
e.Row.CssClass = "Totales"
Css = "Totales"
ElseIf DdlGrupo.SelectedValue.Contiene("20", "21") And Not e.Row.DBCampo("CvePS").ToEntero > 0 Then
@@ -312,7 +317,7 @@ Partial Class Ventas_RepProductosServicios
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim(), "-1")
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim(), "-1")
- Dim Liga = String.Format("/Ventas/RepProductosServiciosDetalle.aspx?CveProyecto={0}&CveSubProyecto={1}&CveCategoria={2}&CveClasificacion={3}&CvePS={4}&CveCliente={5}&CveSubProyectoEjecucion={6}&CveVendedor={7}&CveUsuario={8}&CveEstatus={9}&Anio={10}&Mes={11}&AnioMes={12}&Fecha={13}&AnioEjec={14}&MesEjec={15}&AnioMesEjec={16}&FechaEjec={17}&FechaI={18}&FechaF={19}&FechaEI={20}&FechaEF={21}&TipoDocto={22}&Grupo={23}&CveMoneda={24}&TipoCambio={25}&TCEspecifico={26}&CveClienteClasificacion={27}&CveProveedorCompra={28}&CveMarca={29}&CveClasificacionDetalle={30}&TipoCliente={31}&ModalidadContable={32}&EsGarantia={33}&CveCondicionesPago={34}&MostrarLitraje={35}&EsDistribuidor={36}&CveClienteSucursal={37}&CveClasificacion2={38}&ServicioDomicilio={39}",
+ Dim Liga As String = String.Format("/Ventas/RepProductosServiciosDetalle.aspx?CveProyecto={0}&CveSubProyecto={1}&CveCategoria={2}&CveClasificacion={3}&CvePS={4}&CveCliente={5}&CveSubProyectoEjecucion={6}&CveVendedor={7}&CveUsuario={8}&CveEstatus={9}&Anio={10}&Mes={11}&AnioMes={12}&Fecha={13}&AnioEjec={14}&MesEjec={15}&AnioMesEjec={16}&FechaEjec={17}&FechaI={18}&FechaF={19}&FechaEI={20}&FechaEF={21}&TipoDocto={22}&Grupo={23}&CveMoneda={24}&TipoCambio={25}&TCEspecifico={26}&CveClienteClasificacion={27}&CveProveedorCompra={28}&CveMarca={29}&CveClasificacionDetalle={30}&TipoCliente={31}&ModalidadContable={32}&EsGarantia={33}&CveCondicionesPago={34}&MostrarLitraje={35}&EsDistribuidor={36}&CveClienteSucursal={37}&CveClasificacion2={38}&ServicioDomicilio={39}",
e.Row.DBCampo("CveProyecto"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCategoria"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CvePS"),
e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyectoEjecucion"), e.Row.DBCampo("Vendedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"),
e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("AnioEjec"), e.Row.DBCampo("MesEjec"), e.Row.DBCampo("AnioMesEjec"), e.Row.DBCampo("FechaEjec"),
@@ -430,7 +435,7 @@ Partial Class Ventas_RepProductosServicios
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
Dim TipoCambio As Double
LiEspecifico.Visible = True
- TipoCambio = GlobalTipoCambio(Now)
+ TipoCambio = GlobalTipoCambio(NowADS())
TxtEspecifico.Text = TipoCambio.ToString
Else
LiEspecifico.Visible = False
@@ -449,7 +454,7 @@ Partial Class Ventas_RepProductosServicios
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReporteProductosServicios" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteProductosServicios" & NowADS().ToShortDateString)
End Sub
Private Sub GenerarPDF()
Dim FechaI, FechaF, FechaIEjec, FechaFEjec As Date
@@ -480,7 +485,7 @@ Partial Class Ventas_RepProductosServicios
params.Add(New ReportParameter("FechaFin", If(txtFechaF.Text <> "", FechaF.ToShortDateString, "")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", $"{Grupo}{Cliente}{FechaInicio}{FechaFin}{Categoria}{Clasificacion}{PS}{Proyecto}{Estatus}{Usuario}{Proveedor}"))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
ImprimirPDF("Empresas/Grales/Formatos/RepProductosServicios.rdlc", DtVentas, params, "ReportePS")
diff --git a/Ventas/RepProductosServiciosDetalle.aspx b/Ventas/RepProductosServiciosDetalle.aspx
index 038f2ae22..a1e8b1050 100644
--- a/Ventas/RepProductosServiciosDetalle.aspx
+++ b/Ventas/RepProductosServiciosDetalle.aspx
@@ -429,7 +429,7 @@
<%--18--%>
<%--19--%>
-
+
diff --git a/Ventas/RepProductosServiciosDetalle.aspx.vb b/Ventas/RepProductosServiciosDetalle.aspx.vb
index f5514e887..b83febb46 100644
--- a/Ventas/RepProductosServiciosDetalle.aspx.vb
+++ b/Ventas/RepProductosServiciosDetalle.aspx.vb
@@ -116,8 +116,8 @@ Partial Class Ventas_RepProductosServiciosDetalle
End Sub
Private Sub SetValues()
- txtFechaI.Text = Now.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
'Cargo Categorias
DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
@@ -510,7 +510,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
Dim TipoCambioM As Double
LiEspecifico.Visible = True
- TipoCambioM = GlobalTipoCambio(Now)
+ TipoCambioM = GlobalTipoCambio(NowADS())
TxtEspecifico.Text = TipoCambioM.ToString
Else
LiEspecifico.Visible = False
@@ -670,7 +670,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReporteProductosServicios" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteProductosServicios" & NowADS().ToShortDateString)
End Sub
#End Region
@@ -695,7 +695,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
ImprimirPDF("Empresas/Grales/Formatos/RepProductosServiciosDetalle.rdlc", TmpDT, params, "ReportePS")
'ImprimirPDF(String.Format("{0}Formatos\RepProductosServicios.rdlc", UsuarioActual.Empresa.Ruta), dtPS, params, "ReporteProductosServicios")
@@ -773,7 +773,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
Dim Archivo As String = String.Empty
Dim HuboInexistentes As Boolean = False
Dim SBInexistentes As New StringBuilder : SBInexistentes.Append("No se pudieron anexar los siguientes archivos: ")
- Dim ArchivoDestino As String = String.Format("{0}Temp\{1}.zip", AppDomain.CurrentDomain.BaseDirectory, Now.ToString("yyyyMMddhhmmss") & UsuarioActual.CveUsuario.ToString)
+ Dim ArchivoDestino As String = String.Format("{0}Temp\{1}.zip", AppDomain.CurrentDomain.BaseDirectory, NowADS().ToString("yyyyMMddhhmmss") & UsuarioActual.CveUsuario.ToString)
Dim archiveZip As ZipArchive = ZipFile.Open(ArchivoDestino, ZipArchiveMode.Create)
Dim DTVentas As DataTable = TmpDT.FiltraParametros("", "", {"CveVenta", "TipoDocumento", "Folio", "SerieFolio"})
@@ -812,7 +812,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
archiveZip.Dispose()
Response.Clear()
Response.ContentType = "application/zip"
- Response.AddHeader("content-disposition", $"attachment; filename=facturas{Now.ToString("yyyyMMddhhmmss")}.zip")
+ Response.AddHeader("content-disposition", $"attachment; filename=facturas{NowADS().ToString("yyyyMMddhhmmss")}.zip")
Response.TransmitFile(ArchivoDestino)
Response.Flush()
diff --git a/Ventas/RepProductosServiciosPeriodo.aspx.cs b/Ventas/RepProductosServiciosPeriodo.aspx.cs
index 92e01ef39..9d85b7918 100644
--- a/Ventas/RepProductosServiciosPeriodo.aspx.cs
+++ b/Ventas/RepProductosServiciosPeriodo.aspx.cs
@@ -208,7 +208,7 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
if (TipoCambio == 3)
{
LiEspecifico.Visible = true;
- TCEspecifico = get_GlobalTipoCambio(DateTime.Now).ToDecimal();
+ TCEspecifico = get_GlobalTipoCambio(NowADS()).ToDecimal();
TxtEspecifico.Text = TCEspecifico.ToString();
}
else
@@ -338,7 +338,7 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
StringBuilder Str = new StringBuilder();
Str.AppendLine("Header Section,,,,,,,,,,,End Customer Identification ,,,,,,,,,,,,, Ship To Identification,,,,,,,,,,,,, Sold To Identification,,,,,,,,,,,,, Bill To Identification,,,,,,,,,,,,, Salesperson Detail,,,,,, Line Item Detail,,,,,,,,,,,,,,,,,,,,,,,,,,,, New FIELDS,,,,,,,,,,,,,,,,,,,,,,,,,, ");
Str.AppendLine("Partner Purchase Price Currency Code, Exchange Rate, Reporter_id, Reported Partner Type, Reporter Company Name , Sell From Address line 1, Sell From Address line 2, Sell From City, Reported Partner State/Province, Sell from postal code, Sell from Country code,End User Customer Name,End User Company Tax ID,End User Address Line 1,End User Address Line 2,End User City,End User State/Province Code,End User Postal Code,End User Country Code,End User ID,End Customer Department,End Customer Contact Name,End Customer Contact Phone,End Customer County, Ship To Customer Name, Ship To Company Tax ID, Ship To Address Line 1, Ship To Address Line 2, Ship To City, Ship To State/Province Code, Ship To Postal Code, Ship To Country Code, Ship To Customer ID, Ship To Department, Ship To Contact Name, Ship To Contact Phone, Ship To County, Sold To Customer Name, Sold To Company Tax ID, Sold To Address Line 1, Sold To Address Line 2, Sold To City, Sold To State/Province Code, Sold To Postal Code, Sold To Country Code, Sold To Customer ID, Sold To Department, Sold To Contact Name, Sold To Contact Phone, Sold To County, Bill To Customer Name, Bill To Company Tax ID, Bill To Address Line 1 , Bill To Address Line 2, Bill To City, Bill To State/Province Code, Bill To Postal Code, Bill To Country Code, Bill To Customer ID, Bill To Agreement Number, Bill To Contact Name, Bill To Contact Phone, Bill To County, HP Representative Name, HP Sales Rep Email, Salesperson2 Name, Salesperson2 Unique Employee ID, Salesperson's Manager's Name,Salesperson's Manager Unique Employee ID,Quantity Qualifier,Product Quantity Shipped/Sold,Line Item ID,Partner Reported Product ID,Product Description,Date Type Qualifier,Channel Partner to Customer Transaction Date,Reseller’’s Product Number,Partner Purchase Price,Extended Price,Partner Sell Price,Extended Resale Price,Transaction Type,Rebate Tracking #,Partner Requested Rebate Amount,Extended Rebate Amount,Debit Number,Channel Partner to Customer Invoice ID,Reference Number,Customer to Channel Partner Purchase Order ID,Deal ID #1,Deal ID #2,Deal ID #3,Deal ID #4,Deal ID #5,Deal ID #6,Marketing Subprogram Code,Product Serial ID assigned by HP,Purchasing Source wholesaler indicator,Drop Ship Flag,Distributor's Invoice Number,Partner Internal transaction ID,Partner Comment,Deal Bundle ID #1,Deal Bundle ID #2,Deal Bundle ID #3,Deal Bundle ID #4,Deal Bundle ID #5,Deal Bundle ID #6,NMSO NAME,Sales Type,Purchase Agreement,Product Origin,Partner Reported CBN#,Partner Reference,Supplies Tracking ID (QR Code),Sell From Location ID (assigned by HP or Partner-assigned),Sell from name,Comment Deal ID #1,Comment Deal ID #2,Comment Deal ID #3,Comment Deal ID #4,Comment Deal ID #5,Comment Deal ID #6,Partner Sell Price Currency Code");
- if (Rep.GetReporteHP(72, DateTime.Now.AddMonths(-1).FirstDayOfMonth(), DateTime.Now.AddMonths(-1).LastDayOfMonth()))
+ if (Rep.GetReporteHP(72, NowADS().AddMonths(-1).FirstDayOfMonth(), NowADS().AddMonths(-1).LastDayOfMonth()))
{
foreach (DataRow dr in Rep.DtResultados.Rows)
{
@@ -419,7 +419,7 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
para.Add(new ReportParameter("FechaInicio", FechaI));
para.Add(new ReportParameter("FechaFin", FechaF));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()));
+ para.Add(new ReportParameter("FechaImpresion", NowADS().ToShortDateString()));
para.Add(new ReportParameter("Filtros", StrFiltro.ToString()));
if (Imagen.Exists)
{
@@ -429,7 +429,7 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
{
para.Add(new ReportParameter("LogoPath", ""));
}
- ImprimirPDF("Empresas/Grales/Formatos/RepVentasPeriodo.rdlc", dt, para, String.Format("ReporteVentas-{0}", DateTime.Now.ToShortDateString()), Formato: Formato);
+ ImprimirPDF("Empresas/Grales/Formatos/RepVentasPeriodo.rdlc", dt, para, String.Format("ReporteVentas-{0}", NowADS().ToShortDateString()), Formato: Formato);
}
else
{
diff --git a/Ventas/RepRecuperacion.aspx.vb b/Ventas/RepRecuperacion.aspx.vb
index bea502913..257a7afd7 100644
--- a/Ventas/RepRecuperacion.aspx.vb
+++ b/Ventas/RepRecuperacion.aspx.vb
@@ -146,8 +146,8 @@ Partial Class Ventas_RepRecuperacion
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClienteClasificacion.DataBind()
- txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = $"01/{NowADS().Month}/{NowADS().Year}"
+ txtFechaF.Text = NowADS().ToShortDateString
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
@@ -299,10 +299,10 @@ Partial Class Ventas_RepRecuperacion
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF(RutaPDF, DtDatos, params, String.Format("ReporteRecuperacion-{0}", Now.ToDateTime.ToShortDateString), Formato)
+ ImprimirPDF(RutaPDF, DtDatos, params, String.Format("ReporteRecuperacion-{0}", NowADS().ToDateTime.ToShortDateString), Formato)
Else
Alert("No hay datos consultados.", TipoMensaje.MsgAdvertencia)
End If
@@ -316,7 +316,7 @@ Partial Class Ventas_RepRecuperacion
TipoCambio = RblTipoCambio.SelectedValue.ToEntero
If TipoCambio = 3 Then
LiEspecifico.Visible = True
- TCEspecifico = GlobalTipoCambio(Now).ToDecimal
+ TCEspecifico = GlobalTipoCambio(NowADS()).ToDecimal
TxtEspecifico.Text = TCEspecifico.ToString
Else
LiEspecifico.Visible = False
diff --git a/Ventas/RepRecuperacionDetalle.aspx.vb b/Ventas/RepRecuperacionDetalle.aspx.vb
index 8ed4521e2..00967ee3c 100644
--- a/Ventas/RepRecuperacionDetalle.aspx.vb
+++ b/Ventas/RepRecuperacionDetalle.aspx.vb
@@ -356,10 +356,10 @@ Partial Class Ventas_RepRecuperacionDetalle
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF(RutaPDF, DtDatos, params, String.Format("ReporteRecuperacionDetalle-{0}", Now.ToDateTime.ToShortDateString), Formato)
+ ImprimirPDF(RutaPDF, DtDatos, params, String.Format("ReporteRecuperacionDetalle-{0}", NowADS().ToDateTime.ToShortDateString), Formato)
Else
Alert("No hay datos consultados.", TipoMensaje.MsgAdvertencia)
End If
diff --git a/Ventas/RepRecuperacionPeriodo.aspx.cs b/Ventas/RepRecuperacionPeriodo.aspx.cs
index df8036b6d..ee823c746 100644
--- a/Ventas/RepRecuperacionPeriodo.aspx.cs
+++ b/Ventas/RepRecuperacionPeriodo.aspx.cs
@@ -86,8 +86,8 @@ public partial class Ventas_RepRecuperacionPeriodo : ClsPaginas
DdlClientes.SelectedText = "Todos";
DdlClientes.SelectedValue = "-1";
- txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
- txtFechaF.Text = DateTime.Now.ToShortDateString();
+ txtFechaI.Text = NowADS().FirstDayOfMonth().ToShortDateString();
+ txtFechaF.Text = NowADS().ToShortDateString();
}
@@ -115,7 +115,7 @@ public partial class Ventas_RepRecuperacionPeriodo : ClsPaginas
List para = new List();
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
- para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString()));
+ para.Add(new ReportParameter("FechaImpresion", NowADS().ToString()));
para.Add(new ReportParameter("Filtros", $"Filtros: {FechaInicio}{FechaFin}{Sucursal}{Grupo}{Vendedor}{Cliente}{ClasificacionCliente}{Banco}{CuentaBancaria}{TipoDocto}{EstatusCliente}{Registro}{Responsable}"));
if (Imagen.Exists)
{
@@ -182,7 +182,7 @@ public partial class Ventas_RepRecuperacionPeriodo : ClsPaginas
if (TipoCambio == 3)
{
LiEspecifico.Visible = true;
- TCEspecifico = get_GlobalTipoCambio(DateTime.Now);
+ TCEspecifico = get_GlobalTipoCambio(NowADS());
TxtEspecifico.Text = TCEspecifico.ToString();
}
else
diff --git a/Ventas/RepRemisiones.aspx.vb b/Ventas/RepRemisiones.aspx.vb
index 9e067f059..41da0b713 100644
--- a/Ventas/RepRemisiones.aspx.vb
+++ b/Ventas/RepRemisiones.aspx.vb
@@ -122,7 +122,7 @@ Partial Class RepRemisiones
e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & ""
e.Row.FCLiteral("LtlFecha").Text = "" & e.Row.FCLiteral("LtlFecha").Text & ""
- If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then
+ If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
' e.Row.Cells(2).CssClass = "danger"
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
@@ -220,11 +220,11 @@ Partial Class RepRemisiones
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -237,6 +237,6 @@ Partial Class RepRemisiones
End Sub
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & NowADS().ToShortDateString)
End Sub
End Class
diff --git a/Ventas/RepRemisiones2.aspx.vb b/Ventas/RepRemisiones2.aspx.vb
index 75e6464d5..a1db721f0 100644
--- a/Ventas/RepRemisiones2.aspx.vb
+++ b/Ventas/RepRemisiones2.aspx.vb
@@ -67,7 +67,7 @@ Partial Class RepRemisiones
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & ""
- If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then
+ If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
' e.Row.Cells(2).CssClass = "danger"
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
@@ -142,10 +142,10 @@ Partial Class RepRemisiones
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -158,6 +158,6 @@ Partial Class RepRemisiones
End Sub
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & NowADS().ToShortDateString)
End Sub
End Class
diff --git a/Ventas/RepRemisionesDetalle.aspx.vb b/Ventas/RepRemisionesDetalle.aspx.vb
index debd8c0c4..c78506cad 100644
--- a/Ventas/RepRemisionesDetalle.aspx.vb
+++ b/Ventas/RepRemisionesDetalle.aspx.vb
@@ -216,7 +216,7 @@ Partial Class RepRemisionesDetalle
#Region "G V - D A T O S "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then
+ If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
' e.Row.Cells(2).CssClass = "danger"
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
@@ -249,10 +249,10 @@ Partial Class RepRemisionesDetalle
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/RepRemisionesDetalle.rdlc", DtVentas, params, String.Format("ReporteRemisionesDetalle-{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/RepRemisionesDetalle.rdlc", DtVentas, params, String.Format("ReporteRemisionesDetalle-{0}", NowADS().ToDateTime.ToShortDateString))
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -264,8 +264,8 @@ Partial Class RepRemisionesDetalle
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- 'GvDatos.ExportToExcel("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString)
- GvDatos.ExportToExcelG("Reporte de Remisiones por Facturar Detalle" & Now.ToShortDateString, Titulo:="Reporte de Remisiones por Facturar Detalle ", Usuario:=UsuarioActual)
+ 'GvDatos.ExportToExcel("Reporte de Remisiones por Facturar Detalle" & NowADS().ToShortDateString)
+ GvDatos.ExportToExcelG("Reporte de Remisiones por Facturar Detalle" & NowADS().ToShortDateString, Titulo:="Reporte de Remisiones por Facturar Detalle ", Usuario:=UsuarioActual)
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
diff --git a/Ventas/RepRemisionesNC.aspx.vb b/Ventas/RepRemisionesNC.aspx.vb
index 8b611b83a..238f9b9c9 100644
--- a/Ventas/RepRemisionesNC.aspx.vb
+++ b/Ventas/RepRemisionesNC.aspx.vb
@@ -53,8 +53,8 @@ Partial Class RepRemisionesNC
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaI.Text = Now.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
CargaSucursales()
CargaCliente()
@@ -108,7 +108,7 @@ Partial Class RepRemisionesNC
Else
e.Row.FCLiteral("LtlFolio").Text = "" & e.Row.FCLiteral("LtlFolio").Text & ""
- If e.Row.DBCampo("FechaVencimiento").ToDate < Now Then
+ If e.Row.DBCampo("FechaVencimiento").ToDate < NowADS() Then
' e.Row.Cells(2).CssClass = "danger"
e.Row.Cells(2).ForeColor = Drawing.Color.Red
End If
@@ -165,14 +165,14 @@ Partial Class RepRemisionesNC
' params.Add(New ReportParameter("FechaInicio", FechaI))
' params.Add(New ReportParameter("FechaFin", FechaF))
' params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- ' params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ ' params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
' params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
' If Imagen.Exists Then
' params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
' Else
' params.Add(New ReportParameter("LogoPath", ""))
' End If
- ' ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", Now.ToDateTime.ToShortDateString))
+ ' ImprimirPDF("Empresas/Grales/Formatos/RepRemisiones.rdlc", DtVentas, params, String.Format("ReporteRemisiones-{0}", NowADS().ToDateTime.ToShortDateString))
' Else
' Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
' End If
@@ -183,6 +183,6 @@ Partial Class RepRemisionesNC
End Sub
'Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- ' GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & Now.ToShortDateString)
+ ' GvDatos.ExportToExcel("Reporte de Remisiones por Facturar" & NowADS().ToShortDateString)
'End Sub
End Class
diff --git a/Ventas/RepSolicitudesCancelacion.aspx b/Ventas/RepSolicitudesCancelacion.aspx
index 2543ba6a6..10e9b8280 100644
--- a/Ventas/RepSolicitudesCancelacion.aspx
+++ b/Ventas/RepSolicitudesCancelacion.aspx
@@ -22,7 +22,7 @@
-
+
@@ -30,7 +30,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
diff --git a/Ventas/RepTopClientesVentas.aspx.vb b/Ventas/RepTopClientesVentas.aspx.vb
index bdedff6f0..7f76425b0 100644
--- a/Ventas/RepTopClientesVentas.aspx.vb
+++ b/Ventas/RepTopClientesVentas.aspx.vb
@@ -41,7 +41,7 @@ Partial Class Ventas_RepTopClientesVentas
tablaAños.Columns.Add(idAño)
tablaAños.Columns.Add(Año)
- Dim añoActual As Integer = DateTime.Now.Year
+ Dim añoActual As Integer = NowADS().Year
For AñoIndex As Integer = añoActual To (añoActual - 10) Step -1
Dim row As DataRow = tablaAños.NewRow()
@@ -83,10 +83,10 @@ Partial Class Ventas_RepTopClientesVentas
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString))
params.Add(New ReportParameter("pImg", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF("Empresas/Grales/Formatos/TopClientes.rdlc", DtClientes, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:="PDF")
+ ImprimirPDF("Empresas/Grales/Formatos/TopClientes.rdlc", DtClientes, params, String.Format("ReporteVentas-{0}", NowADS().ToDateTime.ToShortDateString), Formato:="PDF")
End Sub
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
diff --git a/Ventas/RepTopVentas.aspx b/Ventas/RepTopVentas.aspx
index 50cf0cbaa..dbd1efe6b 100644
--- a/Ventas/RepTopVentas.aspx
+++ b/Ventas/RepTopVentas.aspx
@@ -80,7 +80,7 @@
-
+
@@ -88,7 +88,7 @@
-
+
@@ -96,7 +96,7 @@
-
+
diff --git a/Ventas/RepTopVentas.aspx.vb b/Ventas/RepTopVentas.aspx.vb
index 0e21d2e60..cd4e41378 100644
--- a/Ventas/RepTopVentas.aspx.vb
+++ b/Ventas/RepTopVentas.aspx.vb
@@ -49,7 +49,7 @@ Partial Class Ventas_RepTopVentas
If RblTipoCambio.SelectedValue.ToEntero = 3 Then
Dim TipoCambio As Double
LiEspecifico.Visible = True
- TipoCambio = GlobalTipoCambio(Now)
+ TipoCambio = GlobalTipoCambio(NowADS())
TxtEspecifico.Text = TipoCambio.ToString
Else
LiEspecifico.Visible = False
diff --git a/Ventas/RepVentaDetalle.aspx b/Ventas/RepVentaDetalle.aspx
index 8b8409e9f..bf80fe55d 100644
--- a/Ventas/RepVentaDetalle.aspx
+++ b/Ventas/RepVentaDetalle.aspx
@@ -579,6 +579,12 @@
+ <%-- 39--%>
+
+
+
+
+
@@ -717,7 +723,7 @@
-
+
diff --git a/Ventas/RepVentaDetalle.aspx.vb b/Ventas/RepVentaDetalle.aspx.vb
index e6752cb6c..b292cf75f 100644
--- a/Ventas/RepVentaDetalle.aspx.vb
+++ b/Ventas/RepVentaDetalle.aspx.vb
@@ -303,8 +303,8 @@ Partial Class RepVentaDetalle
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo:=-1).FiltraParametros("VendedorTipo in (1,4)") 'vendedores y vendedores de piso
@@ -625,160 +625,85 @@ Partial Class RepVentaDetalle
Dim objUsuario As New ClsSisUsuarios
Dim ListPersonalizada As New List(Of String)
- If ChkOrdenCompra.Checked Then
- ListPersonalizada.Add("OrdenCompra")
- End If
+ If ChkOrdenCompra.Checked Then ListPersonalizada.Add("OrdenCompra")
- If ChkFolio.Checked Then
- ListPersonalizada.Add("Folio")
- End If
+ If ChkFolio.Checked Then ListPersonalizada.Add("Folio")
- If ChkPedidoContrato.Checked Then
- ListPersonalizada.Add("PedidoContrato")
- End If
+ If ChkPedidoContrato.Checked Then ListPersonalizada.Add("PedidoContrato")
+ If ChkFolio.Checked Then ListPersonalizada.Add("Folio")
- If ChkFolio.Checked Then
- ListPersonalizada.Add("Folio")
- End If
+ If ChkFecha.Checked Then ListPersonalizada.Add("Fecha")
- If ChkFecha.Checked Then
- ListPersonalizada.Add("Fecha")
- End If
+ If ChkCliente.Checked Then ListPersonalizada.Add("Cliente")
- If ChkCliente.Checked Then
- ListPersonalizada.Add("Cliente")
- End If
+ If ChkSubTotal.Checked Then ListPersonalizada.Add("SubTotal")
- If ChkSubTotal.Checked Then
- ListPersonalizada.Add("SubTotal")
- End If
+ If ChkDescuento.Checked Then ListPersonalizada.Add("Descuento")
- If ChkDescuento.Checked Then
- ListPersonalizada.Add("Descuento")
- End If
+ If ChlMotivoDescuento.Checked Then ListPersonalizada.Add("MotivoDescuento")
- If ChlMotivoDescuento.Checked Then
- ListPersonalizada.Add("MotivoDescuento")
- End If
+ If ChkAmortizacion.Checked Then ListPersonalizada.Add("Amortizacion")
- If ChkAmortizacion.Checked Then
- ListPersonalizada.Add("Amortizacion")
- End If
+ If ChkIVA.Checked Then ListPersonalizada.Add("IVA")
- If ChkIVA.Checked Then
- ListPersonalizada.Add("IVA")
- End If
+ If ChkIEPS.Visible AndAlso ChkIEPS.Checked Then ListPersonalizada.Add("IEPS")
- If ChkIEPS.Checked Then
- ListPersonalizada.Add("IEPS")
- End If
+ If ChkRetIVA.Checked Then ListPersonalizada.Add("RetIVA")
- If ChkRetIVA.Checked Then
- ListPersonalizada.Add("RetIVA")
- End If
+ If ChkRetISR.Checked Then ListPersonalizada.Add("RetISR")
- If ChkRetISR.Checked Then
- ListPersonalizada.Add("RetISR")
- End If
+ If ChkTotalImpuestos.Checked Then ListPersonalizada.Add("TotalImpuestos")
- If ChkTotalImpuestos.Checked Then
- ListPersonalizada.Add("TotalImpuestos")
- End If
+ If ChkTotal.Checked Then ListPersonalizada.Add("Total")
- If ChkTotal.Checked Then
- ListPersonalizada.Add("Total")
- End If
+ If ChkMoneda.Checked Then ListPersonalizada.Add("Moneda")
- If ChkMoneda.Checked Then
- ListPersonalizada.Add("Moneda")
- End If
+ If ChkSucursal.Checked Then ListPersonalizada.Add("Sucursal")
- If ChkSucursal.Checked Then
- ListPersonalizada.Add("Sucursal")
- End If
+ If ChkSucursalEjecucion.Checked Then ListPersonalizada.Add("SucursalEjecucion")
- If ChkSucursalEjecucion.Checked Then
- ListPersonalizada.Add("SucursalEjecucion")
- End If
+ If ChkCodigo.Checked Then ListPersonalizada.Add("Codigo")
- If ChkCodigo.Checked Then
- ListPersonalizada.Add("Codigo")
- End If
+ If ChkSucursalCliente.Checked Then ListPersonalizada.Add("SucursalCliente")
- If ChkSucursalCliente.Checked Then
- ListPersonalizada.Add("SucursalCliente")
- End If
+ If ChkSucursalCobranza.Checked Then ListPersonalizada.Add("SucursalCobranza")
- If ChkSucursalCobranza.Checked Then
- ListPersonalizada.Add("SucursalCobranza")
- End If
+ If ChkVendedor.Checked Then ListPersonalizada.Add("Vendedor")
- If ChkVendedor.Checked Then
- ListPersonalizada.Add("Vendedor")
- End If
+ If ChkEstatusFactura.Checked Then ListPersonalizada.Add("EstatusFactura")
- If ChkEstatusFactura.Checked Then
- ListPersonalizada.Add("EstatusFactura")
- End If
+ If ChkMotivoCancelacion.Checked Then ListPersonalizada.Add("MotivoCancelacion")
- If ChkMotivoCancelacion.Checked Then
- ListPersonalizada.Add("MotivoCancelacion")
- End If
+ If ChkSeTimbro.Checked Then ListPersonalizada.Add("SeTimbro")
- If ChkSeTimbro.Checked Then
- ListPersonalizada.Add("SeTimbro")
- End If
+ If ChkSeEnvioMail.Checked Then ListPersonalizada.Add("SeEnvioMail")
- If ChkSeEnvioMail.Checked Then
- ListPersonalizada.Add("SeEnvioMail")
- End If
+ If ChkCuentaContable.Checked Then ListPersonalizada.Add("CuentaContable")
- If ChkCuentaContable.Checked Then
- ListPersonalizada.Add("CuentaContable")
- End If
+ If ChkUsuario.Checked Then ListPersonalizada.Add("Usuario")
- If ChkUsuario.Checked Then
- ListPersonalizada.Add("Usuario")
- End If
+ If ChkObservaciones.Checked Then ListPersonalizada.Add("Observaciones")
- If ChkObservaciones.Checked Then
- ListPersonalizada.Add("Observaciones")
- End If
+ If ChkFolioFiscal.Checked Then ListPersonalizada.Add("FolioFiscal")
- If ChkFolioFiscal.Checked Then
- ListPersonalizada.Add("FolioFiscal")
- End If
+ If ChkMailCliente.Checked Then ListPersonalizada.Add("MailCliente")
- If ChkMailCliente.Checked Then
- ListPersonalizada.Add("MailCliente")
- End If
+ If ChkEstatusFacturacion.Checked Then ListPersonalizada.Add("EstatusFacturacion")
- If ChkEstatusFacturacion.Checked Then
- ListPersonalizada.Add("EstatusFacturacion")
- End If
+ If ChkFolioFacturacion.Checked Then ListPersonalizada.Add("FolioFacturacion")
- If ChkFolioFacturacion.Checked Then
- ListPersonalizada.Add("FolioFacturacion")
- End If
+ If ChkSaldo.Checked Then ListPersonalizada.Add("Saldo")
- If ChkSaldo.Checked Then
- ListPersonalizada.Add("Saldo")
- End If
+ If ChkMetodoPago.Checked Then ListPersonalizada.Add("MetodoPago")
-
- If ChkMetodoPago.Checked Then
- ListPersonalizada.Add("MetodoPago")
- End If
-
- If ChkFormaPago.Checked Then
- ListPersonalizada.Add("FormaPago")
- End If
+ If ChkFormaPago.Checked Then ListPersonalizada.Add("FormaPago")
If ChkUsoCFDI.Checked Then ListPersonalizada.Add("UsoCFDI")
- If ChkKilometraje.Checked Then ListPersonalizada.Add("Kilometraje")
+ If ChkKilometraje.Visible AndAlso ChkKilometraje.Checked Then ListPersonalizada.Add("Kilometraje")
+ If ChkTC.Checked Then ListPersonalizada.Add("TC")
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentaDetalles.aspx", String.Join("|", ListPersonalizada)) Then
'Alert("Personalizacion guardada")
@@ -877,6 +802,9 @@ Partial Class RepVentaDetalle
Case "IEPS"
ChkIEPS.Checked = True
Exit Select
+ Case "TC"
+ ChkTC.Checked = True
+ Exit Select
Case "RetIVA"
ChkRetIVA.Checked = True
Exit Select
@@ -1018,6 +946,7 @@ Partial Class RepVentaDetalle
GvDatos.Columns(37).Visible = ChkFormaPago.Checked
GvDatos.Columns(38).Visible = ChkUsoCFDI.Checked
GvDatos.Columns(39).Visible = ChkKilometraje.Checked
+ GvDatos.Columns(40).Visible = ChkTC.Checked
Personalizo = 1
If Personalizo = 1 Then
@@ -1032,22 +961,22 @@ Partial Class RepVentaDetalle
#Region "IMPRESIONES"
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- 'GvDatos.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
+ 'GvDatos.ExportToExcel("DetalleVentas_" & NowADS().ToShortDateString)
GenerarPDF("Excel")
End Sub
Protected Sub ImgExcelVSH_Click(sender As Object, e As EventArgs) Handles ImgExcelVSH.Click
'GvVsh.Visible = True
- 'GvVsh.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
+ 'GvVsh.ExportToExcel("DetalleVentas_" & NowADS().ToShortDateString)
'GvVsh.Visible = False
- GvDatos.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("DetalleVentas_" & NowADS().ToShortDateString)
End Sub
Protected Sub ImgExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles ImgExcelPersonalizado.Click
'GvVsh.Visible = True
- 'GvVsh.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
+ 'GvVsh.ExportToExcel("DetalleVentas_" & NowADS().ToShortDateString)
'GvVsh.Visible = False
- GvDatos.ExportToExcel("DetalleVentas_" & Now.ToShortDateString & ".xls")
- 'GvDatos.ExportToExcelG("DetalleVentas_" & Now.ToShortDateString & ".xlsx")
+ GvDatos.ExportToExcel("DetalleVentas_" & NowADS().ToShortDateString & ".xls")
+ 'GvDatos.ExportToExcelG("DetalleVentas_" & NowADS().ToShortDateString & ".xlsx")
End Sub
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
@@ -1235,7 +1164,7 @@ Partial Class RepVentaDetalle
params.Add(New ReportParameter("FechaInicio", FechaIn))
params.Add(New ReportParameter("FechaFin", FechaFn))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("TipoDocto", TipoDocto))
params.Add(New ReportParameter("AgrupadoPor", $"Agrupado Por: {Grupo} {TipoDocto} {FechaIn} {FechaFn} {FechaIEjec} {FechaFEjec} {CveCliente} {CveSucursal} {CveSucursalEjec} {Vendedor} {CveUsuario} {CveEstatusFactura} {CondicionesPago} "))
@@ -1247,7 +1176,7 @@ Partial Class RepVentaDetalle
RutaFormato = "Empresas/Grales/Formatos/RepVentaDetalle.rdlc"
End If
- ImprimirPDF(RutaFormato, dt, params, String.Format("ReporteVentaDetalle-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
+ ImprimirPDF(RutaFormato, dt, params, String.Format("ReporteVentaDetalle-{0}", NowADS().ToDateTime.ToShortDateString), Formato:=Formato)
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
diff --git a/Ventas/RepVentas.aspx b/Ventas/RepVentas.aspx
index a7632d710..fecc3ef63 100644
--- a/Ventas/RepVentas.aspx
+++ b/Ventas/RepVentas.aspx
@@ -515,19 +515,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb
index 5b6727577..64d428b75 100644
--- a/Ventas/RepVentas.aspx.vb
+++ b/Ventas/RepVentas.aspx.vb
@@ -232,8 +232,8 @@ Partial Class Ventas_RepVentas
DdlTipoRelacion.DataBind()
DdlTipoRelacion.Items.Insert(0, New ListItem("Todos", "-1"))
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().ToShortDateString
End Sub
@@ -347,7 +347,7 @@ Partial Class Ventas_RepVentas
TipoCambio = RblTipoCambio.SelectedValue.ToEntero
If TipoCambio = 3 Then
LiEspecifico.Visible = True
- TCEspecifico = GlobalTipoCambio(Now).ToDecimal
+ TCEspecifico = GlobalTipoCambio(NowADS()).ToDecimal
TxtEspecifico.Text = TCEspecifico.ToString
Else
LiEspecifico.Visible = False
@@ -787,7 +787,7 @@ Partial Class Ventas_RepVentas
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- 'GvDatos.ExportToExcel("ReporteVentas" & Now.ToShortDateString)
+ 'GvDatos.ExportToExcel("ReporteVentas" & NowADS().ToShortDateString)
GenerarPDF("Excel")
End Sub
#End Region
@@ -830,7 +830,7 @@ Partial Class Ventas_RepVentas
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
@@ -840,7 +840,7 @@ Partial Class Ventas_RepVentas
ruta = "Empresas/Grales/Formatos/RepVentas.rdlc"
End If
- ImprimirPDF(ruta, dt, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
+ ImprimirPDF(ruta, dt, params, String.Format("ReporteVentas-{0}", NowADS().ToDateTime.ToShortDateString), Formato:=Formato)
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -977,7 +977,7 @@ Partial Class Ventas_RepVentas
' txtFechaIHP.Text = PrevMondayDate.ToString("dd/MM/yyyy")
' txtFechaFHP.Text = Sunday.ToString("dd/MM/yyyy")
' Case "2" ' MENSUAL
- ' Dim FechaRef As DateTime = Now
+ ' Dim FechaRef As DateTime = NowADS()
' Dim LastDayOfMonth = DateTime.DaysInMonth(FechaRef.Year, FechaRef.Month)
' txtFechaIHP.Text = $"01/{FechaRef.Month}/{FechaRef.Year}"
@@ -1032,10 +1032,10 @@ Partial Class Ventas_RepVentas
Protected Sub ImgExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles ImgExcelPersonalizado.Click
'GvVsh.Visible = True
- 'GvVsh.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
+ 'GvVsh.ExportToExcel("DetalleVentas_" & NowADS().ToShortDateString)
'GvVsh.Visible = False
- GvDatos.ExportToExcel("Ventas_" & Now.ToShortDateString & ".xls")
- 'GvDatos.ExportToExcelG("DetalleVentas_" & Now.ToShortDateString & ".xlsx")
+ GvDatos.ExportToExcel("Ventas_" & NowADS().ToShortDateString & ".xls")
+ 'GvDatos.ExportToExcelG("DetalleVentas_" & NowADS().ToShortDateString & ".xlsx")
End Sub
diff --git a/Ventas/RepVentas.aspx.vb2 b/Ventas/RepVentas.aspx.vb2
index 5659d9865..6853926a0 100644
--- a/Ventas/RepVentas.aspx.vb2
+++ b/Ventas/RepVentas.aspx.vb2
@@ -298,7 +298,7 @@ Partial Class Ventas_RepVentas
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- 'GvDatos.ExportToExcel("ReporteVentas" & Now.ToShortDateString)
+ 'GvDatos.ExportToExcel("ReporteVentas" & NowADS().ToShortDateString)
GenerarPDF("Excel")
End Sub
#End Region
@@ -322,14 +322,14 @@ Partial Class Ventas_RepVentas
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
- ImprimirPDF("Empresas/Grales/Formatos/RepVentas.rdlc", dt, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
+ ImprimirPDF("Empresas/Grales/Formatos/RepVentas.rdlc", dt, params, String.Format("ReporteVentas-{0}", NowADS().ToDateTime.ToShortDateString), Formato:=Formato)
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
End If
@@ -346,7 +346,7 @@ Partial Class Ventas_RepVentas
Dim Str As New StringBuilder
Str.AppendLine("Header Section,,,,,,,,,,,End Customer Identification ,,,,,,,,,,,,, Ship To Identification,,,,,,,,,,,,, Sold To Identification,,,,,,,,,,,,, Bill To Identification,,,,,,,,,,,,, Salesperson Detail,,,,,, Line Item Detail,,,,,,,,,,,,,,,,,,,,,,,,,,,, New FIELDS,,,,,,,,,,,,,,,,,,,,,,,,,, ")
Str.AppendLine("Partner Purchase Price Currency Code, Exchange Rate, Reporter_id, Reported Partner Type, Reporter Company Name , Sell From Address line 1, Sell From Address line 2, Sell From City, Reported Partner State/Province, Sell from postal code, Sell from Country code,End User Customer Name,End User Company Tax ID,End User Address Line 1,End User Address Line 2,End User City,End User State/Province Code,End User Postal Code,End User Country Code,End User ID,End Customer Department,End Customer Contact Name,End Customer Contact Phone,End Customer County, Ship To Customer Name, Ship To Company Tax ID, Ship To Address Line 1, Ship To Address Line 2, Ship To City, Ship To State/Province Code, Ship To Postal Code, Ship To Country Code, Ship To Customer ID, Ship To Department, Ship To Contact Name, Ship To Contact Phone, Ship To County, Sold To Customer Name, Sold To Company Tax ID, Sold To Address Line 1, Sold To Address Line 2, Sold To City, Sold To State/Province Code, Sold To Postal Code, Sold To Country Code, Sold To Customer ID, Sold To Department, Sold To Contact Name, Sold To Contact Phone, Sold To County, Bill To Customer Name, Bill To Company Tax ID, Bill To Address Line 1 , Bill To Address Line 2, Bill To City, Bill To State/Province Code, Bill To Postal Code, Bill To Country Code, Bill To Customer ID, Bill To Agreement Number, Bill To Contact Name, Bill To Contact Phone, Bill To County, HP Representative Name, HP Sales Rep Email, Salesperson2 Name, Salesperson2 Unique Employee ID, Salesperson's Manager's Name,Salesperson's Manager Unique Employee ID,Quantity Qualifier,Product Quantity Shipped/Sold,Line Item ID,Partner Reported Product ID,Product Description,Date Type Qualifier,Channel Partner to Customer Transaction Date,Reseller’’s Product Number,Partner Purchase Price,Extended Price,Partner Sell Price,Extended Resale Price,Transaction Type,Rebate Tracking #,Partner Requested Rebate Amount,Extended Rebate Amount,Debit Number,Channel Partner to Customer Invoice ID,Reference Number,Customer to Channel Partner Purchase Order ID,Deal ID #1,Deal ID #2,Deal ID #3,Deal ID #4,Deal ID #5,Deal ID #6,Marketing Subprogram Code,Product Serial ID assigned by HP,Purchasing Source wholesaler indicator,Drop Ship Flag,Distributor's Invoice Number,Partner Internal transaction ID,Partner Comment,Deal Bundle ID #1,Deal Bundle ID #2,Deal Bundle ID #3,Deal Bundle ID #4,Deal Bundle ID #5,Deal Bundle ID #6,NMSO NAME,Sales Type,Purchase Agreement,Product Origin,Partner Reported CBN#,Partner Reference,Supplies Tracking ID (QR Code),Sell From Location ID (assigned by HP or Partner-assigned),Sell from name,Comment Deal ID #1,Comment Deal ID #2,Comment Deal ID #3,Comment Deal ID #4,Comment Deal ID #5,Comment Deal ID #6,Partner Sell Price Currency Code")
- If Rep.GetReporteHP(72, Now.AddMonths(-1).FirstDayOfMonth, Now.AddMonths(-1).LastDayOfMonth) Then
+ If Rep.GetReporteHP(72, NowADS().AddMonths(-1).FirstDayOfMonth, NowADS().AddMonths(-1).LastDayOfMonth) Then
For Each dr As DataRow In Rep.DtResultados.Rows
Str.AppendLine($"MXN,,AM30089,,""COMPUPROVEEDORES, S.A.DE C.V."",,,,,,,,,,,,,,,,,,,,{dr("Nombre")},{dr("RFC")},{dr("Direccion")},,,{dr("Ciudad")},{dr("Estado")},{dr("CP")},MX,{dr("RFC")},,,,,{dr("Nombre")},{dr("RFC")},{dr("Direccion")},,{dr("Ciudad")},{dr("Estado")},{dr("CP")},MX,{dr("RFC")},,,,,,,,,,,,,,,,,,,,,,,,,{dr("Cantidad")},,{dr("Codigo")},,,{dr("Fecha")},,,,{dr("PU")},,,,,,,{dr("SerieFolio")},,,,,,,,,,,,,,,,,,,,,,,,,{dr("Proveedor")},,,,,,,,,,,,MXN")
Next
@@ -365,7 +365,7 @@ Partial Class Ventas_RepVentas
TipoCambio = RblTipoCambio.SelectedValue.ToEntero
If TipoCambio = 3 Then
LiEspecifico.Visible = True
- TCEspecifico = GlobalTipoCambio(Now).ToDecimal
+ TCEspecifico = GlobalTipoCambio(NowADS()).ToDecimal
TxtEspecifico.Text = TCEspecifico.ToString
Else
LiEspecifico.Visible = False
diff --git a/Ventas/RepVentasAutorizaciones.aspx.cs b/Ventas/RepVentasAutorizaciones.aspx.cs
index 18f5a7129..1d21164ad 100644
--- a/Ventas/RepVentasAutorizaciones.aspx.cs
+++ b/Ventas/RepVentasAutorizaciones.aspx.cs
@@ -23,7 +23,7 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas
{
if (Consultado)
{
- GvDatos.ExportToExcelG("RepVentasAutorizaciones" + DateTime.Now.ToString("dd-MM-yyyy"), "Reporte de Autorizaciones de Ventas", UsuarioActual);
+ GvDatos.ExportToExcelG("RepVentasAutorizaciones" + NowADS().ToString("dd-MM-yyyy"), "Reporte de Autorizaciones de Ventas", UsuarioActual);
}
else
{
@@ -68,8 +68,8 @@ public partial class Ventas_RepVentasAutorizaciones : ClsPaginas
DdlClientes.setEsWebService(true);
- txtFechaI.Text = DateTime.Now.ToShortDateString();
- txtFechaF.Text = DateTime.Now.ToShortDateString();
+ txtFechaI.Text = NowADS().ToShortDateString();
+ txtFechaF.Text = NowADS().ToShortDateString();
}
protected void BtnConsultar_Click(object sender, EventArgs e)
diff --git a/Ventas/RepVentasMensuales.aspx.vb b/Ventas/RepVentasMensuales.aspx.vb
index 1032f0974..ff063fc1a 100644
--- a/Ventas/RepVentasMensuales.aspx.vb
+++ b/Ventas/RepVentasMensuales.aspx.vb
@@ -22,7 +22,7 @@ Partial Class RepVentasMensuales
End If
End Sub
Private Sub InicializarFiltros()
- Dim dNow As Date = Now
+ Dim dNow As Date = NowADS()
TxtFechaF.Text = dNow.ToString("dd/MM/yyyy")
dNow = dNow.AddDays(-30)
TxtFechaI.Text = dNow.ToString("dd/MM/yyyy")
@@ -79,7 +79,7 @@ Partial Class RepVentasMensuales
End Sub
Public Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
- GV.ExportToExcel("Evaluaciones de Proveedores" & Now.ToShortDateString & ".xls")
+ GV.ExportToExcel("Evaluaciones de Proveedores" & NowADS().ToShortDateString & ".xls")
End Sub
Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
diff --git a/Ventas/RepVentasMensualesDetalle.aspx.vb b/Ventas/RepVentasMensualesDetalle.aspx.vb
index 62d099ec2..9f7b39957 100644
--- a/Ventas/RepVentasMensualesDetalle.aspx.vb
+++ b/Ventas/RepVentasMensualesDetalle.aspx.vb
@@ -55,7 +55,7 @@ Partial Class RepVentasMensualesDetalle
End Sub
Public Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
- GV.ExportToExcel("Evaluaciones de Proveedores" & Now.ToShortDateString & ".xls")
+ GV.ExportToExcel("Evaluaciones de Proveedores" & NowADS().ToShortDateString & ".xls")
End Sub
Public Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GV.RowDataBound
diff --git a/Ventas/RepVentasPV.aspx.vb b/Ventas/RepVentasPV.aspx.vb
index f7a797a30..b9aa4e744 100644
--- a/Ventas/RepVentasPV.aspx.vb
+++ b/Ventas/RepVentasPV.aspx.vb
@@ -76,6 +76,6 @@ Partial Class Ventas_RepVentasPV
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
- GvDatos.ExportToExcel("ReporteVentasPV" & Now.ToShortDateString)
+ GvDatos.ExportToExcel("ReporteVentasPV" & NowADS().ToShortDateString)
End Sub
End Class
diff --git a/Ventas/RepVentasPeriodo.aspx.vb b/Ventas/RepVentasPeriodo.aspx.vb
index d009475e7..2a17dd282 100644
--- a/Ventas/RepVentasPeriodo.aspx.vb
+++ b/Ventas/RepVentasPeriodo.aspx.vb
@@ -63,7 +63,7 @@ Partial Class RepVentasPeriodo
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
- txtFechaI.Text = Now.FirstDayOfMonth.ToString("dd/MM/yyyy")
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToString("dd/MM/yyyy")
TipoCambio = 1
TCEspecifico = -1
@@ -302,7 +302,7 @@ Partial Class RepVentasPeriodo
#Region " EXCEL "
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
- 'GvDatos.ExportToExcel("ReporteVentas" & Now.ToShortDateString)
+ 'GvDatos.ExportToExcel("ReporteVentas" & NowADS().ToShortDateString)
GenerarPDF("Excel")
End Sub
#End Region
@@ -327,12 +327,12 @@ Partial Class RepVentasPeriodo
params.Add(New ReportParameter("FechaInicio", FechaI))
params.Add(New ReportParameter("FechaFin", FechaF))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
'Alert("El reporte requiere papel tipo oficio", TipoMensaje.MsgInformacion)
- ImprimirPDF("Empresas/Grales/Formatos/RepVentasPeriodo.rdlc", dt, params, String.Format("ReporteVentas-{0}", Now.ToDateTime.ToShortDateString), Formato:=Formato)
+ ImprimirPDF("Empresas/Grales/Formatos/RepVentasPeriodo.rdlc", dt, params, String.Format("ReporteVentas-{0}", NowADS().ToDateTime.ToShortDateString), Formato:=Formato)
Else
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
@@ -350,7 +350,7 @@ Partial Class RepVentasPeriodo
Dim Str As New StringBuilder
Str.AppendLine("Header Section,,,,,,,,,,,End Customer Identification ,,,,,,,,,,,,, Ship To Identification,,,,,,,,,,,,, Sold To Identification,,,,,,,,,,,,, Bill To Identification,,,,,,,,,,,,, Salesperson Detail,,,,,, Line Item Detail,,,,,,,,,,,,,,,,,,,,,,,,,,,, New FIELDS,,,,,,,,,,,,,,,,,,,,,,,,,, ")
Str.AppendLine("Partner Purchase Price Currency Code, Exchange Rate, Reporter_id, Reported Partner Type, Reporter Company Name , Sell From Address line 1, Sell From Address line 2, Sell From City, Reported Partner State/Province, Sell from postal code, Sell from Country code,End User Customer Name,End User Company Tax ID,End User Address Line 1,End User Address Line 2,End User City,End User State/Province Code,End User Postal Code,End User Country Code,End User ID,End Customer Department,End Customer Contact Name,End Customer Contact Phone,End Customer County, Ship To Customer Name, Ship To Company Tax ID, Ship To Address Line 1, Ship To Address Line 2, Ship To City, Ship To State/Province Code, Ship To Postal Code, Ship To Country Code, Ship To Customer ID, Ship To Department, Ship To Contact Name, Ship To Contact Phone, Ship To County, Sold To Customer Name, Sold To Company Tax ID, Sold To Address Line 1, Sold To Address Line 2, Sold To City, Sold To State/Province Code, Sold To Postal Code, Sold To Country Code, Sold To Customer ID, Sold To Department, Sold To Contact Name, Sold To Contact Phone, Sold To County, Bill To Customer Name, Bill To Company Tax ID, Bill To Address Line 1 , Bill To Address Line 2, Bill To City, Bill To State/Province Code, Bill To Postal Code, Bill To Country Code, Bill To Customer ID, Bill To Agreement Number, Bill To Contact Name, Bill To Contact Phone, Bill To County, HP Representative Name, HP Sales Rep Email, Salesperson2 Name, Salesperson2 Unique Employee ID, Salesperson's Manager's Name,Salesperson's Manager Unique Employee ID,Quantity Qualifier,Product Quantity Shipped/Sold,Line Item ID,Partner Reported Product ID,Product Description,Date Type Qualifier,Channel Partner to Customer Transaction Date,Reseller’’s Product Number,Partner Purchase Price,Extended Price,Partner Sell Price,Extended Resale Price,Transaction Type,Rebate Tracking #,Partner Requested Rebate Amount,Extended Rebate Amount,Debit Number,Channel Partner to Customer Invoice ID,Reference Number,Customer to Channel Partner Purchase Order ID,Deal ID #1,Deal ID #2,Deal ID #3,Deal ID #4,Deal ID #5,Deal ID #6,Marketing Subprogram Code,Product Serial ID assigned by HP,Purchasing Source wholesaler indicator,Drop Ship Flag,Distributor's Invoice Number,Partner Internal transaction ID,Partner Comment,Deal Bundle ID #1,Deal Bundle ID #2,Deal Bundle ID #3,Deal Bundle ID #4,Deal Bundle ID #5,Deal Bundle ID #6,NMSO NAME,Sales Type,Purchase Agreement,Product Origin,Partner Reported CBN#,Partner Reference,Supplies Tracking ID (QR Code),Sell From Location ID (assigned by HP or Partner-assigned),Sell from name,Comment Deal ID #1,Comment Deal ID #2,Comment Deal ID #3,Comment Deal ID #4,Comment Deal ID #5,Comment Deal ID #6,Partner Sell Price Currency Code")
- If Rep.GetReporteHP(72, Now.AddMonths(-1).FirstDayOfMonth, Now.AddMonths(-1).LastDayOfMonth) Then
+ If Rep.GetReporteHP(72, NowADS().AddMonths(-1).FirstDayOfMonth, NowADS().AddMonths(-1).LastDayOfMonth) Then
For Each dr As DataRow In Rep.DtResultados.Rows
Str.AppendLine($"MXN,,AM30089,,""COMPUPROVEEDORES, S.A.DE C.V."",,,,,,,,,,,,,,,,,,,,{dr("Nombre")},{dr("RFC")},{dr("Direccion")},,{dr("Ciudad")},{dr("Estado")},{dr("CP")},MX,{dr("RFC")},,,,,{dr("Nombre")},{dr("RFC")},{dr("Direccion")},,{dr("Ciudad")},{dr("Estado")},{dr("CP")},MX,{dr("RFC")},,,,,,,,,,,,,,,,,,,,,,,,,{dr("Cantidad")},,{dr("Codigo")},,,{dr("Fecha")},,,,{dr("PU")},,,,,,,{dr("SerieFolio")},,,,,,,,,,,,,,,,,,,,,,,,,{dr("Proveedor")},,,,,,,,,,,,MXN")
Next
@@ -369,7 +369,7 @@ Partial Class RepVentasPeriodo
TipoCambio = RblTipoCambio.SelectedValue.ToEntero
If TipoCambio = 3 Then
LiEspecifico.Visible = True
- TCEspecifico = GlobalTipoCambio(Now).ToDecimal
+ TCEspecifico = GlobalTipoCambio(NowADS()).ToDecimal
TxtEspecifico.Text = TCEspecifico.ToString
Else
LiEspecifico.Visible = False
diff --git a/Ventas/RepVentasResumen.aspx.vb b/Ventas/RepVentasResumen.aspx.vb
index a2d9b1d3d..70a217f03 100644
--- a/Ventas/RepVentasResumen.aspx.vb
+++ b/Ventas/RepVentasResumen.aspx.vb
@@ -69,8 +69,8 @@ Partial Class Ventas_RepVentasResumen
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
- TxtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
- TxtFechaF.Text = Now.ToString("dd/MM/yyyy")
+ TxtFechaI.Text = $"01/{NowADS().Month}/{NowADS().Year}"
+ TxtFechaF.Text = NowADS().ToString("dd/MM/yyyy")
End Sub
@@ -111,7 +111,7 @@ Partial Class Ventas_RepVentasResumen
Datos = Nothing
End If
- Dim FechaCorte As String = $"31/12/{Now.Year}"
+ Dim FechaCorte As String = $"31/12/{NowADS().Year}"
If ObjMovtos.GetCxC(TxtFechaI.Text, TxtFechaF.Text, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, -1, 1, -1,
"-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
diff --git a/Ventas/RepVentasUtilidad.aspx.vb b/Ventas/RepVentasUtilidad.aspx.vb
index 7e86e350c..f4f737dd2 100644
--- a/Ventas/RepVentasUtilidad.aspx.vb
+++ b/Ventas/RepVentasUtilidad.aspx.vb
@@ -32,8 +32,8 @@ Partial Class Ventas_RepVentasUtilidad
#Region " INICIALIZA VALORES "
Private Sub CargaCombos()
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
'Carga Clientes
Dim EsWS As Boolean = True
@@ -331,7 +331,7 @@ Partial Class Ventas_RepVentasUtilidad
params.Add(New ReportParameter("FechaInicio", FechaInicio))
params.Add(New ReportParameter("FechaFin", FechaFin))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("AgrupadoPor", $"{Cliente}{Sucursal}{Vendedor}{PS}{Clasificacion}{FechaIn}{FechaFn}"))
params.Add(New ReportParameter("Neto", LblNeto.Text))
params.Add(New ReportParameter("PorNeto", LblPorNeto.Text + " %"))
diff --git a/Ventas/RepVentasUtilidadDetalle.aspx.vb b/Ventas/RepVentasUtilidadDetalle.aspx.vb
index 64b3b60c0..dbe693ea9 100644
--- a/Ventas/RepVentasUtilidadDetalle.aspx.vb
+++ b/Ventas/RepVentasUtilidadDetalle.aspx.vb
@@ -88,8 +88,8 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
- txtFechaI.Text = IfNull(Request("FechaI"), Now.FirstDayOfMonth.ToShortDateString).ToString
- txtFechaF.Text = IfNull(Request("FechaF"), Now.LastDayOfMonth.ToShortDateString).ToString
+ txtFechaI.Text = IfNull(Request("FechaI"), NowADS().FirstDayOfMonth.ToShortDateString).ToString
+ txtFechaF.Text = IfNull(Request("FechaF"), NowADS().LastDayOfMonth.ToShortDateString).ToString
CveVenta = If(Request("CveVenta") <> "", Request("CveVenta").ToString.ToEntero, "-1".ToEntero)
CveVendedor = IfNull(Request("CveVendedor"), "-1").ToString
@@ -314,7 +314,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
params.Add(New ReportParameter("FechaInicio", FechaInicio))
params.Add(New ReportParameter("FechaFin", FechaFin))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("AgrupadoPor", $"{Cliente}{Sucursal}{Vendedor}{PS}{Clasificacion}{FechaIn}{FechaFn}"))
@@ -372,7 +372,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
params.Add(New ReportParameter("FechaInicio", FechaInicio))
params.Add(New ReportParameter("FechaFin", FechaFin))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("AgrupadoPor", $"{Cliente}{Sucursal}{Vendedor}{PS}{Clasificacion}{FechaIn}{FechaFn}"))
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
diff --git a/Ventas/RepVentasUtilidadPadre.aspx b/Ventas/RepVentasUtilidadPadre.aspx
index 43a586407..0b3c08446 100644
--- a/Ventas/RepVentasUtilidadPadre.aspx
+++ b/Ventas/RepVentasUtilidadPadre.aspx
@@ -233,6 +233,7 @@
+
diff --git a/Ventas/RepVentasUtilidadPadre.aspx.vb b/Ventas/RepVentasUtilidadPadre.aspx.vb
index 978e27cae..83879613c 100644
--- a/Ventas/RepVentasUtilidadPadre.aspx.vb
+++ b/Ventas/RepVentasUtilidadPadre.aspx.vb
@@ -40,8 +40,8 @@ Partial Class Ventas_RepVentasUtilidadPadre
#Region " INICIALIZA VALORES "
Private Sub CargaCombos()
- txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
- txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
+ txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
+ txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
'Carga Clientes
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1" Then
@@ -252,7 +252,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CveMarca"), e.Row.DBCampo("CveCategoria"))
e.Row.Cells(0).Text = String.Format("{2}", Css, Liga, e.Row.Cells(0).Text)
Else
- e.Row.Cells(9).BackColor = Drawing.Color.LightGray
+ e.Row.Cells(10).BackColor = Drawing.Color.LightGray
End If
@@ -291,7 +291,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
Dim params As New List(Of ReportParameter)()
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString()))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToString()))
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("Neto", LblNeto.Text))
params.Add(New ReportParameter("PorNeto", $"{LblPorNeto.Text}%"))
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 37b4b57f8..6c126fd2d 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -5367,7 +5367,7 @@
-
+
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 9da0edab4..984c85f62 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -1,5 +1,6 @@
Option Explicit On
Option Strict On
+Option Infer On
Imports System.Data
Imports System.Data.SqlClient
@@ -2437,15 +2438,15 @@ Partial Class Ventas
CveAlmacenDevolucion = 0
Me.CveEstadoCancelacion = 0
- txtFechaICot.Text = Now.AddMonths(-3).ToShortDateString
- TxtFechaIRem.Text = Now.AddMonths(-3).ToShortDateString
- TxtFechaIPed.Text = Now.AddMonths(-3).ToShortDateString
- TxtFechaIOC.Text = Now.AddMonths(-3).ToShortDateString
+ txtFechaICot.Text = NowADS().AddMonths(-3).ToShortDateString
+ TxtFechaIRem.Text = NowADS().AddMonths(-3).ToShortDateString
+ TxtFechaIPed.Text = NowADS().AddMonths(-3).ToShortDateString
+ TxtFechaIOC.Text = NowADS().AddMonths(-3).ToShortDateString
- txtFechaFCot.Text = Now.ToShortDateString
- TxtFechaFRem.Text = Now.ToShortDateString
- TxtFechaFPedido.Text = Now.ToShortDateString
- TxtFechaFOC.Text = Now.ToShortDateString
+ txtFechaFCot.Text = NowADS().ToShortDateString
+ TxtFechaFRem.Text = NowADS().ToShortDateString
+ TxtFechaFPedido.Text = NowADS().ToShortDateString
+ TxtFechaFOC.Text = NowADS().ToShortDateString
If UsuarioActual.TienePermisoProceso(177) Then
DdlTipoComprobante.Items.Insert(4, New ListItem("Pedido de Contrato", "Ped"))
@@ -2526,10 +2527,10 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValue = "Ing"
End If
'DdlTipoComprobante.Attributes.Add("onChange", "ActivaReferencia(this)")
- TxtFecha.Text = Now.ToShortDateString()
- TxtFechaEjecucion.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString()
+ TxtFechaEjecucion.Text = NowADS().ToShortDateString
LblUsuario.Text = UsuarioActual.Usuario
- LblFechaRegistro.Text = Now.ToShortDateString()
+ LblFechaRegistro.Text = NowADS().ToShortDateString()
ImgDescPU.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '0'; $get('LblPrecio1').style.display = ''; $get('LblTotalPS1').style.display = 'none'; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
ImgDescConcepto.Attributes.Add("onclick", "javascript:$('#ModalDescuento').modal(); $get('LblTitulo1').style.display = ''; $get('LblTitulo2').style.display = 'none'; $get('LblTituloTipo1').style.display = ''; $get('LblTituloTipo2').style.display = 'none'; $get('HdnTipoDescuento').value = '1'; $get('LblPrecio1').style.display = 'none'; $get('LblTotalPS1').style.display = ''; $get('LblSubTotal1').style.display = 'none'; $get('LblAmort').style.display = 'none'; $get('BtnAplicarDescP').style.display = ''; $get('BtnAplicarDescG').style.display = 'none'; $get('TrMotivoDescuento').style.display = '';")
@@ -2597,7 +2598,7 @@ Partial Class Ventas
DdlTipoComprobante.Items.Add(New ListItem("Orden Pago", "OP"))
Dim AC As New ClsAC
- If AC.GetPresupuestoIngresos(-1, Now.Year, True, UsuarioActual.CveEmpresa) Then
+ If AC.GetPresupuestoIngresos(-1, NowADS().Year, True, UsuarioActual.CveEmpresa) Then
DdlFuenteRecaudacion.DataSource = AC.DtResultados()
DTPresupuestoIngresos = AC.DtResultados()
ViewState("DTFuenteRecaudacion") = AC.DtResultados()
@@ -2637,7 +2638,7 @@ Partial Class Ventas
ViewState("CveAcercamientoCRM") = Request("CveAcercamientoCRM")
Dim cRMService As ICRMService = New CRMService(System.Configuration.ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
- Dim AcercamientoModel As RequestAcercamiento = New RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamientoCRM)
+ Dim AcercamientoModel As New RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamientoCRM)
Dim objAcercamiento = cRMService.GetAceracamientoCRM(AcercamientoModel)
If objAcercamiento.Result.Count > 0 Then
@@ -2685,6 +2686,7 @@ Partial Class Ventas
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
TmpDT.Columns("NumTurnos").DefaultValue = 0D
+ TmpDT.Columns.Add("NumeroPedimento", GetType(String))
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
@@ -2717,6 +2719,7 @@ Partial Class Ventas
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
TmpDT.Columns("NumTurnos").DefaultValue = 0D
+ TmpDT.Columns.Add("NumeroPedimento", GetType(String))
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
@@ -2744,7 +2747,7 @@ Partial Class Ventas
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True
DivFechaAnticipoCliente.Visible = True
- TxtFechaAnticipoCliente.Text = Now.ToShortDateString
+ TxtFechaAnticipoCliente.Text = NowADS().ToShortDateString
ImgAddObs.Visible = True
CargaEventoBitacora()
@@ -3054,7 +3057,7 @@ Partial Class Ventas
UpnTools.Update()
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
'' Si esta cancelado el compromiso no se puede editar el estatus
'If DdlEstatus.SelectedValue = "9" Then
@@ -3370,7 +3373,7 @@ Partial Class Ventas
TxtFolio.Enabled = False
TxtFecha.Enabled = False
If LblSeTimbro.Text = "No" And DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Dev", "Ant") Then
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
End If
ImgFecha.Visible = False
End If
@@ -3419,7 +3422,7 @@ Partial Class Ventas
UPObservaciones.Update()
End If
- If UsuarioActual.CveEmpresa = 13 Then
+ If UsuarioActual.Empresa.Funcionalidad(163) = "1" Then
TrDescripcionVenta.Visible = True
If CveVenta <= 0 Then
TxtDescripcionVenta.Enabled = True
@@ -3484,8 +3487,8 @@ Partial Class Ventas
If ObjPVenta.DtResultados.Rows.Count > 0 Then
CveCorte = ObjPVenta.CveCorte
- Dim FechaICorte = ObjPVenta.FechaInicial.Date '.AddDays(-5)
- If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < Now.Date Then
+ Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5)
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso FechaICorte < NowADS().Date Then
DebeCerrarCorte = True
LblMotivoBloqueo.Text = $"Existe un corte del día {FechaICorte.ToString("dd/MM/yyyy")}. Favor de cerrarlo para iniciar un nuevo corte."
Else
@@ -3518,9 +3521,9 @@ Partial Class Ventas
Private Sub BtnIniciarTurno_Click(sender As Object, e As EventArgs) Handles BtnIniciarTurno.Click
Dim ObjPVenta As New ClsPuntoVenta
- ObjPVenta.AddVtaCortes(Now, TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa)
+ ObjPVenta.AddVtaCortes(NowADS(), TxtDineroCaja.Text.ToDecimal, UsuarioActual.CveUsuario, TxtDescripcionCaja.Text, UsuarioActual.CveEmpresa)
CveCorte = ObjPVenta.CveCorte
- LblEstatusCaja.Text = Now.ToShortDateString
+ LblEstatusCaja.Text = NowADS().ToShortDateString
TrEstatusCaja.Visible = True
LkbEstadodeCaja.Visible = True
LkbIngreso.Visible = True
@@ -3554,17 +3557,17 @@ Partial Class Ventas
Dt.Columns.Add("Descripcion", GetType(String))
Dt.Columns.Add("Importe", GetType(Decimal))
- Dim Dr1 = Dt.NewRow
+ Dim Dr1 As DataRow = Dt.NewRow
Dr1("Descripcion") = "Fondo de Caja"
Dr1("Importe") = ObjPVenta.DtResultados(0)("ImporteInicial").ToString().ToDouble
Dt.Rows.Add(Dr1)
- Dim Dr2 = Dt.NewRow
+ Dim Dr2 As DataRow = Dt.NewRow
Dr2("Descripcion") = "Ventas en Efectivo"
Dr2("Importe") = ObjPVenta.DtResultados(0)("VentasEfectivo").ToString().ToDouble
Dt.Rows.Add(Dr2)
- Dim Dr21 = Dt.NewRow
+ Dim Dr21 As DataRow = Dt.NewRow
Dr21("Descripcion") = "Devoluciones"
Dr21("Importe") = ObjPVenta.DtResultados(0)("Devoluciones").ToString().ToDouble
Dt.Rows.Add(Dr21)
@@ -3574,17 +3577,17 @@ Partial Class Ventas
'Dr3("Importe") = ObjPVenta.DtResultados(0)("Propina").ToString().ToDouble
'Dt.Rows.Add(Dr3)
- Dim Dr4 = Dt.NewRow
+ Dim Dr4 As DataRow = Dt.NewRow
Dr4("Descripcion") = "Entradas"
Dr4("Importe") = ObjPVenta.DtResultados(0)("Ingresado").ToString().ToDouble
Dt.Rows.Add(Dr4)
- Dim Dr5 = Dt.NewRow
+ Dim Dr5 As DataRow = Dt.NewRow
Dr5("Descripcion") = "Salidas"
Dr5("Importe") = ObjPVenta.DtResultados(0)("Retirado").ToString().ToDouble
Dt.Rows.Add(Dr5)
- Dim Dr6 = Dt.NewRow
+ Dim Dr6 As DataRow = Dt.NewRow
Dr6("Descripcion") = "Total"
Dr6("Importe") = Total
Dt.Rows.Add(Dr6)
@@ -3639,7 +3642,7 @@ Partial Class Ventas
Private Sub BtnAceptarIE_Click(sender As Object, e As EventArgs) Handles BtnAceptarIE.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtCantidadIE.Text.ToEntero() > 0 Then
- If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), Now) Then
+ If ObjPVenta.AddVta_MovimientosCajas(CveCorte, UsuarioActual.CveUsuario, TxtCantidadIE.Text.ToDouble, TxtDescripcionIE.Text, HdnTipoMovimiento.Value.ToEntero(), NowADS()) Then
TxtCantidadIE.Text = ""
TxtDescripcionIE.Text = ""
RegistraScript("$('#DivIngresoEgreso').modal('hide')", "divingresoegreso")
@@ -3652,9 +3655,9 @@ Partial Class Ventas
Private Sub BtnCerrarTurno_Click(sender As Object, e As EventArgs) Handles BtnCerrarTurno.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtEfectivoEnCaja.Text.Trim <> "" Then
- If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, Now, UsuarioActual.CveEmpresa) Then
+ If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoEnCaja.Text.ToDouble, LblDiferenciaCaja.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
- Dim Liga = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
+ Dim Liga As String = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
End If
End If
@@ -3664,9 +3667,9 @@ Partial Class Ventas
Private Sub BtnCerrarBloqueo_Click(sender As Object, e As EventArgs) Handles BtnCerrarBloqueo.Click
Dim ObjPVenta As New ClsPuntoVenta
If TxtEfectivoCajaBloqueo.Text.Trim <> "" Then
- If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, Now, UsuarioActual.CveEmpresa) Then
+ If ObjPVenta.UpdateFinalizadoVtaCortes(CveCorte, TxtEfectivoCajaBloqueo.Text.ToDouble, LblDiferenciaCajaBloqueo.Text.ToDouble, NowADS(), UsuarioActual.CveEmpresa) Then
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF"))}'", "Imprimir")
- Dim Liga = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
+ Dim Liga As String = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
End If
Else
@@ -3720,7 +3723,7 @@ Partial Class Ventas
If ObjContratos.DtResultados.FiltraParametros("Estatus = True").Rows.Count > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev")) Then
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
- DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'")
+ DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{NowADS().ToShortDateString}' AND FechaInicial <= '{NowADS().ToShortDateString}'")
Else
DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True ")
End If
@@ -3795,13 +3798,11 @@ Partial Class Ventas
End If
-
If UsuarioActual.CveEmpresa = 13 Then
DivEstimaciones.Visible = True
GvEst.Visible = False
ContratoDetalles.Visible = False
GvContratoDetalles.Visible = True
-
BtnEstimacion.Visible = False
End If
@@ -3820,7 +3821,7 @@ Partial Class Ventas
End Sub
Private Sub CargaContratos()
- Dim DrContrato = DtContratos.FiltroPrimero($"CveContrato = {DdlContratosModal.SelectedValue}")
+ Dim DrContrato As DataRow = DtContratos.FiltroPrimero($"CveContrato = {DdlContratosModal.SelectedValue}")
If DrContrato Is Nothing Then
Alert("Ocurrió un error al cargar la configuración del contrato. Por favor vuelva a intentar", TipoMensaje.MsgError)
Exit Sub
@@ -3834,11 +3835,6 @@ Partial Class Ventas
EscontratoObra = False
End If
-
-
-
-
-
LbContratoImporteTotal.Text = DrContrato("ImporteTotal").ToString().FormatoNumero
LbContratoImporteMinimo.Text = DrContrato("ImporteMin").ToString().FormatoNumero
LbContratoImporteMaximo.Text = DrContrato("ImporteMax").ToString().FormatoNumero
@@ -3938,14 +3934,14 @@ Partial Class Ventas
For Each gvr As GridViewRow In GvContratoDetalles.Rows
gvr.FCTextBox("TxtCant").Enabled = False
Next
- Dim EsValido = True
+ Dim EsValido As Boolean = True
For Each Dr As DataRow In TmpDT.Rows
- Dim CantidadActual = Dr("Cantidad").ToString().ToDouble
- Dim CantidadDispo = 0.0
- Dim CantidadAsignada = 0.0
+ Dim CantidadActual As Decimal = Dr("Cantidad").ToString().ToDecimal
+ Dim CantidadDispo As Decimal = 0
+ Dim CantidadAsignada As Decimal = 0
For Each gvr As GridViewRow In GvContratoDetalles.Rows
If gvr.DataKey("CvePS").ToEntero() = Dr("CvePS").ToString().ToEntero() Then
- CantidadDispo = gvr.DataKey("Cantidad").ToString().ToDouble - gvr.FCTextBox("TxtCant").Text.ToDouble
+ CantidadDispo = gvr.DataKey("Cantidad").ToString().ToDecimal - gvr.FCTextBox("TxtCant").Text.ToDecimal
If CantidadDispo = 0 Then Continue For
CantidadAsignada = If(CantidadDispo > CantidadActual, CantidadActual, CantidadDispo)
gvr.FCTextBox("TxtCant").Text = (gvr.FCTextBox("TxtCant").Text.ToDouble + CantidadAsignada).ToString()
@@ -4066,7 +4062,7 @@ Partial Class Ventas
AplicaGastoContrato = If(DrContrato("CveContratoTipo").ToString().Contiene("9", "10", "13"), True, False) 'Arrendamiento, Servicios De Impresion, Financiamiento
'VALIDA IMPORTE DEL CONTRATO
- Dim SeleccionadoContrato = 0.0 '(From row As GridViewRow In GvContratoDetalles.Rows.Cast(Of GridViewRow)() Select row.FCLabel("LtlTotal").Text.ToDecimal).Sum
+ Dim SeleccionadoContrato As Decimal = 0 '(From row As GridViewRow In GvContratoDetalles.Rows.Cast(Of GridViewRow)() Select row.FCLabel("LtlTotal").Text.ToDecimal).Sum
TmpDT.Clear()
TxtSubTotal.Text = "0"
@@ -4080,7 +4076,7 @@ Partial Class Ventas
'VALIDA EXISTENCIAS DE ALMACÉN
'Dim DrPS = GlobalDTProductosServicios(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero()).FiltroPrimero("")
- Dim DrPS = GlobalDTPSSimplificado(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero()).FiltroPrimero("")
+ Dim DrPS As DataRow = GlobalDTPSSimplificado(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero()).FiltroPrimero("")
If DrPS IsNot Nothing Then
Dim CveTipoPS As Integer = DrPS("CveTipoPS").ToString().ToEntero()
@@ -4097,7 +4093,7 @@ Partial Class Ventas
Dim ObsPlantilla As String = PlantillaContrato(Row.DataKey("Observaciones"))
- SeleccionadoContrato += Row.FCTextBox("TxtCant").Text.ToEntero() * Row.FCLiteral("LtlPU").Text.ToDouble
+ SeleccionadoContrato += Row.FCTextBox("TxtCant").Text.ToEntero() * Row.FCLiteral("LtlPU").Text.ToDecimal
AgregarProductoServicio(Row.FCTextBox("TxtCant").Text.ToEntero(), Row.DataKey("CveUM").ToEntero(), Row.FCLiteral("LtlUM").Text, Row.DataKey("CveClasificacion").ToEntero(),
Row.DataKey("Clasificacion"), Row.DataKey("CvePS").ToEntero(), Row.FCLiteral("LtlPS").Text, If(CveCicloComercial > 0, ObsPlantilla, $"/ {Row.FCLiteral("LtCveInterna").Text}"), Row.FCLiteral("LtlPU").Text.ToDecimal, 0,
DrContrato("CveProyecto").ToString().ToEntero(), DrContrato("ProyectoContrato").ToString(), DrContrato("CveSubProyecto").ToString().ToEntero(), DrContrato("SubProyectoContrato").ToString(), CveContratoDetalle:=Row.DataKey("CveContratoDetalle").ToEntero())
@@ -4202,7 +4198,7 @@ Partial Class Ventas
If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa, -1, -1, 1) Then
If ObjContratos.DtResultados.Rows.Count > 0 Then
- Dim CveContratoTipo = ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero
+ Dim CveContratoTipo As Integer = ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero
'Cargamos los datos del Cliente
DtContratos = ObjContratos.DtResultados
@@ -4267,7 +4263,7 @@ Partial Class Ventas
RequiereAlmacenOrigen = True
If CveContratoTipo.Contiene(7, 9, 13, 21, 27) Then
- Dim CveTipoAlmacenOrigen = "12,15"
+ Dim CveTipoAlmacenOrigen As String = "12,15"
If CveContratoTipo.Contiene(27) Then
CveTipoAlmacenOrigen = "1"
End If
@@ -4341,7 +4337,7 @@ Partial Class Ventas
Private Sub GvContratoDetalles_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratoDetalles.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- Dim CantidadDisponible = If(e.Row.DBCampo("Cantidad").ToDouble < 0, "0", e.Row.DBCampo("Cantidad"))
+ Dim CantidadDisponible As String = If(e.Row.DBCampo("Cantidad").ToDouble < 0, "0", e.Row.DBCampo("Cantidad"))
e.Row.FCLiteral("LtlCantDisp").Text = CantidadDisponible
If CveCicloComercial > 0 Then 'Si es un Ciclo Comercial quitamos el límite de CantidadDisponible
@@ -4394,7 +4390,7 @@ Partial Class Ventas
Exit Sub
End If
- Dim DrContrato = DtContratos.FiltroPrimero($"CveContrato = {DdlContratosModal.SelectedValue}")
+ Dim DrContrato As DataRow = DtContratos.FiltroPrimero($"CveContrato = {DdlContratosModal.SelectedValue}")
If DrContrato Is Nothing Then
Alert("Ocurrió un error al cargar la configuración del contrato. Por favor vuelva a intentar", TipoMensaje.MsgError)
Exit Sub
@@ -4624,7 +4620,7 @@ Partial Class Ventas
For Each Dr As DataRow In TmpDTNCVinculadas.Rows
If Dr("CveConceptoContable").ToString().ToEntero() = 91 Then
- CargaNCDT(Dr("CveVenta").ToString().ToEntero(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal)
+ CargaNCDT(Dr("CveVenta").ToString().ToEntero(), DbRowVenta("TipoDocto").ToString(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal)
End If
Next
@@ -4771,7 +4767,7 @@ Partial Class Ventas
'If UsuarioActual.CveEmpresa = 119 And Not UsuarioActual.CveUsuario.Contiene(100, 1703) Then '[IPP] AD y Jesus de JAM
' 'si es del mes anterior no permita cancelar
' If Not DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
- ' If DbRowVenta("Fecha").ToString().ToDate <= Now.AddMonths(-1).LastDayOfMonth Then
+ ' If DbRowVenta("Fecha").ToString().ToDate <= NowADS().AddMonths(-1).LastDayOfMonth Then
' LbCancelarDocumento.Visible = False
' End If
' End If
@@ -4822,7 +4818,7 @@ Partial Class Ventas
End If
End If
- If UsuarioActual.CveEmpresa = 13 Then
+ If UsuarioActual.Empresa.Funcionalidad(163) = "1" Then
TrDescripcionVenta.Visible = True
TxtDescripcionVenta.Text = DbRowVenta("DescripcionVenta").ToString()
End If
@@ -5031,7 +5027,7 @@ Partial Class Ventas
If Not HplSaldoAuxiliar.Text.ToDouble > 0 Then
HplSaldoAuxiliar.Visible = False
HplPagado.Visible = True
- Dim EsCancelado = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero() = 5
+ Dim EsCancelado As Boolean = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero() = 5
If EsCancelado Then
HplPagado.Text = "CANCELADO"
End If
@@ -5184,7 +5180,7 @@ Partial Class Ventas
DdlTipoRetencion.Visible = True
End If
If TmpDT IsNot Nothing Then
- Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
+ Dim PorcentajeRetIVA As Decimal = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
LblRetIVA.Text = PorcentajeRetIVA.FormatoNumero(2)
End If
@@ -5375,7 +5371,7 @@ Partial Class Ventas
'End If
ElseIf UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso DbRowVenta("SeTimbro").ToString() = "No" AndAlso DbRowVenta("CveEstatusFactura").ToString() = "2" AndAlso DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Egs", "Dev", "Ant") Then
TrEmitir.Visible = True
- If TxtFecha.Text.ToDate < Now.AddDays(-3) Then
+ If TxtFecha.Text.ToDate < NowADS().AddDays(-3) Then
TxtFecha.Enabled = True
End If
End If
@@ -5575,10 +5571,11 @@ Partial Class Ventas
BtnsFacturar.Visible = True
'E119, bloquear la facturación de remisiones que no estén surtidas
- If UsuarioActual.CveEmpresa = 119 AndAlso DbRowVenta("SaldoAlmacen").ToString.ToDecimal = 0 Then
- BtnsFacturar.Visible = False
+ If UsuarioActual.CveEmpresa = 119 Then
+ If TmpDT.SUM("Cantidad") <> TmpDT.SUM("CantidadInventario") Then 'que ya esté surtida totalmente
+ BtnsFacturar.Visible = False
+ End If
End If
-
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
'ACTIVA CONVERSION DE MONEDA
@@ -5607,11 +5604,11 @@ Partial Class Ventas
DtUsadosPendientes = ObjUsados.DtResultados.Copy()
End If
- If ObjUsados.GetVentasGarantiaPendiente(CveVenta, Now, UsuarioActual.CveEmpresa) Then
+ If ObjUsados.GetVentasGarantiaPendiente(CveVenta, NowADS(), UsuarioActual.CveEmpresa) Then
DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
End If
- 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then
+ 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, NowADS(), UsuarioActual.CveEmpresa) Then
' DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
'End If
@@ -6011,7 +6008,7 @@ Partial Class Ventas
End If
'ObjVenta.Dispose()
Else
- TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
+ TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranzaRemision), NowADS().AddDays(PlazoCobranza)).ToShortDateString
End If
CreaObjetosVentaDevolucion()
@@ -6059,7 +6056,7 @@ Partial Class Ventas
If UsuarioActual.CveRol = 1 AndAlso CveMetodoPago = 1 AndAlso DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso TbDescuentosAdicionales.Visible Then
If TmpDT.SUMD("Descuento") > 0 Then
Dim TotalDescuento As Decimal = TmpDT.SUMD("Total", "Descuento > 0") * 0.05D
- Dim RowDescuentos = TmpDT.Select("Descuento > 0")
+ Dim RowDescuentos As DataRow() = TmpDT.Select("Descuento > 0")
If RowDescuentos IsNot Nothing Then
LblDescuentoAdicional.Text = TotalDescuento.FormatoNumero(2)
@@ -6537,6 +6534,7 @@ Partial Class Ventas
Else
TxtComExtEstado.Visible = True : DdlComExtEstado.Visible = False
End If
+ TxtComExtEstado.Text = ObjCliente.ComExtEstado
TxtComExtMunicipio.Text = ObjCliente.ComExtMunicipio
TxtComExtColonia.Text = ObjCliente.ComExtColonia
TxtComExtMunicipio.Visible = True : TxtComExtColonia.Visible = True
@@ -6729,7 +6727,7 @@ Partial Class Ventas
TrVistaPrevia.Visible = True
- TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
+ TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranzaRemision), NowADS().AddDays(PlazoCobranza)).ToShortDateString
' si es empresa acumuladores
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
@@ -6778,7 +6776,7 @@ Partial Class Ventas
If RequiereOC Then
Dim Documentacion As String = ""
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
- Dim Count = 0
+ Dim Count As Integer = 0
For Each GvRow As GridViewRow In GvDocumentosCliente.Rows
If GvRow.DataKey("Orden").ToEntero() = 1 Then
IndexDocumentoCliente = Count
@@ -7090,7 +7088,7 @@ Partial Class Ventas
TieneBloqueoPorAutorizacion = 1
End If
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
If Not UsuarioActual.TienePermisoProceso(325) Then
@@ -7155,7 +7153,7 @@ Partial Class Ventas
End If
End If
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
'si llegó por la opción de cotización no debe de restringuir
If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then DdlTipoComprobante.SelectedValue = "Cot"
@@ -7221,7 +7219,7 @@ Partial Class Ventas
If EsCotizacion Then
DdlTipoComprobante.SelectedValueExistInsert("Cot", "Cotización")
End If
- TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
+ TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranzaRemision), NowADS().AddDays(PlazoCobranza)).ToShortDateString
If EsCotizacion AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Autorizacion As Integer = 0
@@ -7281,7 +7279,7 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValue = "PA"
TieneBloqueoPorAutorizacion = 1
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
'si llegó por la opción de cotización no debe de restringuir
If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then DdlTipoComprobante.SelectedValue = "Cot"
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing"))
@@ -7832,7 +7830,11 @@ Partial Class Ventas
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
'MODO EDICION
- e.Row.FCDropDownList("DdlUnidadMedida").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToEntero(), -1, UsuarioActual.CveEmpresa)
+ If UsuarioActual.Empresa.UsaInventarios Then
+ e.Row.FCDropDownList("DdlUnidadMedida").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DBCampo("CvePS").ToEntero(), -1, UsuarioActual.CveEmpresa)
+ Else
+ e.Row.FCDropDownList("DdlUnidadMedida").DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
+ End If
e.Row.FCDropDownList("DdlUnidadMedida").DataBind()
e.Row.FCDropDownList("DdlUnidadMedida").SelectedValueExist(e.Row.DBCampo("CveUM"))
@@ -8357,7 +8359,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
Dim ConsecEliminar As Integer = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
If ConsecEliminar > 0 Then
- Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
+ Dim descEliminar As Modelos.VentaDescuentos = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
If descEliminar IsNot Nothing Then
ListaDescuentos.Remove(descEliminar)
End If
@@ -8515,9 +8517,9 @@ Partial Class Ventas
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing Then
- Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
+ Dim ConsecEliminar As Integer = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
If ConsecEliminar > 0 Then
- Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
+ Dim descEliminar As Modelos.VentaDescuentos = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
If descEliminar IsNot Nothing Then
ListaDescuentos.Remove(descEliminar)
End If
@@ -8821,13 +8823,12 @@ Partial Class Ventas
'End If
Dim EsPersonaMoral As Boolean = Me.TipoPersona
- Dim DtUsosCFDI = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
+ Dim DtUsosCFDI As DataTable = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
If DtUsosCFDI.Rows.Count = 0 Then
Alert("El Uso CFDI no corresponde con el tipo de persona (fisca, moral) y el régimen fiscal.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
-
End If
If Not ValidaImportePublicoGeneral() Then
@@ -8907,9 +8908,9 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValue = "Ing"
EraCotizacion = 1
- TxtFecha.Text = Now.ToString()
- TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranza), Now.AddDays(PlazoCobranza)).ToShortDateString
- TxtFechaEjecucion.Text = Now.ToString()
+ TxtFecha.Text = NowADS().ToString()
+ TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranza), NowADS().AddDays(PlazoCobranza)).ToShortDateString
+ TxtFechaEjecucion.Text = NowADS().ToString()
'debo de regenerar los folios, para facturar
CargaFolios()
@@ -9478,7 +9479,7 @@ Partial Class Ventas
CreaObjetosVenta(TipoDoctoViejo:=TipoDoctoViejo)
- If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
+ If ObjFactura Is Nothing OrElse (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
ObjFactura = Nothing
Exit Sub
@@ -9561,22 +9562,6 @@ Partial Class Ventas
End If
End If
-
- 'VERIFICA QUE LA MONEDA DE LA LINEA ADICIONAL SEA LA MISMA QUE LA VENTA
- 'If Me.CveMonedaLineaAdicional <> ObjFactura.CveMoneda Then
- ' TmpDT = TmpDTError.Copy()
- ' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
- ' Alert("La moneda de la linea adicional de crédito debe ser la misma que la factura.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- 'Else
- ' If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
- ' TmpDT = TmpDTError.Copy()
- ' CalculaTotalesVenta(RecalcularTotalOriginal:=False)
- ' Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
- 'End If
-
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
'If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then
' TmpDT = TmpDTError.Copy()
@@ -9594,16 +9579,6 @@ Partial Class Ventas
End If
- 'If Not CveEmpresaCRM > 0 Then
- ' If ObjFactura.Cliente.AplicaComercioExterior Then
- ' If Not ValidaComercioExterior() Then
- ' ObjFactura = Nothing
- ' Exit Sub
- ' End If
- ' End If
- 'End If
-
-
'VALIDA TOTAL DE LA NOTA DE CREDITO Y LA FACTURA VINCULADA *** ESTABA TRONANDO EN COMPU 11/01/17 ***
'If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
' If SubTotalFacturaVinNC() > 0 Then 'pendiente
@@ -9656,24 +9631,6 @@ Partial Class Ventas
ErrorList = New List(Of String)
MensajeAlert = New StringBuilder
- 'VERIFICA QUE EL FOLIO NO SEA IGUAL AL DE LA FACTURA ANTERIOR
- 'If ObjFactura.Folio = TxtFolio.Text.ToEntero() Then
- ' If ObjFolios.GetFolios(ObjFactura.TipoDocto, UsuarioActual.CveEmpresa) Then
- ' Dim DtFolios As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSucursal = {0} And Estado = 'Activo'", ObjFactura.CveSucursal))
- ' If DtFolios.Rows.Count > 0 Then
- ' 'ViewState("CveFolio") = DtFolios.Rows(0)("CveFolio").ToString().ToEntero()
- ' 'ViewState("NumAprobacion") = CLng(DtFolios.Rows(0)("Aprobacion").ToString())
- ' 'ViewState("FechaAprobacion") = DtFolios.Rows(0)("FechaAprobacion").ToString().ToDate
- ' 'ViewState("FolioActual") = DtFolios.Rows(0)("FActual").ToString()
- ' 'LblSerie.Text = DtFolios.Rows(0)("Serie").ToString()
-
- ' If UsuarioActual.CveEmpresa <> 72 Then
- ' ObjFactura.Folio = DtFolios.Rows(0)("FActual").ToString().ToEntero()
- ' End If
- ' End If
- ' End If
- 'End If
-
'GUARDA VENTA
Dim TieneAnticipo As Boolean = False
@@ -10025,7 +9982,6 @@ Partial Class Ventas
'ContPAQ El movimiento 1 es el de Venta
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
-
AutoConta = AutocontaMatriz(AutoConta)
If DdlTipoComprobante.SelectedValue.Contiene("Rem", "RNC", "Cot", "Ped", "Pd2", "PA") Then
@@ -10054,6 +10010,9 @@ Partial Class Ventas
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot", "DPe", "PeC", "PA", "Pd2")) Then
ObjVentas.Commit()
+ ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos.
+ ObjFactura.Timbre = PreParaTimbre(ObjFactura)
+
'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
@@ -10061,22 +10020,22 @@ Partial Class Ventas
End If
End If
- Try
- 'RMF, cuando es pedido, se manda autorización.
- If ObjFactura.TipoDocto.Contiene("PA") Then
+ 'Try
+ ' 'RMF, cuando es pedido, se manda autorización.
+ ' If ObjFactura.TipoDocto.Contiene("PA") Then
- Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
- Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
- If UsuarioActual.CveEmpresa = 119 Then
- ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
- ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
- ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
- End If
+ ' Dim Titulo As String = "Solicitud de autorización" 'usuarios de crédito y cobranza
+ ' Dim Msg As String = String.Format("{0} - Folio {1} ", DdlSubProyectoDatos.SelectedItem.Text, TxtFolio.Text)
+ ' 'If UsuarioActual.CveEmpresa = 119 Then
+ ' ' ClsSisNotificaciones.SendNotificacionERP(1715, Titulo, Msg, 1)
+ ' ' ClsSisNotificaciones.SendNotificacionERP(1815, Titulo, Msg, 1)
+ ' ' ClsSisNotificaciones.SendNotificacionERP(1830, Titulo, Msg, 1)
+ ' 'End If
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al mandar las notificaciones de autorización", ex)
- End Try
+ ' End If
+ 'Catch ex As Exception
+ ' OnError("Ocurrió un error al mandar las notificaciones de autorización", ex)
+ 'End Try
Try
ViewState("CveVenta") = ObjFactura.CveVenta
@@ -10583,7 +10542,7 @@ Partial Class Ventas
'ObjFacturaDevolucion.RefDocto = TxtDocto.Text.Trim
'ObjFacturaDevolucion.Folio = If(ExFolioFactura, FolioXML.ToEntero(), -1)
ObjFacturaDevolucion.Serie = LblSerie.Text
- ObjFacturaDevolucion.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
+ ObjFacturaDevolucion.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, NowADS().Hour, NowADS().Minute, NowADS().Second)
ObjFacturaDevolucion.CvePrePoliza = -1
ObjFacturaDevolucion.CveMetodoPago = 0 'DdlMetodoPago.SelectedValue.ToEntero()
ObjFacturaDevolucion.MetodoPago = ""
@@ -10613,7 +10572,7 @@ Partial Class Ventas
End If
- ObjFacturaDevolucion.Fecha = Now
+ ObjFacturaDevolucion.Fecha = NowADS()
ObjFacturaDevolucion.Version = "4.0"
If ObjFacturaDevolucion.Cliente Is Nothing Then ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel
ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal
@@ -10856,7 +10815,7 @@ Partial Class Ventas
'ObjFacturaDevolucion.RefDocto = TxtDocto.Text.Trim
'ObjFacturaDevolucion.Folio = If(ExFolioFactura, FolioXML.ToEntero(), -1)
ObjFacturaBonificacion.Serie = LblSerie.Text
- ObjFacturaBonificacion.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
+ ObjFacturaBonificacion.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, NowADS().Hour, NowADS().Minute, NowADS().Second)
ObjFacturaBonificacion.CvePrePoliza = -1
ObjFacturaBonificacion.CveMetodoPago = 0 'DdlMetodoPago.SelectedValue.ToEntero()
ObjFacturaBonificacion.MetodoPago = ""
@@ -10885,7 +10844,7 @@ Partial Class Ventas
ObjFolios.Dispose()
End If
- ObjFacturaBonificacion.Fecha = Now
+ ObjFacturaBonificacion.Fecha = NowADS()
ObjFacturaBonificacion.Version = "4.0"
@@ -11311,9 +11270,7 @@ Partial Class Ventas
End If
ObjFactura.Version = "4.0"
- If ObjFactura.Cliente Is Nothing Then
- ObjFactura.Cliente = New Modelos.ClienteModel
- End If
+ If ObjFactura.Cliente Is Nothing Then ObjFactura.Cliente = New Modelos.ClienteModel
ObjFactura.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal
ObjFactura.Cliente.RegimenFiscal = ClienteRegimenFiscal
@@ -11330,7 +11287,6 @@ Partial Class Ventas
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString().ToEntero() > 0, "Ing", DdlTipoComprobante.SelectedValue)
ObjFactura.FacturarSucursal = (Me.FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso Not String.IsNullOrEmpty(Me.ClienteSucursal.RFC)))
ObjFactura.VentaDesglosaIEPS = Me.VentaDesglosaIEPS
- 'ObjFactura.RefDocto = TxtDocto.Text.Trim
If EsCreaApartirDe Then
ViewState("EstablecioFolio") = False
@@ -11363,7 +11319,7 @@ Partial Class Ventas
End If
- ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
+ ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, NowADS().Hour, NowADS().Minute, NowADS().Second)
ObjFactura.CvePrePoliza = -1
ObjFactura.CveMetodoPago = 0 'DdlMetodoPago.SelectedValue.ToEntero()
ObjFactura.MetodoPago = "" ' DdlMetodoPago.SelectedItem.Text
@@ -11388,19 +11344,9 @@ Partial Class Ventas
ObjFactura.UsuarioCreo = LblUsuario.Text.Trim
ObjFactura.CveCondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedValue.ToEntero(), -1)
ObjFactura.CondicionEntrega = If(DdlFormaEntrega.SelectedItem IsNot Nothing, DdlFormaEntrega.SelectedItem.Text, "")
- 'ObjFactura.NumeroCuenta = TxtNumCtaPago.Text.Trim
- 'ObjFactura.Cliente.NumCtaPago = TxtNumCtaPago.Text.Trim
ObjFactura.CondicionesPago = If(RBLPago.SelectedValue = "2", 0, If(RBLPago.SelectedValue = "1", 1, 2)) ' 0 - Contado, 1 - Credito, 2 - termianl
ObjFactura.FormaPago = 0 'DdlFormaPago.SelectedValue.ToEntero()
-
- 'ObjFactura.AnticipoPosicion = DdlAmortizacionConceptos.SelectedValue.ToEntero()
- 'ObjFactura.AnticipoEnSubTotal = If(ChkAnticipoEnSubTotal.Checked, True, False)
- 'ObjFactura.CveTipoRelacion = DdlTipoRelacion.SelectedValue.ToEntero()
-
-
- 'ObjFactura.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text)
- 'ObjFactura.PedidoContrato = TxtPedidoContrato.Text.Trim
ObjFactura.AtencionA = TxtAtencionA.Text
ObjFactura.FordGSDB = ""
@@ -11442,7 +11388,7 @@ Partial Class Ventas
If divcondicionespago.Visible Then
ObjFactura.FechaPago = TxtFechaPago.Text.ToDate
Else
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = NowADS()
End If
ObjFactura.DiasCredito = DiasCredito
@@ -11886,30 +11832,7 @@ Partial Class Ventas
'End If
ObjFactura.AplicaDevolucion = Me.AplicaDevolucion
-
ObjFactura.CveTipoAmortizacionAnticipo = DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero()
- ObjFactura.Timbre.Comprobante.TipoComprobante = If(ObjFactura.TipoDocto.Contiene("Ing", "Ant"), "I", If(ObjFactura.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
-
- If ObjFactura.Timbre.Comprobante.TipoComprobante = "E" Then
- If ObjFactura.TipoDocto = "Egs" Then
- ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "01"
- ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
-
- End If
- If ObjFactura.TipoDocto = "Dev" Then
- ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "03"
- ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
- End If
- ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero()
- If HdnFolioFiscalNC.Value <> "0" And HdnFolioFiscalNC.Value <> "" Then ObjFactura.Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
- End If
- ' cuando es refacturacoin es cfdirelacionado, con relacion 04
- If ObjFactura.Timbre.Comprobante.TipoComprobante = "I" AndAlso NuevaFactura = 1 Then
- ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "04"
- ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Refacturación de Ingreso"
- ObjFactura.Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
- End If
-
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso NuevaFactura = 1 Then ' refacturación
ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero()
@@ -11932,7 +11855,7 @@ Partial Class Ventas
End If
End If
- If CveCliente > 0 Then ObjFactura.Timbre = PreParaTimbre(ObjFactura)
+ ' If CveCliente > 0 Then ObjFactura.Timbre = PreParaTimbre(ObjFactura)
'SI SE ESTA EDITANDO ACTUALIZA LOS IMPORTES DEL DT
If GvImpuestosLocales2.Visible AndAlso GvImpuestosLocales2.Enabled Then
@@ -11949,33 +11872,6 @@ Partial Class Ventas
Next
End If
-
- 'RMF. faltan impuestos locales
- If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.FiltraParametros("TipoImpuesto IN (1,3) ").Rows.Count > 0 Then
-
- For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto IN (1,3) ").Rows
- If DrImpuestosLocales("Importe").ToString().ToDecimal > 0 Then
- Dim ret As New CFDIRetencionesLocales With
- {
- .TasaRetencion = DrImpuestosLocales("Porcentaje").ToString().ToDecimal,
- .ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString(),
- .Importe = DrImpuestosLocales("Importe").ToString().ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1)).RoundSQL(2)
- }
- ObjFactura.Timbre.RetencionesLocales.Add(ret)
- End If
- Next
- End If
-
- If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.FiltraParametros("TipoImpuesto = 5").Rows.Count > 0 Then
-
- For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto = 5").Rows
- If DrImpuestosLocales("Importe").ToString().ToDecimal > 0 Then
- Dim ret As New CFDITrasladosLocales With {.TasaTraslado = DrImpuestosLocales("Porcentaje").ToString().ToDecimal, .ImpuestoLocalTraslado = DrImpuestosLocales("ImpuestoLocal").ToString(), .Importe = DrImpuestosLocales("Importe").ToString().ToDecimal(If(ObjFactura.ConvertirPesos, ObjFactura.TipoCambio, 1))}
- ObjFactura.Timbre.TrasladosLocales.Add(ret)
- End If
- Next
- End If
-
'INE COMPLEMENTO
If RblComplementos.SelectedValue.ToEntero() > 0 Then
ObjFactura.CveComplementoTimbrado = RblComplementos.SelectedValue.ToEntero()
@@ -12044,7 +11940,7 @@ Partial Class Ventas
'ObjFacturaDevolucion.Folio = If(ExFolioFactura, FolioXML.ToEntero(), -1)
ObjFacturaDevolucion.Serie = LblSerie.Text
- ObjFacturaDevolucion.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
+ ObjFacturaDevolucion.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, NowADS().Hour, NowADS().Minute, NowADS().Second)
ObjFacturaDevolucion.CvePrePoliza = -1
ObjFacturaDevolucion.CveMetodoPago = 0 'DdlMetodoPago.SelectedValue.ToEntero()
ObjFacturaDevolucion.MetodoPago = "" 'DdlMetodoPago.SelectedItem.Text
@@ -12074,7 +11970,7 @@ Partial Class Ventas
End If
- ObjFacturaDevolucion.Fecha = Now
+ ObjFacturaDevolucion.Fecha = NowADS()
'VALORES DEFAULT DE NC-DEV
@@ -12340,10 +12236,7 @@ Partial Class Ventas
Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
Dim Timbre As New CFDITimbre
-
-
Timbre.Comprobante.Version = "4.0"
-
Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
Timbre.Comprobante.Folio = Obj.Folio.ToString()
Timbre.Comprobante.Serie = Obj.Serie
@@ -12381,29 +12274,32 @@ Partial Class Ventas
Timbre.Receptor.NumeroRegistroTributario = ""
Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
+ Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
+
+ If Timbre.Comprobante.TipoComprobante = "E" Then
+ If Obj.TipoDocto = "Egs" Then
+ Timbre.CFDIRelacionados.TipoRelacion = "01"
+ Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
+
+ End If
+ If Obj.TipoDocto = "Dev" Then
+ Timbre.CFDIRelacionados.TipoRelacion = "03"
+ Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
+ End If
+ Obj.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero()
+ If HdnFolioFiscalNC.Value <> "0" And HdnFolioFiscalNC.Value <> "" Then Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
+ End If
+ ' cuando es refacturacoin es cfdirelacionado, con relacion 04
+ If Timbre.Comprobante.TipoComprobante = "I" AndAlso NuevaFactura = 1 Then
+ Timbre.CFDIRelacionados.TipoRelacion = "04"
+ Timbre.CFDIRelacionados.TipoRelacionTexto = "Refacturación de Ingreso"
+ Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
+ End If
+
If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then
Timbre.CFDIRelacionados.TipoRelacion = "07"
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
-
- 'If Timbre.Comprobante.TipoComprobante = "E" Then
- ' If Obj.TipoDocumento.Contiene("Nota de Crédito") Then
- ' Timbre.CFDIRelacionados.TipoRelacion = "01"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
- ' End If
- ' If Obj.TipoDocumento.Contiene("Nota de Devolución") Then
- ' Timbre.CFDIRelacionados.TipoRelacion = "03"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
- ' End If
- ' Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
- 'End If
- '' cuando es refacturacoin es cfdirelacionado, con relacion 04
- 'If Timbre.Comprobante.TipoComprobante = "I" AndAlso NuevaFactura = 1 Then
- ' Timbre.CFDIRelacionados.TipoRelacion = "04"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "Refacturación de Ingreso"
- ' Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
- 'End If
-
Else
'SI LA FACTURA VIENE DE SER CANCELADA SISTEMA CUANDO SE REFACTURO NO HAY QUE RELACIONAR
If (CveEstatusFacturaPadre > 0 AndAlso CveEstatusFacturaPadre <> 4) OrElse (DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0) OrElse HdnFolioFiscalNC.Value.ToString() <> "" Then
@@ -12448,10 +12344,8 @@ Partial Class Ventas
End If
End If
End If
-
End If
End If
-
End If
'SI LAS FACTURAS SE RELACIONARAN MANUALMENTE SE AGREGAN
@@ -12471,7 +12365,6 @@ Partial Class Ventas
Timbre.CFDIRelacionados.UUID.Add(GvRow.DataKey("FolioFiscal").Replace("test", ""))
End If
Next
-
End If
Dim totSubTotal As Decimal = Obj.SubTotal
@@ -12552,6 +12445,32 @@ Partial Class Ventas
i += 1
Next
+ 'RMF. faltan impuestos locales
+ If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.FiltraParametros("TipoImpuesto IN (1,3) ").Rows.Count > 0 Then
+
+ For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto IN (1,3) ").Rows
+ If DrImpuestosLocales("Importe").ToString().ToDecimal > 0 Then
+ Dim ret As New CFDIRetencionesLocales With
+ {
+ .TasaRetencion = DrImpuestosLocales("Porcentaje").ToString().ToDecimal,
+ .ImpuestoLocalRetenido = DrImpuestosLocales("ImpuestoLocal").ToString(),
+ .Importe = DrImpuestosLocales("Importe").ToString().ToDecimal(If(Obj.ConvertirPesos, Obj.TipoCambio, 1)).RoundSQL(2)
+ }
+ Timbre.RetencionesLocales.Add(ret)
+ End If
+ Next
+ End If
+
+ If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.FiltraParametros("TipoImpuesto = 5").Rows.Count > 0 Then
+
+ For Each DrImpuestosLocales As DataRow In TmpDTImpuestos.FiltraParametros("TipoImpuesto = 5").Rows
+ If DrImpuestosLocales("Importe").ToString().ToDecimal > 0 Then
+ Dim ret As New CFDITrasladosLocales With {.TasaTraslado = DrImpuestosLocales("Porcentaje").ToString().ToDecimal, .ImpuestoLocalTraslado = DrImpuestosLocales("ImpuestoLocal").ToString(), .Importe = DrImpuestosLocales("Importe").ToString().ToDecimal(If(Obj.ConvertirPesos, Obj.TipoCambio, 1))}
+ Timbre.TrasladosLocales.Add(ret)
+ End If
+ Next
+ End If
+
Dim AplicaComercioExteriorSubProyecto As Boolean = True
If ChkEmitirComercioExterior.Checked Then
@@ -12973,7 +12892,7 @@ Partial Class Ventas
If Not TieneContrato Then
If ObjContratos.GetContratos(-1, UsuarioActual.CveEmpresa, CveCliente, -1, 1) Then
If ObjContratos.DtResultados.FiltraParametros("Estatus = True").Rows.Count > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ped") Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev")) Then
- DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{Now.ToShortDateString}' AND FechaInicial <= '{Now.ToShortDateString}'")
+ DtContratos = ObjContratos.DtResultados.FiltraParametros($"Estatus = True AND FechaFinal >= '{NowADS().ToShortDateString}' AND FechaInicial <= '{NowADS().ToShortDateString}'")
DdlContratosOC.DataSource = DtContratos
DdlContratosOC.DataBind()
@@ -13109,9 +13028,7 @@ Partial Class Ventas
End If
Dim DescripcionVenta As String = ""
- If factura.TipoDocto = "Ing" AndAlso UsuarioActual.CveEmpresa = 13 Then
- DescripcionVenta = TxtDescripcionVenta.Text
- End If
+ If TxtDescripcionVenta.Text <> "" Then DescripcionVenta = TxtDescripcionVenta.Text
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
@@ -13189,8 +13106,6 @@ Partial Class Ventas
End If
End If
Next
- 'LO LIMPIA PARA QUE NO VUELVA A APLICAR
- Me.AplicaRelacionManual = False
End If
'SI SE SELECCIONO UNA FACTURA PARA DEVOLUCION DE EFECTIVO DEBE ASOCIARLA A LA NOTA DE CREDITO
@@ -13238,7 +13153,7 @@ Partial Class Ventas
If DtVentasNC Is Nothing Then
InicializaDTVentasNC()
End If
- CargaNCDT(factura.CveVentaPadre, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas)
+ CargaNCDT(factura.CveVentaPadre, DdlTipoComprobante.SelectedValue, factura.Total, NuevaFactura:=NuevaFactura, ObjVentas:=ObjVentas)
End If
'Se agregan los PS
@@ -13372,7 +13287,7 @@ Partial Class Ventas
Dim Cargo As Decimal = Cantidad * ImporteCargoOriginal
Dim Bonificacion As Decimal = 0
- If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, Bonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
+ If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, Bonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", NowADS()) Then
ErrorList.Add("Ocurrió un error al agregar el movimiento de distribuidor.")
Exit For
End If
@@ -13391,7 +13306,7 @@ Partial Class Ventas
Dim Puntos As Decimal = 0
Dim Cargo As Decimal = 0
- If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, ImporteBonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
+ If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, ImporteBonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", NowADS()) Then
ErrorList.Add("Ocurrió un error al agregar el movimiento de distribuidor.")
Exit For
End If
@@ -13420,7 +13335,7 @@ Partial Class Ventas
' Cargo = 0
' End If
- ' If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, Bonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
+ ' If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, CveTamanio, Puntos, Cargo, Bonificacion, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", NowADS()) Then
' ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
' Exit For
' End If
@@ -15192,7 +15107,7 @@ Partial Class Ventas
End If
If Not OcurrioError Then
- If ContabilizaMovimientoAlmacen(ObjConta, Now, ObjFactura.SerieFolio, "Ventas/Rem", CveMovimientoSalidaPorTraspaso, CveMovimientoEntrada, TotalPrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) <= 0 Then
+ If ContabilizaMovimientoAlmacen(ObjConta, NowADS(), ObjFactura.SerieFolio, "Ventas/Rem", CveMovimientoSalidaPorTraspaso, CveMovimientoEntrada, TotalPrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) <= 0 Then
OcurrioError = True
End If
End If
@@ -15301,195 +15216,7 @@ Partial Class Ventas
Return ErrorPrepoliza
End Function
- 'Private Function generaNC(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ByRef ObjBancos As ClsBancos, ByRef ObjEventos As ClsOIEventos) As List(Of Object)
- ' Dim Obj As New List(Of Object)
- ' Dim CveVentaNueva As Integer = ObjVentas.CveVenta
- ' Dim BanderaGeneraNC As Boolean = True
- ' 'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then BanderaGeneraNC = True
- ' If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
- ' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
- ' Dim drv As DataRow = ObjVentas.DtResultados.Rows(0)
- ' Dim TmpDTconceptos As DataTable = Nothing
- ' Dim CveNCaVincular As Integer = DdlNCFactura.SelectedValue.ToEntero()
- ' 'CargaCliente
- ' Dim CveCliente As Integer = drv("CveCliente").ToString().ToEntero()
- ' If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not CveCliente.Contiene(10450, 10460, 10458) Then
- ' Return Nothing
- ' ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 AndAlso Not CveCliente.Contiene(27448) Then
- ' Return Nothing
- ' End If
- ' factura.TipoDocto = drv("TipoDocto").ToString()
- ' factura.Serie = drv("Serie").ToString()
- ' factura.FechaEjecucion = drv("FechaEjecucion").ToString().ToDateTime
- ' factura.Fecha = drv("Fecha").ToString().ToDateTime
- ' factura.CveSubProyectoEjecucion = drv("CveSubProyectoEjecucion").ToString().ToEntero()
- ' factura.CveSubProyectoCobranza = drv("CveSubProyectoCobranza").ToString().ToEntero()
- ' factura.CveClienteSucursal = drv("CveClienteSucursal").ToString().ToEntero()
- ' factura.CveSubProyecto = drv("CveSubProyecto").ToString().ToEntero()
-
- ' 'Carga Detalle Sucursal
- ' CargaClienteSucursal(drv("CveClienteSucursal").ToString().ToEntero(), ObjVentas)
-
- ' 'CargaDetalle
- ' If ObjVentas.GetVentaDetalle(CveVenta) Then
- ' TmpDTconceptos = ObjVentas.DtResultados
- ' TmpDTconceptos.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
- ' GvPS.DataSource = TmpDTconceptos
- ' GvPS.DataBind()
- ' End If
-
- ' 'Carga Totales
- ' factura.SubTotal = drv("SubTotal").ToString().ToDecimal
- ' factura.Descuento = drv("Descuento").ToString().ToDecimal
- ' factura.Amortizacion = drv("Amortizacion").ToString().ToDecimal
- ' factura.IVA = drv("IVA").ToString().ToDecimal
- ' factura.RetIVA = drv("RetIVA").ToString().ToDecimal
- ' factura.RetISR = drv("RetISR").ToString().ToDecimal
- ' factura.Total = drv("Total").ToString().ToDecimal
- ' factura.MotivoDescuento = drv("MotivoDescuento").ToString()
- ' factura.Observaciones = drv("Observaciones").ToString()
- ' factura.CveMoneda = drv("CveMoneda").ToString().ToEntero()
- ' factura.TipoCambio = drv("TipoCambio").ToString().ToDecimal
- ' factura.CveVendedor = drv("CveVendedor").ToString().ToEntero()
- ' factura.RefDocto = drv("Ref").ToString()
- ' 'factura.SerieFolioPadre = drv("SerieFolio").ToString()
- ' HdnFolioFiscalNC.Value = drv("FolioFiscal").ToString()
-
- ' ViewState("FolioFiscal") = drv("FolioFiscal").ToString()
-
- ' 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
- ' 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
-
- ' UpContado.Update()
- ' If factura.CveCliente > 0 Then
- ' If Not IsNothing(TmpDTconceptos) AndAlso TmpDTconceptos.Rows.Count > 0 Then
-
- ' If Not drv("Total").ToString().ToDecimal = factura.Total Then
- ' Return Nothing
- ' End If
-
- ' If FolioFiscal = "" Then
- ' CveEstatus = 4
- ' Else
- ' CveEstatus = 5
- ' End If
-
- ' '[IPP] - CANCELA INVENTARIO DE VENTA NUEVA Y NO TRASPASA MOVTOS DE ALMACEN
- ' 'If UsuarioActual.CveEmpresa.Contiene(1) Then
- ' 'QUEMA DOCUMENTO NUEVO
- ' If Not ObjInventario.ActualizarEsDevolucionVenta(CveVentaNueva, 2) Then
- ' Return Nothing
- ' End If
- ' 'Else
- ' ' 'TRASPASA ALMACEN A DOCUMENTO NUEVO
- ' ' If Not CancelarMovimientoInventario(ObjInventario, ObjConta, CveVentaNueva, CveDevolucion) Then
- ' ' Return Nothing
- ' ' End If
- ' 'End If
-
- ' 'CANCELA PAGOS
- ' If ObjFacturaDevolucion.TipoDocto.Contiene("Ing", "Ant") Then
- ' If Not ObjConta.PrePolizasCancelarPagos(CveDevolucion, ObjFactura.CvePrePoliza) Then
- ' Return Nothing
- ' End If
- ' End If
-
- ' 'CANCELA FACTURA
-
- ' BanderaGeneraNC = True
- ' '2019.05.10- RMF. se activa la bandera a true, para que siempre se cancele, y no genere la NC
-
- ' If Month(factura.Fecha) = Month(Now) OrElse BanderaGeneraNC = True Then
- ' If CancelarFactura(ObjVentas, ObjConta, ObjContPaq, ObjBancos) Then
- ' Obj.Add(factura)
- ' Else
- ' Return Nothing
- ' End If
- ' Else
- ' ObjFacturaDevolucion.TipoDocto = "Egs"
- ' ObjFacturaDevolucion.Fecha = Now
- ' If RegistrarNC(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, TmpDTconceptos, ObjEventos) Then
- ' Obj.Add(ObjFacturaDevolucion)
- ' Else
- ' Return Nothing
- ' End If
- ' End If
-
- ' 'TRASPASA PAGADO
- ' If Not ObjConta.TraspasarSaldosPrePolizas(CveDevolucion, ObjFactura.CveVenta, ObjFactura.CvePrePoliza) Then
- ' Return Nothing
- ' End If
-
- ' If Not ObjInventario.TraspasaEntregaDirectaOCInv(ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then
- ' Return Nothing
- ' End If
-
- ' End If
- ' End If
- ' End If
- ' End If
-
- ' If Obj.Count > 0 Then
- ' Return Obj
- ' Else
- ' Return Nothing
- ' End If
-
- 'End Function
- 'Private Function RegistrarNC(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
- ' Dim ProcesoCorrecto As Boolean = True
- ' RefacturacionGeneroNC = True
-
- ' ''Generamos el nuevo folio
- ' 'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
- ' 'If ObjFolios.GetFolios(factura.TipoDocto, UsuarioActual.CveEmpresa) Then
- ' ' Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
- ' ' If DT.Rows.Count > 0 Then
- ' ' factura.Folio = DT.Rows(0)("FActual").ToString().ToEntero()
- ' ' Else
- ' ' ProcesoCorrecto = False
- ' ' End If
- ' ' DT.Dispose()
- ' 'End If
- ' factura.Folio = -1
-
- ' 'Registramos la venta
- ' GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, factura, TmpDTconceptos, -1, ObjContPaq, ObjBancos)
- ' 'CargaNCDT(factura.CveVentaPadre, factura.Total)
-
- ' 'ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
- ' ''Timbramos
- ' 'If factura.TipoDocto.Contiene("Ing", "Egs", "Ant") AndAlso FolioFiscal <> "" Then
- ' ' If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
-
- ' ' Dim sw As New Diagnostics.Stopwatch
- ' ' sw.Start()
-
- ' ' 'FACTURA INGRESO/EGRESO
- ' ' Dim ObjTimbrado As New Modelos.Timbrado
- ' ' Dim FM As New Modelos.FemsaFactura
- ' ' Dim TmpDT7Eleven As New DataTable
- ' ' Dim TmpDTComplementosTimbrado As New DataTable
-
- ' ' PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
-
- ' ' ObjTimbrado.TimbrarFactura(UsuarioActual, factura, FM, TmpDT, TmpDTImpuestos, TmpDT7Eleven, TmpDTComplementosTimbrado, Ruta, LstFordASN, TxtFordGSDB.Text, ObjVentas)
-
- ' ' sw.Stop()
- ' ' GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString(), UsuarioActual.Empresa.CvePAC)
-
- ' ' ElseIf UsuarioActual.Empresa.TipoFacturacion = "CBB" Then
- ' ' GeneraPDFCBB(ObjFactura.Fecha, Nothing, ObjFactura.SerieFolio, False)
- ' ' End If
- ' 'End If
-
- ' If ErrorList.Count > 0 Then
- ' ProcesoCorrecto = False
- ' End If
-
- ' Return ProcesoCorrecto
- 'End Function
#End Region
#Region " VISTA PREVIA NEW "
@@ -15701,7 +15428,10 @@ Partial Class Ventas
HdnIVACalculado.Value = "0"
'SI ES REFACTURACION NO LIMPIAR EL FOLIO FISCAL
If NuevaFactura <> 1 Then
- HdnFolioFiscalNC.Value = "0"
+ 'SI ES UNA NOTA DE CREDITO NO TIMBRADA NO DEBE LIMPIAR
+ If Not (DdlTipoComprobante.SelectedValue.ToString() = "Egs" AndAlso CveVenta > 0 AndAlso LblSeTimbro.Text = "No") Then
+ HdnFolioFiscalNC.Value = "0"
+ End If
End If
LblAntAplicados.Text = ""
LblAntAplicados.Visible = False
@@ -15927,7 +15657,7 @@ Partial Class Ventas
'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then
' FechaMaxima = "01/01/2018".ToDate
'End If
- 'Dim Now As DateTime = New DateTime(2020, 2, 19)
+ 'Dim NowADS() As DateTime = New DateTime(2020, 2, 19)
Try
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Anticipos", CvePlantillaPoliza, TxtTotal.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero(), TxtFechaAnticipoCliente.Text.ToDate, String.Format("{0} {1} {2}-{3}", If(EsAnticipo2017Jam, "Aplicación Anticipo 2017", ""), NombreCliente, Serie, TxtFolio.Text), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
@@ -15949,7 +15679,7 @@ Partial Class Ventas
Dim FechaUltimaFluctuacion As Date = MinFecha
Dim TipoCambioFluctuacion As Decimal = 1
- Dim tFecha As Date = Now
+ Dim tFecha As Date = NowADS()
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
@@ -16300,7 +16030,7 @@ Partial Class Ventas
Private Function AgregarPrePolizasXTrasladar(ObjConta As ClsContabilidad, CvePrePoliza As Integer, PorcentajeAmortizacion As Decimal, TipoCambio As Decimal, ByRef CuentasContablesInvalidas As StringBuilder, ByRef CveCuentaContabilizacion As Integer, Importe13 As Decimal, Importe8 As Decimal, Importe9 As Decimal) As Boolean
Dim ImporteMovimiento As Decimal
Dim ImporteMX As Decimal
- Dim FechaMovimiento As Date = Now
+ Dim FechaMovimiento As Date = NowADS()
Dim Concepto As String = ViewState("VentaFolio").ToString()
Dim PrePolizaCorrecta As Boolean = True
'13 Iva x Trasladar
@@ -16341,7 +16071,7 @@ Partial Class Ventas
Dim ImporteMovimiento As Decimal
Dim ImporteMX As Decimal
- Dim FechaMovimiento As Date = Now
+ Dim FechaMovimiento As Date = NowADS()
Dim Concepto As String = ViewState("VentaFolio").ToString()
Dim PrePolizaCorrecta As Boolean = True
Dim PorcentajeImpuesto As Decimal
@@ -16395,6 +16125,7 @@ Partial Class Ventas
CreaObjetosVenta()
'PARA CUANDO YA ESTA GUARDADA LA VENTA
+ ObjFactura.Timbre = PreParaTimbre(ObjFactura)
ObjFactura.CveVenta = CveVenta
ObjFactura.Serie = Serie
ObjFactura.Folio = Folio
@@ -16685,7 +16416,7 @@ Partial Class Ventas
' End If
- ' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ ' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), NowADS(), NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' ObjFacturaDevolucion.CveVenta = CveVenta
' ObjFacturaDevolucion.CvePrePoliza = CvePrePoliza
@@ -16708,7 +16439,7 @@ Partial Class Ventas
' If CveEstatus = 4 Then
- ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
+ ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", NowADS(), CveVenta, IDPoliza) Then
' Mensaje = "El nuevo estatus se guardó correctamente"
' Else
' ErrorCancelar = True
@@ -16730,7 +16461,7 @@ Partial Class Ventas
' Dim Total As Decimal = TxtTotal.Text.ToDecimal
' Dim RFCReceptor As String = HdnRFCVenta.Value
- ' If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", Now, CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
+ ' If Not ObjVentas.UpdateEstatusFactura(13, FolioFiscal, "", NowADS(), CveVenta, IDPoliza) Then 'Marcamos la factura como refacturada, si no se cancelo en el SAT el estatus nos dejara cancelarla despues
' ErrorCancelar = True
' End If
' Dim RespCancelacion = ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC)
@@ -16747,7 +16478,7 @@ Partial Class Ventas
' End If
' If Not ErrorCancelar Then
- ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, Now, CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
+ ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, NowADS(), CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
' Mensaje = "El nuevo estatus se guardó correctamente"
' Else
' ErrorCancelar = True
@@ -16785,7 +16516,7 @@ Partial Class Ventas
' End If
- ' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), Now, NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ ' CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardaEstatus", CvePlantillaPoliza, TxtTotal.Text.ToDouble, TxtTotal.Text.Replace(",", "").ToDouble, DdlMoneda.SelectedValue.ToEntero(), NowADS(), NombreCliente, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
' ObjFactura.CveVenta = CveVenta
' ObjFactura.CvePrePoliza = CvePrePoliza
@@ -16799,7 +16530,7 @@ Partial Class Ventas
' If CveEstatus = 4 Then
- ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta, IDPoliza) Then
+ ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", NowADS(), CveVenta, IDPoliza) Then
' Mensaje = "El nuevo estatus se guardó correctamente"
' Else
' ErrorCancelar = True
@@ -17124,7 +16855,7 @@ Partial Class Ventas
'RBLPago.Enabled = False
RBLPago.SelectedValue = "2"
RBLPago_SelectedIndexChanged(RBLPago, EventArgs.Empty)
- TxtFechaVencimientoCotizacion.Text = Now.ToString()
+ TxtFechaVencimientoCotizacion.Text = NowADS().ToString()
GvPS.Columns(5).Visible = True
ThTiempoEntrega.Visible = True
ThTiempoEntrega2.Visible = True
@@ -17143,7 +16874,7 @@ Partial Class Ventas
TrRFC.Visible = False
'RBLPago.Enabled = False
'RBLPago.SelectedValue = "2"
- TxtFechaVencimientoCotizacion.Text = Now.ToString()
+ TxtFechaVencimientoCotizacion.Text = NowADS().ToString()
GvPS.Columns(5).Visible = True
ThTiempoEntrega.Visible = True
ThTiempoEntrega2.Visible = True
@@ -17255,7 +16986,7 @@ Partial Class Ventas
End If
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
@@ -17497,9 +17228,12 @@ Partial Class Ventas
If Not FacturarDocumentoNuevo Then
If Not CveEmpresaCRM > 0 Then
- BtnCrearApartirDe.Enabled = EstatusCliente
- BtnEmitirImprimir.Visible = EstatusCliente
- TrVistaPrevia.Visible = EstatusCliente
+ 'SI ES UNA REMISION EXISTENTE, NO MOSTRAR LOS BOTONES
+ If Not (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
+ BtnCrearApartirDe.Enabled = EstatusCliente
+ BtnEmitirImprimir.Visible = EstatusCliente
+ TrVistaPrevia.Visible = EstatusCliente
+ End If
Else
If TipoDoctoConsulta.Contiene("Ing", "Egs", "Ant", "Dev") Then
BtnCrearApartirDe.Enabled = EstatusCliente
@@ -18230,7 +17964,7 @@ Partial Class Ventas
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=-1, FechaVencimientoConsulta:=MinFecha) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
- DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento >= '{Now.ToString("yyyy/MM/dd")}') OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
+ DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento >= '{NowADS().ToString("yyyy/MM/dd")}') OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
End If
End If
Else
@@ -18243,7 +17977,7 @@ Partial Class Ventas
End If
End If
Else
- If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
+ If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, -1, UsuarioActual.CveEmpresa, TipoCambioConsulta:=TCConsulta, ConSaldo:=1, FechaVencimientoConsulta:=NowADS()) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrLineaAdicional.Visible = True
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
@@ -18908,7 +18642,7 @@ Partial Class Ventas
'End Sub
'Private Sub ActualizaEstatus(CveEstatus As Integer, FolioFiscal As String, CveVenta As Integer)
' Dim ObjVentas As New ClsVentas()
- ' ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta)
+ ' ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", NowADS(), CveVenta)
' ObjVentas.Dispose()
'End Sub
'Private Sub ActualizaCliente(NumCtaPago As String, MetodoDePago As Integer, CveCliente As Integer)
@@ -20098,7 +19832,7 @@ Partial Class Ventas
If Indice >= 0 Then
' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("Serie").ToString() <> "")
If rowSurtidos("Surtido").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDecimal Then
- Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal)
+ Dim CantidadSurtida As Decimal = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal)
'SI LA CANTIDAD SURTIDA SUPERA LO REQUERIDO, TOMA SOLO LO NECESARIO PARA COMPLETAR
If (rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida) > rowSurtidos("Cantidad").ToString().ToDecimal Then
@@ -20157,16 +19891,7 @@ Partial Class Ventas
Optional CveAlmacenDestino As Integer = -1) As Integer
Dim OcurrioError As Boolean = False
Dim ContadorMovtosDetalles As Integer = 0
-
- 'If Not AplicaMovimientoDetalleEntrada Then
- ' Dim rowa As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen={0}", CveAlmacen))
- ' If Not IsNothing(rowa) AndAlso rowa("CveTipoAlmacen").ToString() = "10" Then
- ' AplicaMovimientoDetalleEntrada = True
- ' End If
- 'End If
- 'Creamos el movimiento
-
- Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
+ Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
CveMovimientoRelacionado:=CveMovimientoRelacionado, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Vta/E4")
If CveMovimientoInventario > 0 Then
@@ -20201,21 +19926,6 @@ Partial Class Ventas
CveVentaDetalleRemision = MovDet("CveVentaDetalle").ToString().ToEntero()
End If
- 'If ConceptoEntrada = 3 Then
- ' CveVentaDetalle = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero()
- 'ElseIf ConceptoEntrada = 40 Then
- ' CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
- ' CveVentaDetallePadre = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero()
- ' 'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
- ' If CveVentaDetallePadre < 0 Then
- ' Alert("no se encontro la venta detalle nueva. Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
- ' OcurrioError = True
- ' Exit For
- ' End If
- 'Else
- ' CveVentaDetalle = MovDet("CveVentaDetalle").ToString().ToEntero()
- 'End If
-
'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
If CveVentaDetalle < 0 Then
Alert("no se encontro la venta detalle. Por favor comuniquese con atención SIG.", TipoMensaje.ToastError)
@@ -20311,13 +20021,16 @@ Partial Class Ventas
For Each drt As DataRow In dttped.FiltraParametros("Pedimento <> ''").Rows
ObjInventario.UpdateVentasDetalleNumeroPedimento(CveVenta, drt("CveVentaDetalle").ToString.ToEntero, drt("Pedimento").ToString)
+ Dim dtr As DataRow() = TmpDT.Select($"CveVentaDetalle ={drt("CveVentaDetalle")}")
+ If dtr IsNot Nothing Then 'actualizamos los datos temporales para timbrar
+ dtr(0)("NumeroPedimento") = drt("Pedimento").ToString
+ End If
Next
End If
End If
Else
OcurrioError = True
End If
-
End If
End If
@@ -20449,7 +20162,7 @@ Partial Class Ventas
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS As Integer = RowUsado("CvePS").ToString().ToEntero()
- Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
+ Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
@@ -21049,7 +20762,7 @@ Partial Class Ventas
Dim x509 As New X509Certificate2()
x509.Import(Data)
- If x509.NotAfter <= Now() Then
+ If x509.NotAfter <= NowADS() Then
TrVistaPrevia.Visible = False
TrEmitir.Visible = False
BtnEmitirImprimir.Visible = False
@@ -22008,7 +21721,7 @@ Partial Class Ventas
Select Case RBLPago.SelectedValue.ToEntero()
Case 1 'CREDITO
- TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
+ TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranzaRemision), NowADS().AddDays(PlazoCobranza)).ToShortDateString
'SI ES CREDITO EL METODO DE PAGO DEBE SER PPD
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
DdlMetodoPago33.SelectedValueExist("3")
@@ -22046,7 +21759,7 @@ Partial Class Ventas
End If
TxtImporteContado.Text = TxtTotal.Text
End If
- TxtFechaPago.Text = Now.ToShortDateString
+ TxtFechaPago.Text = NowADS().ToShortDateString
'SI ES CONTADO EL METODO DE PAGO DEBE SER PUE
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
DdlMetodoPago33.SelectedValueExist("1")
@@ -22076,7 +21789,7 @@ Partial Class Ventas
End If
Case 3 ' TERMINAL
DivTerminal.Visible = True
- TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
+ TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranzaRemision), NowADS().AddDays(PlazoCobranza)).ToShortDateString
End Select
LimpiaContado()
@@ -23084,7 +22797,7 @@ Partial Class Ventas
' Exit Sub
'End If
- If CveVenta > 0 AndAlso (SaldoVenta = TxtTotal.Text.ToDecimal OrElse DdlTipoComprobante.SelectedValue = "Dev" OrElse (DdlTipoComprobante.SelectedValue = "Ped" AndAlso TmpDT IsNot Nothing AndAlso TmpDT.COUNT("CveContratoDetalle", "CveContratoDetalle > 0") > 0)) Then 'And (DdlTipoComprobante.SelectedValue.Contiene({"Rem", "Ped"}) Or (DdlTipoComprobante.SelectedValue.Contiene({"Ing"}) And TxtFecha.Text.ToDate.Month = Now.Month And TxtFecha.Text.ToDate.Year = Now.Year)) Then
+ If CveVenta > 0 AndAlso (SaldoVenta = TxtTotal.Text.ToDecimal OrElse DdlTipoComprobante.SelectedValue = "Dev" OrElse (DdlTipoComprobante.SelectedValue = "Ped" AndAlso TmpDT IsNot Nothing AndAlso TmpDT.COUNT("CveContratoDetalle", "CveContratoDetalle > 0") > 0)) Then 'And (DdlTipoComprobante.SelectedValue.Contiene({"Rem", "Ped"}) Or (DdlTipoComprobante.SelectedValue.Contiene({"Ing"}) And TxtFecha.Text.ToDate.Month = NowADS().Month And TxtFecha.Text.ToDate.Year = NowADS().Year)) Then
If Not DevolucionAlmacen = 2 Then
'If UsuarioActual.Empresa.Funcionalidad(555) = "1" Then
@@ -23595,7 +23308,7 @@ Partial Class Ventas
Dim ActualizoEstatus As Boolean = False
Dim ObjVentas As New ClsVentas
- If ObjVentas.UpdateEstatusFactura(8, FolioFiscal, "", Now, CveVenta) Then
+ If ObjVentas.UpdateEstatusFactura(8, FolioFiscal, "", NowADS(), CveVenta) Then
ActualizoEstatus = True
End If
ObjVentas.Dispose()
@@ -24016,7 +23729,7 @@ Partial Class Ventas
' Exit Sub
' End If
' Else
- ' CancelacionFecha = Now.Date
+ ' CancelacionFecha = NowADS().Date
' CancelacionAcuse = ""
' End If
@@ -24111,7 +23824,7 @@ Partial Class Ventas
' End Try
' ElseIf CveEstatusCancelacion = 20 Then
- ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", Now, CveVenta) Then
+ ' If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, "", NowADS(), CveVenta) Then
' Alert("El estatus de la factura fue cambiado a 'Cancelación en Proceso'")
' End If
' ObjVentas.Dispose()
@@ -24339,11 +24052,11 @@ Partial Class Ventas
Dim Plantilla As String = texto
If Plantilla.Contains("{DIA}") Then
- Plantilla = Plantilla.Replace("{DIA}", DateTime.Now.Day.ToString())
+ Plantilla = Plantilla.Replace("{DIA}", NowADS().Day.ToString())
End If
If Plantilla.Contains("{MES}") Then
- Dim fecha As DateTime = DateTime.Now
+ Dim fecha As DateTime = NowADS()
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
@@ -24351,15 +24064,15 @@ Partial Class Ventas
End If
If Plantilla.Contains("{AÑO}") Then
- Plantilla = Plantilla.Replace("{AÑO}", DateTime.Now.Year.ToString())
+ Plantilla = Plantilla.Replace("{AÑO}", NowADS().Year.ToString())
End If
If Plantilla.Contains("{TC}") Then
- Plantilla = Plantilla.Replace("{TC}", GlobalTipoCambio(Now).FormatoNumero)
+ Plantilla = Plantilla.Replace("{TC}", GlobalTipoCambio(NowADS()).FormatoNumero)
End If
If Plantilla.Contains("{MESANTERIOR}") Then
- Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
+ Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
@@ -24367,7 +24080,7 @@ Partial Class Ventas
End If
If Plantilla.Contains("{INICIOMESANTERIOR}") Then
- Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
+ Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
@@ -24377,7 +24090,7 @@ Partial Class Ventas
End If
If Plantilla.Contains("{FINMESANTERIOR}") Then
- Dim fecha As DateTime = DateTime.Now.AddMonths(-1)
+ Dim fecha As DateTime = NowADS().AddMonths(-1)
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
Dim nombreMes As String = formatoFecha.GetMonthName(fecha.Month).ToUpper()
@@ -24765,7 +24478,7 @@ Partial Class Ventas
HdnCveCliente.Value = CveCliente.ToString()
ViewState("CveCliente") = CveCliente
CargaCliente(CveCliente, -1) 'Estatus activo, se requiere para cargar una factura en la que el cliente a sido eliminado
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
'TxtSubTotal.Text = DbRowVenta("SubTotal").ToString().FormatoNumero(2)
'LblDescuentos.Text = DbRowVenta("Descuento").ToString().FormatoNumero(2)
@@ -25602,7 +25315,7 @@ Partial Class Ventas
' Dim ObjVentas As New ClsVentas
' Dim dtt As DataTable = Nothing
' If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", CveCliente, -1, 3, -1,
- ' Now.AddYears(-1).ToShortDateString, Now.ToShortDateString, "-1", -1, -1, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
+ ' NowADS().AddYears(-1).ToShortDateString, NowADS().ToShortDateString, "-1", -1, -1, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
' If ObjVentas.DtResultados.Rows.Count > 0 Then
' dtt = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant')")
' End If
@@ -26319,11 +26032,11 @@ Partial Class Ventas
params.Add(New ReportParameter("Guia", Guia))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
- params.Add(New ReportParameter("Anio", Now.Year.ToString()))
- params.Add(New ReportParameter("Mes", Now.Month.ToString("00")))
- params.Add(New ReportParameter("Dia", Now.Day.ToString("00")))
+ params.Add(New ReportParameter("Anio", NowADS().Year.ToString()))
+ params.Add(New ReportParameter("Mes", NowADS().Month.ToString("00")))
+ params.Add(New ReportParameter("Dia", NowADS().Day.ToString("00")))
params.Add(New ReportParameter("Rastreo", Rastreo))
params.Add(New ReportParameter("Dimensiones", Dimensiones))
@@ -26331,7 +26044,7 @@ Partial Class Ventas
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
- ImprimirPDF(RutaRdlc, DTMovimientosDetalle, params, $"ReporteGuia_{Now.ToString("yyyyMMddhhmmss")}")
+ ImprimirPDF(RutaRdlc, DTMovimientosDetalle, params, $"ReporteGuia_{NowADS().ToString("yyyyMMddhhmmss")}")
End Sub
Private Sub GvPaqueriaGuias_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPaqueriaGuias.RowDataBound
@@ -26565,7 +26278,7 @@ Partial Class Ventas
Dim CveSubProyecto As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
Dim CveEstatus As Integer = 1
- Dim Fecha As String = Now.ToString("dd/MM/yyyy")
+ Dim Fecha As String = NowADS().ToString("dd/MM/yyyy")
Dim FechaEstimada As String = "-1"
Dim NoCajas As Integer = 0
Dim Observaciones As String = ""
@@ -27330,7 +27043,6 @@ Partial Class Ventas
Next
End If
Next
-
End If
'VERIFICA SI TIENE BONIFICACIONES PARA AGREGARLAS
@@ -27740,6 +27452,8 @@ Partial Class Ventas
'End If
'ObjCliente.Dispose()
+ DdlLineaAdicional.SelectedValue = "-1" 'limpieza de la linea adicionales
+
'CARGA IMPUESTOS LOCALES
Dim ObjVentas As New ClsVentas()
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
@@ -27845,7 +27559,7 @@ Partial Class Ventas
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString().ToEntero(), Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero()), True, MissingSchemaAction.Ignore)
'CARGA FACTURA A LA CUAL SE APLICA LA NC
AcumuladoNC += Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal
- CargaNCDT(Gvr.DataKey("CveVenta").ToString().ToEntero(), Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal)
+ CargaNCDT(Gvr.DataKey("CveVenta").ToString().ToEntero(), DdlTipoComprobante.SelectedValue, Gvr.FCTextBox("TxtImporte").Text.ToString().ToDecimal)
If UsuarioActual.CveEmpresa = 140 AndAlso NumVentasAplicar = 1 Then
DdlMetodoPago33.Enabled = True
DdlMetodoPago33.SelectedValueExist(Gvr.DataKey("CveMetodoPago33").ToString())
@@ -28024,9 +27738,9 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa.Contiene(13, 83) OrElse ChkEmitirComercioExterior.Checked Then
- TxtTipoCambio.Text = GlobalTipoCambio(Now.AddDays(-1)).ToString()
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS().AddDays(-1)).ToString()
Else
- TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS()).ToString()
End If
End If
@@ -28111,16 +27825,16 @@ Partial Class Ventas
If Not AplicaNCMasiva Then
Dim TT As Decimal = TxtNCImporte.Text.ToDecimal
If TT > TxtTotal.Text.ToDecimal Then TT = TxtTotal.Text.ToDecimal
- CargaNCDT(CveVenta, TT)
+ CargaNCDT(CveVenta, DdlTipoComprobante.SelectedValue, TT)
End If
'verifica el tipo de cambio que se actualice
If DdlMoneda.SelectedValue <> "1" Then
If UsuarioActual.CveEmpresa.Contiene(13, 83) OrElse ChkEmitirComercioExterior.Checked Then
- TxtTipoCambio.Text = GlobalTipoCambio(Now.AddDays(-1)).ToString()
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS().AddDays(-1)).ToString()
Else
- TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS()).ToString()
End If
End If
@@ -28707,7 +28421,7 @@ Partial Class Ventas
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
End If
- Dim FechaFactura As DateTime = Now
+ Dim FechaFactura As DateTime = NowADS()
If AplicaNCMasiva OrElse AplicaNCUsado Then
If ObjVentas.GetVenta(CveVentaNC, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
@@ -28975,7 +28689,7 @@ Partial Class Ventas
GvPS.DataBind()
LblFolioFiscal.Text = ""
- TxtFecha.Text = Now.ToShortDateString
+ TxtFecha.Text = NowADS().ToShortDateString
'DESACTIVA/ACTIVA BOTONES
TrVistaPrevia.Visible = True
@@ -29027,8 +28741,8 @@ Partial Class Ventas
DtVentasNC.Columns.Add(New DataColumn With {.ColumnName = "Folio", .DataType = GetType(String), .DefaultValue = ""})
End Sub
- Private Sub CargaNCDT(pCveVenta As Integer, Importe As Decimal, Optional FolioFiscal As String = "", Optional NuevaFactura As Integer = -1, Optional ByRef ObjVentas As ClsVentas = Nothing, Optional TC As Decimal = 1)
- If (pCveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs")) OrElse (pCveVenta > 0 AndAlso NuevaFactura = 1) Then
+ Private Sub CargaNCDT(pCveVenta As Integer, TipoDocumento As String, Importe As Decimal, Optional FolioFiscal As String = "", Optional NuevaFactura As Integer = -1, Optional ByRef ObjVentas As ClsVentas = Nothing, Optional TC As Decimal = 1)
+ If (pCveVenta > 0 AndAlso TipoDocumento.Contiene("Egs")) OrElse (pCveVenta > 0 AndAlso NuevaFactura = 1) Then
Dim CveEstatusFacturaNC As Integer = -1
Dim TCCambioValuacion As Decimal = 1
Dim Folio As String = ""
@@ -29171,7 +28885,7 @@ Partial Class Ventas
Dim PU As Decimal = If(AplicaPUEditado, Gv.FCTextBox("TxtPrecioEditado").Text.ToDecimal, Gv.DataKey("PU").ToDecimal)
Dim Total As Decimal = (Cantidad * PU)
Dim TotalImpuestos As Decimal = (Cantidad * PU) - Descuento
- Dim TotalCalculableImpuestosIVA = TotalImpuestos * (1 + Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal)
+ Dim TotalCalculableImpuestosIVA As Decimal = TotalImpuestos * (1 + Gv.DataKey("PorcentajeIEPS").ToString().ToDecimal)
Dim ImporteIVA As Decimal = TotalCalculableImpuestosIVA * Gv.DataKey("PorcentajeIVA").ToString().ToDecimal
Dim ImporteRetIVA As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetIVA").ToString().ToDecimal
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString().ToDecimal
@@ -29253,7 +28967,7 @@ Partial Class Ventas
trNCFactura.Visible = True
DdlSubProyectoDatos.Enabled = True
TrFolioFiscal.Visible = False
- TxtFecha.Text = Now.ToShortDateString()
+ TxtFecha.Text = NowADS().ToShortDateString()
TipoCambioFactura = TxtTipoCambio.Text.ToDecimal
If DdlMoneda.SelectedValue.ToEntero() > 1 Then
@@ -29286,9 +29000,9 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa.Contiene(13, 83) OrElse ChkEmitirComercioExterior.Checked Then
- TxtTipoCambio.Text = GlobalTipoCambio(Now.AddDays(-1)).ToString()
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS().AddDays(-1)).ToString()
Else
- TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString()
+ TxtTipoCambio.Text = GlobalTipoCambio(NowADS()).ToString()
End If
DivEstatusFac.Visible = False
@@ -29629,13 +29343,13 @@ Partial Class Ventas
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("EnvioContacto", EnvioContacto))
params.Add(New ReportParameter("SerieFolio", SerieFolio))
params.Add(New ReportParameter("PedidoContrato", PedidoContrato))
params.Add(New ReportParameter("EnvioDireccion", EnvioDireccion))
params.Add(New ReportParameter("Guia", Guia))
- ImprimirPDF("Empresas/Grales/Formatos/Cicovisa.rdlc", Dt, params, String.Format("Formato Cicovisa -{0}", Now.ToDateTime.ToShortDateString))
+ ImprimirPDF("Empresas/Grales/Formatos/Cicovisa.rdlc", Dt, params, String.Format("Formato Cicovisa -{0}", NowADS().ToDateTime.ToShortDateString))
End If
End Sub
@@ -29727,7 +29441,7 @@ Partial Class Ventas
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("FechaImpresion", NowADS().ToDateTime.ToShortDateString))
params.Add(New ReportParameter("EnvioContacto", EnvioContacto))
params.Add(New ReportParameter("SerieFolio", SerieFolio))
params.Add(New ReportParameter("PedidoContrato", PedidoContrato))
@@ -29743,7 +29457,7 @@ Partial Class Ventas
params.Add(New ReportParameter("EnvioEstado", EnvioEstado))
params.Add(New ReportParameter("Pais", Pais))
params.Add(New ReportParameter("CP", CP))
- ImprimirPDF("Empresas/Grales/Formatos/Telcel.rdlc", Dt, params, String.Format("Formato RADIO MOVIL DIPSA S.A DE C.V. -{0}", Now.ToDateTime.ToShortDateString), "PDF")
+ ImprimirPDF("Empresas/Grales/Formatos/Telcel.rdlc", Dt, params, String.Format("Formato RADIO MOVIL DIPSA S.A DE C.V. -{0}", NowADS().ToDateTime.ToShortDateString), "PDF")
End If
End Sub
#End Region
@@ -31005,7 +30719,7 @@ Partial Class Ventas
End If
- TxtFechaPago.Text = If(EsDiasCreditoFijo, Now.AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text)
+ TxtFechaPago.Text = If(EsDiasCreditoFijo, NowADS().AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text)
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
@@ -31185,7 +30899,7 @@ Partial Class Ventas
DdlTipoComprobante.SelectedValue = "Ing"
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
- TxtFecha.Text = Now.ToShortDateString()
+ TxtFecha.Text = NowADS().ToShortDateString()
End If
UpPS.Update()
@@ -31614,9 +31328,9 @@ Partial Class Ventas
LblFolioFiscal.Text = ""
DdlTipoComprobante.Enabled = True
- TxtFecha.Text = Now.ToShortDateString()
+ TxtFecha.Text = NowADS().ToShortDateString()
LblUsuario.Text = UsuarioActual.Usuario
- LblFechaRegistro.Text = Now.ToShortDateString()
+ LblFechaRegistro.Text = NowADS().ToShortDateString()
LblSeTimbro.Text = "No"
LblMail.Text = "No"
@@ -31665,7 +31379,7 @@ Partial Class Ventas
ChkConvertirDoctoPesos.Enabled = Not UsuarioActual.TienePermisoProceso(324)
TxtTipoCambio.Enabled = True
TxtFechaEjecucion.ReadOnly = False
- TxtFechaEjecucion.Text = Now.ToShortDateString
+ TxtFechaEjecucion.Text = NowADS().ToShortDateString
ImgCalendarFechaEje.Enabled = True
DdlVendedor.Enabled = True
DdlSubProyectoDatos.Enabled = True
@@ -31704,7 +31418,7 @@ Partial Class Ventas
PlazoCobranza = ObjCliente.PlazoCobranza
PlazoCobranzaRemision = ObjCliente.PlazoCobranzaRemision
'TxtNumCtaPago.Text = ObjCliente.NumCtaPago
- TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
+ TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranzaRemision), NowADS().AddDays(PlazoCobranza)).ToShortDateString
DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString())
End If
End If
@@ -31713,7 +31427,7 @@ Partial Class Ventas
TrVistaPrevia.Visible = True
- TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString
+ TxtFechaVencimientoCotizacion.Text = NowADS().ToShortDateString
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
@@ -31991,15 +31705,15 @@ Partial Class Ventas
Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue
DdlTipoComprobante.SelectedValue = TipoDoctoNuevo
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
- TxtFecha.Text = Now.ToString()
+ TxtFecha.Text = NowADS().ToString()
End If
'SI TIENE LINEA ADICIONAL, NO DEBE MODIFICAR LA FECHA YA ASIGNADA
If DdlLineaAdicional.SelectedValue.ToEntero() <= 0 Then
- TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, Now.AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza))).ToShortDateString
+ TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, NowADS().AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", NowADS().AddDays(PlazoCobranzaRemision), NowADS().AddDays(PlazoCobranza))).ToShortDateString
End If
- TxtFechaEjecucion.Text = Now.ToString()
+ TxtFechaEjecucion.Text = NowADS().ToString()
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
@@ -32268,7 +31982,7 @@ Partial Class Ventas
If drow("CveTamaño").ToString.ToEntero > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, Puntos, Cargo, Bonificacion, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario,
- UsuarioActual.CveEmpresa, 0D, "", Now) Then
+ UsuarioActual.CveEmpresa, 0D, "", NowADS()) Then
Resultado = False
Exit For
End If
@@ -33184,7 +32898,7 @@ Partial Class Ventas
End If
Dim ObjAcum As New ClsAcumuladores
- If ObjAcum.UpdateEnvioPolizaVirtual(CvePolizaVirtual, Retorno, Now, obj.product_unique_code, resp(0)("Descripcion").ToString()) Then
+ If ObjAcum.UpdateEnvioPolizaVirtual(CvePolizaVirtual, Retorno, NowADS(), obj.product_unique_code, resp(0)("Descripcion").ToString()) Then
Alert(Msg.ToString(), TipoMensaje.MsgInformacion)
End If
ObjAcum.Dispose()
@@ -33708,23 +33422,16 @@ Partial Class Ventas
Dim Serie As String = "-1"
ObjFacturaProntoPago.CveEmpresa = UsuarioActual.CveEmpresa
- ObjFacturaProntoPago.TipoCambio = If(CveMoneda = 1, 1, GlobalTipoCambio(Now).FormatoNumero(4).ToDecimal())
+ ObjFacturaProntoPago.TipoCambio = If(CveMoneda = 1, 1, GlobalTipoCambio(NowADS()).FormatoNumero(4).ToDecimal())
ObjFacturaProntoPago.ConvertirPesos = False
ObjFacturaProntoPago.CveMoneda = CveMoneda
ObjFacturaProntoPago.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
ObjFacturaProntoPago.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
ObjFacturaProntoPago.Serie = Serie
ObjFacturaProntoPago.Folio = Folio
- ObjFacturaProntoPago.Fecha = Now
- ObjFacturaProntoPago.CvePrePoliza = -1
- ObjFacturaProntoPago.CveMetodoPago = 0
- ObjFacturaProntoPago.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
- ObjFacturaProntoPago.FormaPago = 0
ObjFacturaProntoPago.TipoDocto = "Egs"
- ObjFacturaProntoPago.Fecha = Now
-
-
+ ObjFacturaProntoPago.Fecha = NowADS()
ObjFacturaProntoPago.Version = "4.0"
If ObjFacturaProntoPago.Cliente Is Nothing Then
@@ -33747,8 +33454,6 @@ Partial Class Ventas
ObjFacturaProntoPago.CveCliente = CveCliente
ObjFacturaProntoPago.SetCliente()
-
-
If ObjCliente.GetClientes(ObjFacturaProntoPago.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
@@ -33791,17 +33496,7 @@ Partial Class Ventas
ObjFacturaProntoPago.TipoDocumento = ""
End Select
- ObjFacturaProntoPago.FechaPago = Now
-
- ObjFacturaProntoPago.CveCorte = -1
- 'ObjFacturaProntoPago.CveMesa = -1
- ObjFacturaProntoPago.NumeroPersonas = 0
- ObjFacturaProntoPago.CveContrato = -1
- ObjFacturaProntoPago.DescripcionContrato = ""
- ObjFacturaProntoPago.CveClienteSucursal = -1
- ObjFacturaProntoPago.Entrega = ""
- ObjFacturaProntoPago.CveAlmacen = -1
-
+ ObjFacturaProntoPago.FechaPago = NowADS()
Dim DtVentasNC As DataTable = InicializaDTVentasNCProntoPago()
Dim TotalImporte As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("TotalImporte")
@@ -34146,6 +33841,7 @@ Partial Class Ventas
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
TmpDT.Columns("NumTurnos").DefaultValue = 0D
+ TmpDT.Columns.Add("NumeroPedimento", GetType(String))
Return TmpDT
End Function
@@ -34482,8 +34178,8 @@ Partial Class Ventas
Public Sub CargarCamiones()
- TxtFechaEntregaCP.Text = Now.Date.ToString("dd/MM/yyyy HH:mm")
- TxtFechaLlegadaCP.Text = Now.Date.ToString("dd/MM/yyyy HH:mm") 'Now.Date.AddDays(1).AddMinutes(-1).ToString("dd/MM/yyyy HH:mm")
+ TxtFechaEntregaCP.Text = NowADS().Date.ToString("dd/MM/yyyy HH:mm")
+ TxtFechaLlegadaCP.Text = NowADS().Date.ToString("dd/MM/yyyy HH:mm") 'NowADS().Date.AddDays(1).AddMinutes(-1).ToString("dd/MM/yyyy HH:mm")
DdlConfigAuto.Items.Clear()
DdlUnidadCamion.Items.Clear()
@@ -35110,7 +34806,7 @@ Partial Class Ventas
#End Region
Protected Sub BtnGenerarPoliza_Click(sender As Object, e As EventArgs)
- CreaObjetosVenta()
+ 'CreaObjetosVenta()
'If UsuarioActual.Empresa.TipoContabilidad = 2 Then
@@ -35440,7 +35136,7 @@ Partial Class Ventas
Me.CveCategoriaLineaAdicional = 0
If CveVenta <= 0 Then
- TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToString("dd/MM/yyyy")
+ TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToString("dd/MM/yyyy")
TxtOrdenCompra.Text = ""
'SI SE HABILITO LA FACTURACION DESDE LA LINEA ADICIONAL DEBE QUITARLO
@@ -35638,7 +35334,7 @@ Partial Class Ventas
#End Region
Protected Sub BtnFiltrarAF_Click(sender As Object, e As EventArgs)
Using ObjAF As New ClsAF
- If ObjAF.GetRepActivosFijosDepreciacion(UsuarioActual.CveEmpresa, Now, Depreciados:=1, CveTipoAF:=DdlTipoActivoFiltro.SelectedValue.ToEntero(), CveSubTipoAF:=DdlSubTipoActivoFiltro.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectoFiltroAF.SelectedValue.ToEntero()) Then
+ If ObjAF.GetRepActivosFijosDepreciacion(UsuarioActual.CveEmpresa, NowADS(), Depreciados:=1, CveTipoAF:=DdlTipoActivoFiltro.SelectedValue.ToEntero(), CveSubTipoAF:=DdlSubTipoActivoFiltro.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectoFiltroAF.SelectedValue.ToEntero()) Then
GvVentaAF.DataSource = ObjAF.DtResultados.FiltraParametros("CveActivoFijo > 0 AND CveEstadoActivoFijo <> 5")
End If
End Using
diff --git a/ZDG/ActualizaPadron.aspx.vb b/ZDG/ActualizaPadron.aspx.vb
index 6f1c7e066..c3f635ff1 100644
--- a/ZDG/ActualizaPadron.aspx.vb
+++ b/ZDG/ActualizaPadron.aspx.vb
@@ -179,7 +179,7 @@ Partial Class ZDG_ActualizaPadron
'ACTUALIZA BITACORA
If Not ErrorActualizacion Then
- If Not ObjDG.AddActualizacionPadron(NombreArchivo, RegistrosActualizados, DateTime.Now, UsuarioActual.Usuario) Then
+ If Not ObjDG.AddActualizacionPadron(NombreArchivo, RegistrosActualizados, NowADS(), UsuarioActual.Usuario) Then
ErrorActualizacion = True
End If
End If
diff --git a/ZDG/CapturaManual.aspx.vb b/ZDG/CapturaManual.aspx.vb
index ee93a1959..256730052 100644
--- a/ZDG/CapturaManual.aspx.vb
+++ b/ZDG/CapturaManual.aspx.vb
@@ -35,7 +35,7 @@ Partial Class ZDG_CapturaManual
Dim Dr = TempDT.NewRow
Dr("Consecutivo") = TxtConsecutivo.Text.ToEntero
- Dr("Hora") = DateTime.Now
+ Dr("Hora") = NowADS()
Dr("Resultado") = False
If ObjDG.RegistrarVoto(TxtConsecutivo.Text.ToEntero) Then
diff --git a/ZDG/MensajeAutomatico.aspx.vb b/ZDG/MensajeAutomatico.aspx.vb
index 5e0d5aae1..b9e2bd7d7 100644
--- a/ZDG/MensajeAutomatico.aspx.vb
+++ b/ZDG/MensajeAutomatico.aspx.vb
@@ -135,14 +135,14 @@ Partial Class ZDG_MensajeAutomatico
'MENSAJES A IPP
- If ObjDG.EnviarMensajeWS("6313186706", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss"))) Then
- If ObjDG.MensajeAdd(2, "6313186706", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss")), 100) Then
+ If ObjDG.EnviarMensajeWS("6313186706", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", NowADS().ToString("HH:mm:ss"))) Then
+ If ObjDG.MensajeAdd(2, "6313186706", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", NowADS().ToString("HH:mm:ss")), 100) Then
End If
End If
'MENSAJES A JA
- If ObjDG.EnviarMensajeWS("6621317425", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss"))) Then
- If ObjDG.MensajeAdd(2, "6621317425", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss")), 100) Then
+ If ObjDG.EnviarMensajeWS("6621317425", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", NowADS().ToString("HH:mm:ss"))) Then
+ If ObjDG.MensajeAdd(2, "6621317425", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", NowADS().ToString("HH:mm:ss")), 100) Then
End If
End If
diff --git a/ZDG/MensajeManual.aspx.vb b/ZDG/MensajeManual.aspx.vb
index 5ce988d2a..55c73007c 100644
--- a/ZDG/MensajeManual.aspx.vb
+++ b/ZDG/MensajeManual.aspx.vb
@@ -262,14 +262,14 @@ Partial Class ZDG_MensajeManual
'MENSAJES A IPP
- If ObjDG.EnviarMensajeWS("6313186706", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", Now.ToString("HH:mm:ss"))) Then
- If ObjDG.MensajeAdd(1, "6313186706", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", Now.ToString("HH:mm:ss")), UsuarioActual.CveUsuario) Then
+ If ObjDG.EnviarMensajeWS("6313186706", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", NowADS().ToString("HH:mm:ss"))) Then
+ If ObjDG.MensajeAdd(1, "6313186706", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", NowADS().ToString("HH:mm:ss")), UsuarioActual.CveUsuario) Then
End If
End If
'MENSAJES A JA
- If ObjDG.EnviarMensajeWS("6621317425", String.Format("SE ENVIO SMS MANUAL - Hora: {0}", Now.ToString("HH:mm:ss"))) Then
- If ObjDG.MensajeAdd(1, "6621317425", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", Now.ToString("HH:mm:ss")), UsuarioActual.CveUsuario) Then
+ If ObjDG.EnviarMensajeWS("6621317425", String.Format("SE ENVIO SMS MANUAL - Hora: {0}", NowADS().ToString("HH:mm:ss"))) Then
+ If ObjDG.MensajeAdd(1, "6621317425", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", NowADS().ToString("HH:mm:ss")), UsuarioActual.CveUsuario) Then
End If
End If
diff --git a/ZDG/RepGeneral.aspx.vb b/ZDG/RepGeneral.aspx.vb
index 62a1c3abd..871a880ca 100644
--- a/ZDG/RepGeneral.aspx.vb
+++ b/ZDG/RepGeneral.aspx.vb
@@ -48,7 +48,7 @@ Partial Class ZDG_RepGeneral
Dim ObjDG As New ClsDG
Dim Script = ""
- LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("HH:mm:ss tt"))
+ LtActualizado.Text = String.Format("Actualizado: {0}", NowADS().ToString("HH:mm:ss tt"))
TimmerRefresh.Enabled = False
TimmerRefresh.Enabled = True
diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx
index b029887a0..b4a0bef07 100644
--- a/asmx/WSApp.asmx
+++ b/asmx/WSApp.asmx
@@ -358,7 +358,7 @@ Public Class WSApp
End Try
End Sub
Private Sub EnviarCorreoFactura(Correo As String, Factura As Modelos.Factura, Retorno As Modelos.Factura.MMensajeFactura, DireccionEnvio As String, UsuarioActual As Usuario)
- Dim Body = GeneraCorreoRemision(Retorno.CveVenta, Retorno.SerieFolio, Factura.Cliente.Nombre, Factura.Cliente.NombreComercial, DireccionEnvio, Factura.Observaciones, DateTime.Now)
+ Dim Body = GeneraCorreoRemision(Retorno.CveVenta, Retorno.SerieFolio, Factura.Cliente.Nombre, Factura.Cliente.NombreComercial, DireccionEnvio, Factura.Observaciones, ClsPaginas.NowADS())
Factura.Dispose()
Try
Dim Asunto As String = String.Format("SIG - Se ha realizado un pedido: {0}", Retorno.SerieFolio)
@@ -591,15 +591,15 @@ Public Class WSApp
Case 1
ObjFactura.TipoCambio = 1
Case 2
- ObjFactura.TipoCambio = ClsPaginas.GlobalTipoCambio(Now).ToDecimal
+ ObjFactura.TipoCambio = ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal
Case Else
- ObjFactura.TipoCambio = ClsPaginas.GlobalTipoCambio(Now).ToDecimal
+ ObjFactura.TipoCambio = ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal
End Select
ObjFactura.CveVendedor = -1
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.GetPromocionesPS(-1, ClsPaginas.NowADS(), CveSubProyecto, CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
ObjFactura.DtPromociones = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -618,12 +618,12 @@ Public Class WSApp
ObjFactura.TipoDocto = "Rem"
ObjFactura.RefDocto = ""
'ObjFactura.CveMesa = -1
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = ClsPaginas.NowADS()
ObjFactura.CvePrePoliza = -1
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = ClsPaginas.NowADS()
ObjFactura.MotivoDescuento = ""
ObjFactura.Observaciones = Observaciones
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = ClsPaginas.NowADS()
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CveCondicionEntrega = -1
ObjFactura.CondicionEntrega = ""
@@ -1568,8 +1568,8 @@ Namespace WebServiceAppModels2
Total = 0
IVA = 0
SubTotal = 0
- Fecha = DateTime.Now
- FechaIng = DateTime.Now
+ Fecha = ClsPaginas.NowADS()
+ FechaIng = ClsPaginas.NowADS()
End Sub
Public Property IDTempVenta As Integer
diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx
index 384e3af6b..b9c9aaa43 100644
--- a/asmx/WSGPSApp.asmx
+++ b/asmx/WSGPSApp.asmx
@@ -665,8 +665,8 @@ Public Class WSGPSApp
Dim Estructura = New With
{
Key .[CveDispositivo] = -1,
- Key .[FechaI] = DateTime.Now,
- Key .[FechaF] = DateTime.Now,
+ Key .[FechaI] = ClsPaginas.NowADS(),
+ Key .[FechaF] = ClsPaginas.NowADS(),
Key .[Ticks] = ""
}
Dim jsonParams As String = Decripta(params)
@@ -719,8 +719,8 @@ Public Class WSGPSApp
Dim Estructura = New With
{
Key .[CveDispositivo] = -1,
- Key .[FechaI] = DateTime.Now,
- Key .[FechaF] = DateTime.Now,
+ Key .[FechaI] = ClsPaginas.NowADS(),
+ Key .[FechaF] = ClsPaginas.NowADS(),
Key .[Ticks] = ""
}
Dim jsonParams As String = Decripta(params)
@@ -1004,8 +1004,8 @@ Public Class WSGPSApp
Dim Estructura = New With
{
Key .[CveCliente] = -1,
- Key .[FechaI] = DateTime.Now,
- Key .[FechaF] = DateTime.Now,
+ Key .[FechaI] = ClsPaginas.NowADS(),
+ Key .[FechaF] = ClsPaginas.NowADS(),
Key .[Ticks] = ""
}
Dim json As String = Decripta(encriptDatos)
@@ -1245,7 +1245,7 @@ Public Class WSGPSApp
dash.Panicos = ObjGPS.DtResultados(0)("BotonPanico").ToString.ToDouble
dash.DesconexionBateria = ObjGPS.DtResultados(0)("DesconexionBateria").ToString.ToDouble
End If
- If ObjGPS.GetRalentiDashboard(CveCliente, FechaI.Add(Now.TimeOfDay).ToDateTime, FechaF.Add(Now.TimeOfDay).ToDateTime) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
+ If ObjGPS.GetRalentiDashboard(CveCliente, FechaI.Add(ClsPaginas.NowADS().TimeOfDay).ToDateTime, FechaF.Add(ClsPaginas.NowADS().TimeOfDay).ToDateTime) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
dash.Ralenti = ObjGPS.DtResultados(0)("Ralenti").ToString.ToDouble
End If
If ObjGPS.GetUnidadesReportando(CveCliente) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
@@ -1347,7 +1347,7 @@ Public Class WSGPSApp
Return serializer.Serialize(rows)
End Function
Private Function IsCurrentDate(StrFecha As String) As Boolean
- Return True '(ReturnTimeOnServer(StrFecha) > (DateTime.Now).AddMinutes(-15) And ReturnTimeOnServer(StrFecha) < (DateTime.Now).AddMinutes(15))
+ Return True '(ReturnTimeOnServer(StrFecha) > (ClsPaginas.NowADS()).AddMinutes(-15) And ReturnTimeOnServer(StrFecha) < (ClsPaginas.NowADS()).AddMinutes(15))
End Function
Public Function ReturnTimeOnServer(clientString As String) As DateTime
Dim format As String = "dd/MM/yyyy H:m:s zzz"
diff --git a/asmx/WSSIGApp.asmx b/asmx/WSSIGApp.asmx
index 34c0b988b..c2fa221e3 100644
--- a/asmx/WSSIGApp.asmx
+++ b/asmx/WSSIGApp.asmx
@@ -244,7 +244,7 @@ Public Class WSSIGApp
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
- If Fecha = MinFecha Then Fecha = Now
+ If Fecha = MinFecha Then Fecha = ClsPaginas.NowADS()
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
@@ -660,7 +660,7 @@ Public Class WSSIGApp
If dtVentas.Rows.Count > 0 Then
If UsuarioActual.TienePermisoIndicador(7) Then
Dim jdatosVentas = New JArray(From v In dtVentas
- Where (v("Mes").ToString().ToEntero() <= Now.Month)
+ Where (v("Mes").ToString().ToEntero() <= ClsPaginas.NowADS().Month)
Select New JObject(
New JProperty("NombreMes", v("NombreMes").ToString()),
New JProperty("Importe", v("Importe").ToString().ToDouble())))
@@ -675,7 +675,7 @@ Public Class WSSIGApp
If dtBancos.Rows.Count > 0 Then
If UsuarioActual.TienePermisoIndicador(8) Then
Dim jDatosBancos = New JArray(From v In dtBancos
- Where (v("Mes").ToString().ToEntero() <= Now.Month)
+ Where (v("Mes").ToString().ToEntero() <= ClsPaginas.NowADS().Month)
Select New JObject(
New JProperty("NombreMes", v("NombreMes").ToString()),
New JProperty("Importe", v("Importe").ToString().ToDouble())))
@@ -1473,8 +1473,8 @@ Public Class WSSIGApp
Ent = New WsFiltroEvento()
Ent.CveEmpresa = 1
Ent.CveUsuario = 1360
- Ent.FechaI = Now.AddDays(-180)
- Ent.FechaF = Now
+ Ent.FechaI = ClsPaginas.NowADS().AddDays(-180)
+ Ent.FechaF = ClsPaginas.NowADS()
If Not IsNothing(Ent) Then
Dim ObjOI As New ClsOIEventos
If ObjOI.GetRepEventos(-1, 1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, Ent.CveUsuario, Ent.CveEmpresa, Ent.FechaI, Ent.FechaF) Then
@@ -1860,15 +1860,15 @@ Public Class WSSIGApp
Case 1
ObjFactura.TipoCambio = 1
Case 2
- ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToDecimal
+ ObjFactura.TipoCambio = GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal
Case Else
- ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToDecimal
+ ObjFactura.TipoCambio = GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal
End Select
ObjFactura.CveVendedor = -1
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.GetPromocionesPS(-1, ClsPaginas.NowADS(), CveSubProyecto, CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
ObjFactura.DtPromociones = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -1895,12 +1895,12 @@ Public Class WSSIGApp
ObjFactura.TipoDocto = TipoDocto
ObjFactura.RefDocto = ""
'ObjFactura.CveMesa = -1
- ObjFactura.Fecha = Now
+ ObjFactura.Fecha = ClsPaginas.NowADS()
ObjFactura.CvePrePoliza = -1
- ObjFactura.FechaPago = Now
+ ObjFactura.FechaPago = ClsPaginas.NowADS()
ObjFactura.MotivoDescuento = ""
ObjFactura.Observaciones = ""
- ObjFactura.FechaEjecucion = Now
+ ObjFactura.FechaEjecucion = ClsPaginas.NowADS()
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CveCondicionEntrega = -1
ObjFactura.CondicionEntrega = ""
@@ -2415,7 +2415,7 @@ Public Class WSSIGApp
UsaAC = False
If UsaAC Then
Dim AC As New ClsAC
- Dim Ejercicio = DateTime.Now.Year
+ Dim Ejercicio = ClsPaginas.NowADS().Year
If AC.GetPresupuestoEgresos(-1, True, Ejercicio, Ent.CveEmpresa, True) Then
DtPresupuestos = AC.DtResultados.Copy
End If
@@ -2792,7 +2792,7 @@ Public Class WSSIGApp
Key .Justificacion = "",
Key .Prioridad = -1,
Key .RequiereCotizacion = False,
- Key .FechaEstimadaEntrega = DateTime.Now,
+ Key .FechaEstimadaEntrega = ClsPaginas.NowADS(),
Key .LugarEntrega = "",
Key .CveMoneda = -1,
Key .CveProveedor = -1,
@@ -3057,10 +3057,10 @@ Public Class WSSIGApp
'verifico los permisos según el estatus
'Const Sitio As String = "rm:90/"
- Dim StrSupervisa As String = "" '= String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=SUPERVISAR&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, CveUsuario, Now)))
- Dim StrAutoriza As String = "" '= String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=AUTORIZAR&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, CveUsuario, Now)))
- Dim StrCancela As String = "" ' = String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=CANCELAR&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, UsuarioActual.CveUsuario, Now)))
- Dim StrReqCotiza As String = "" '= String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=REQCONTIZACION&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, CveUsuario, Now)))
+ Dim StrSupervisa As String = "" '= String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=SUPERVISAR&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, CveUsuario, ClsPaginas.NowADS())))
+ Dim StrAutoriza As String = "" '= String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=AUTORIZAR&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, CveUsuario, ClsPaginas.NowADS())))
+ Dim StrCancela As String = "" ' = String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=CANCELAR&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, UsuarioActual.CveUsuario, ClsPaginas.NowADS())))
+ Dim StrReqCotiza As String = "" '= String.Format("http://{0}/OC/RegOp.aspx?p={1}", Sitio, Encripta(String.Format("Op=REQCONTIZACION&Oc={0}&CveUsuario={1}&Fecha={2}", CveOrdenCompra, CveUsuario, ClsPaginas.NowADS())))
'si se acaba de solicitar y se necesita supervisar
If pCveEstatus = 1 Then strOpciones.AppendFormat("
", StrSupervisa)
@@ -3358,7 +3358,7 @@ Public Class WSSIGApp
#Region "F U N C I O N E S"
Private Function notcurrentdate(fecha As DateTime) As Boolean
- Return Not (fecha > (DateTime.Now).AddMinutes(-15) And fecha < (DateTime.Now).AddMinutes(15))
+ Return Not (fecha > (ClsPaginas.NowADS()).AddMinutes(-15) And fecha < (ClsPaginas.NowADS()).AddMinutes(15))
End Function
Private Function ValorXML(n As System.Xml.XmlNode, Campo As String, Optional Retorno As String = "") As String
Dim o As System.Xml.XmlNode = n.Attributes.Cast(Of System.Xml.XmlAttribute)().SingleOrDefault(Function(a) String.Compare(a.Name, Campo, True) = 0)
@@ -3370,7 +3370,7 @@ Public Class WSSIGApp
End Function
Private Function IsCurrentDate(StrFecha As String) As Boolean
'Dim FechaServer As DateTime = ReturnTimeOnServer(StrFecha)
- 'Return (FechaServer > (DateTime.Now).AddMinutes(-15) And FechaServer < (DateTime.Now).AddMinutes(15))
+ 'Return (FechaServer > (ClsPaginas.NowADS()).AddMinutes(-15) And FechaServer < (ClsPaginas.NowADS()).AddMinutes(15))
Return True
End Function
Public Function ReturnTimeOnServer(clientString As String) As DateTime
@@ -3395,7 +3395,7 @@ Public Class WSSIGApp
Public Function GetTipoCambio() As String
Dim Retorno = "[]"
Dim ObjTC As New ClsGenerales
- If ObjTC.GetTipoCambio(-1, DateTime.Now) Then
+ If ObjTC.GetTipoCambio(-1, ClsPaginas.NowADS()) Then
Retorno = JsonConvert.SerializeObject(ObjTC.DtResultados.Rows(0).DataRowToObject(Of WsTipoCambio))
End If
ObjTC.Dispose()
@@ -3484,7 +3484,7 @@ Public Class WSSIGApp
},
.Respuestas = CreateListFromSingle(New With {.IDTempCveEmpresaCRM = -1, .CveEmpresaCRM = -1, .CveEncuesta = -1, .CveEncuestaAplicadaDetalle = -1, .CveEmpresa = -1, .CveUsuario = -1, .CvePregunta = -1, .CveRespuesta = -1, .Valor = ""}),
.Contactos = CreateListFromSingle(New With {.IDTempCveEmpresaCRM = -1, .CveContacto = -1, .Nombre = "", .TelefonoOficina = "", .Celular = "", .Correo = "", .CveUsuarioIng = -1, .CveEmpresaCRM = -1}),
- .Acercamientos = CreateListFromSingle(New With {.IDTemp = -1, .CveAcercamiento = -1, .CveEmpresaCRM = -1, .CveContactoPrincipal = -1, .CveTipoProceso = -1, .CveEtapaProcesoActual = -1, .CveVendedor = -1, .CveMedioCaptacion = -1, .CveRechazoMotivo = -1, .CveProbabilidadAcercamiento = -1, .FechaApertura = Now, .NombreAcercamiento = "", .Descripcion = "", .Importe = 0D, .Comision = 0D, .Prioridad = -1, .CveEmpresa = -1, .CveUsuarioIng = -1, .CveUsuarioMod = -1, .FechaCierre = Now, .CveEncuestaAplicadaProceso = -1}),
+ .Acercamientos = CreateListFromSingle(New With {.IDTemp = -1, .CveAcercamiento = -1, .CveEmpresaCRM = -1, .CveContactoPrincipal = -1, .CveTipoProceso = -1, .CveEtapaProcesoActual = -1, .CveVendedor = -1, .CveMedioCaptacion = -1, .CveRechazoMotivo = -1, .CveProbabilidadAcercamiento = -1, .FechaApertura = ClsPaginas.NowADS(), .NombreAcercamiento = "", .Descripcion = "", .Importe = 0D, .Comision = 0D, .Prioridad = -1, .CveEmpresa = -1, .CveUsuarioIng = -1, .CveUsuarioMod = -1, .FechaCierre = ClsPaginas.NowADS(), .CveEncuestaAplicadaProceso = -1}),
.BitacorasAcercamientos = CreateListFromSingle(New With {.IDTempCveAcercamiento = -1, .CveEvento = -1, .Descripcion = "", .CveTipoProcesoCRM = -1, .CveEmpresa = -1, .CveUsuarioIng = -1, .CveAcercamiento = -1, .CveEtapaProcesoCRM = -1})
}
Dim ObjCRM As New ClsCRM
@@ -3680,7 +3680,7 @@ Public Class WSSIGApp
Public Function SyncAcercamiento(params As String) As Boolean
Dim TieneError As Boolean = False
- Dim Estructura = CreateListFromSingle(New With {.CveAcercamiento = -1, .CveEmpresaCRM = -1, .CveContactoPrincipal = -1, .CveTipoProceso = -1, .CveEtapaProcesoActual = -1, .CveVendedor = -1, .CveMedioCaptacion = -1, .CveRechazoMotivo = -1, .CveProbabilidadAcercamiento = -1, .FechaApertura = Now, .NombreAcercamiento = "", .Descripcion = "", .Importe = 0D, .Comision = 0D, .Prioridad = -1, .CveEmpresa = -1, .CveUsuarioIng = -1, .CveUsuarioMod = -1, .FechaCierre = Now, .CveEncuestaAplicadaProceso = -1})
+ Dim Estructura = CreateListFromSingle(New With {.CveAcercamiento = -1, .CveEmpresaCRM = -1, .CveContactoPrincipal = -1, .CveTipoProceso = -1, .CveEtapaProcesoActual = -1, .CveVendedor = -1, .CveMedioCaptacion = -1, .CveRechazoMotivo = -1, .CveProbabilidadAcercamiento = -1, .FechaApertura = ClsPaginas.NowADS(), .NombreAcercamiento = "", .Descripcion = "", .Importe = 0D, .Comision = 0D, .Prioridad = -1, .CveEmpresa = -1, .CveUsuarioIng = -1, .CveUsuarioMod = -1, .FechaCierre = ClsPaginas.NowADS(), .CveEncuestaAplicadaProceso = -1})
Dim ObjCRM As New ClsCRM
Try
Dim JsonRequest = Decripta(params)
@@ -3689,7 +3689,7 @@ Public Class WSSIGApp
If item.CveAcercamiento > 0 Then
TieneError = Not ObjCRM.UpdateAcercamiento(item.CveAcercamiento, item.CveContactoPrincipal, item.CveTipoProceso, item.CveEtapaProcesoActual, item.CveVendedor, item.CveMedioCaptacion, item.CveProbabilidadAcercamiento, item.NombreAcercamiento, item.Descripcion, item.Importe, item.Comision, item.Prioridad, item.CveUsuarioMod, item.CveRechazoMotivo, item.CveEncuestaAplicadaProceso, item.FechaApertura, item.FechaCierre)
Else
- Dim i As Integer = ObjCRM.AddAcercamiento(item.CveEmpresaCRM, item.CveContactoPrincipal, item.CveTipoProceso, item.CveEtapaProcesoActual, item.CveVendedor, item.CveMedioCaptacion, item.CveRechazoMotivo, item.CveProbabilidadAcercamiento, item.FechaApertura, item.NombreAcercamiento, item.Descripcion, item.Importe, item.Comision, item.Prioridad, item.CveEmpresa, item.CveUsuarioIng, Now)
+ Dim i As Integer = ObjCRM.AddAcercamiento(item.CveEmpresaCRM, item.CveContactoPrincipal, item.CveTipoProceso, item.CveEtapaProcesoActual, item.CveVendedor, item.CveMedioCaptacion, item.CveRechazoMotivo, item.CveProbabilidadAcercamiento, item.FechaApertura, item.NombreAcercamiento, item.Descripcion, item.Importe, item.Comision, item.Prioridad, item.CveEmpresa, item.CveUsuarioIng, ClsPaginas.NowADS())
If i <= 0 Then TieneError = True
End If
If TieneError Then
@@ -4023,7 +4023,7 @@ Public Class WSSIGApp
If Not cevent.recurrenciatipo > 0 Then
'AGREGAMOS CUANDO NO ES RECURRENTE
- Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, Date.Now)
+ Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS())
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
If dr("FechaFin").ToString.ToDateTime > tFecha Or dr("FechaInicio").ToString.ToDateTime > tFecha Then
Events.Add(cevent)
@@ -4102,7 +4102,7 @@ Public Class WSSIGApp
End If
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL Y/0 SI LA FECHA INICIAL DE LA RECURRENCIA ES MENOR A LA FECHA QUE SE CREO EL EVENTO NO LO AGREGA
- If FIT > DateAdd(DateInterval.Month, -6, Date.Now) And FIT >= dr("FechaInicio").ToString.ToDateTime Then
+ If FIT > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) And FIT >= dr("FechaInicio").ToString.ToDateTime Then
Events.Add(cevent)
End If
Next
@@ -4139,7 +4139,7 @@ Public Class WSSIGApp
End If
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
- If FI > DateAdd(DateInterval.Month, -6, Date.Now) Then
+ If FI > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) Then
Events.Add(cevent)
End If
End If
@@ -4271,7 +4271,7 @@ Public Class WSSIGApp
sb.Append($" ({CveUsuario}")
sb.Append($" ,CAST('{Fecha.ToString("yyyy-MM-dd HH:mm:ss")}' AS DATETIME) ")
sb.Append($" ,geography::STPointFromText('{$"POINT({Longitud} {Latitud})"}',4326)")
- sb.Append($" ,CAST('{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}' AS DATETIME))")
+ sb.Append($" ,CAST('{ClsPaginas.NowADS().ToString("yyyy-MM-dd HH:mm:ss")}' AS DATETIME))")
Using ObjInventarios As New ClsInventarios
retorno = ObjInventarios.GetQuery(sb.ToString)
@@ -4777,8 +4777,8 @@ Namespace WebServiceAppModels
Total = 0
IVA = 0
SubTotal = 0
- Fecha = DateTime.Now
- FechaIng = DateTime.Now
+ Fecha = ClsPaginas.NowADS()
+ FechaIng = ClsPaginas.NowADS()
End Sub
Public Property IDTempVenta As Integer
diff --git a/asmx/WS_PuntoVenta.asmx b/asmx/WS_PuntoVenta.asmx
index 9978cf5c5..ce80827b3 100644
--- a/asmx/WS_PuntoVenta.asmx
+++ b/asmx/WS_PuntoVenta.asmx
@@ -851,7 +851,7 @@ Public Class WS_PuntoVenta
If objVentas.AddVenta(objVenta.TipoDocto, objVenta.FolioFact, objVenta.CveCliente, objVenta.CveClienteSucursal,
objVenta.SubTotal, objVenta.Descuento, objVenta.Amortizacion, objVenta.IVA, objVenta.RetIVA, objVenta.RetISR,
objVenta.Total, objVenta.CveMoneda, objVenta.TipoCambio, objVenta.CveMetodoPago, objVenta.CondicionesPago,
- objVenta.FormaPago, Now, objVenta.Fecha, objVenta.MotivoDescuento, objVenta.Observaciones, objVenta.FechaEjecucion,
+ objVenta.FormaPago, ClsPaginas.NowADS(), objVenta.Fecha, objVenta.MotivoDescuento, objVenta.Observaciones, objVenta.FechaEjecucion,
objVenta.CveVendedor, If(objVenta.Alfa1 IsNot Nothing, objVenta.Alfa1, ""), If(objVenta.Alfa2 IsNot Nothing, objVenta.Alfa2, ""), If(objVenta.Alfa3 IsNot Nothing, objVenta.Alfa3, ""), objVenta.Num1,
objVenta.Num2, objVenta.Num3, Fech1, Fech2, Fech3, objVenta.CveCorte, If(objVenta.NumeroPersonas > 255, 255, objVenta.NumeroPersonas), CvePrePoliza, objVenta.CveUsuario, objVenta.CveEmpresa, objVenta.Propina, objVenta.CveVentaTerminal, CveSubProyecto:=objVenta.CveSubProyecto, CveSubProyectoEjecucion:=objVenta.CveSubProyecto) Then
objVenta.CveVenta = objVentas.CveVenta