Empresas Zona Horaria

This commit is contained in:
rakcsle
2023-10-09 11:54:42 -07:00
parent 2df7c3976c
commit f43b7759a8
649 changed files with 11445 additions and 11105 deletions

View File

@@ -2438,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"))
@@ -2527,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 = '';")
@@ -2598,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()
@@ -2747,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()
@@ -3057,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
@@ -3373,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
@@ -3488,7 +3488,7 @@ Partial Class Ventas
If ObjPVenta.DtResultados.Rows.Count > 0 Then
CveCorte = ObjPVenta.CveCorte
Dim FechaICorte As Date = ObjPVenta.FechaInicial.Date '.AddDays(-5)
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 <b>{FechaICorte.ToString("dd/MM/yyyy")}</b>. Favor de cerrarlo para iniciar un nuevo corte."
Else
@@ -3521,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
@@ -3642,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")
@@ -3655,7 +3655,7 @@ 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 As String = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
@@ -3667,7 +3667,7 @@ 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 As String = "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";"
Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga)
@@ -3723,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
@@ -4767,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
@@ -5371,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
@@ -5604,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
@@ -6008,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()
@@ -6727,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
@@ -7088,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
@@ -7153,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"
@@ -7219,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
@@ -7279,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"))
@@ -7830,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"))
@@ -8904,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()
@@ -10538,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 = ""
@@ -10568,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
@@ -10811,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 = ""
@@ -10840,7 +10844,7 @@ Partial Class Ventas
ObjFolios.Dispose()
End If
ObjFacturaBonificacion.Fecha = Now
ObjFacturaBonificacion.Fecha = NowADS()
ObjFacturaBonificacion.Version = "4.0"
@@ -11315,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
@@ -11384,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
@@ -11936,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
@@ -11966,7 +11970,7 @@ Partial Class Ventas
End If
ObjFacturaDevolucion.Fecha = Now
ObjFacturaDevolucion.Fecha = NowADS()
'VALORES DEFAULT DE NC-DEV
@@ -12888,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()
@@ -13285,7 +13289,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
@@ -13304,7 +13308,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
@@ -13333,7 +13337,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
@@ -15105,7 +15109,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
@@ -15655,7 +15659,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)
@@ -15677,7 +15681,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)
@@ -16028,7 +16032,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
@@ -16069,7 +16073,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
@@ -16414,7 +16418,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
@@ -16437,7 +16441,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
@@ -16459,7 +16463,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)
@@ -16476,7 +16480,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
@@ -16514,7 +16518,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
@@ -16528,7 +16532,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
@@ -16853,7 +16857,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
@@ -16872,7 +16876,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
@@ -16984,7 +16988,7 @@ Partial Class Ventas
End If
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToShortDateString
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
@@ -17959,7 +17963,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
@@ -17972,7 +17976,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
@@ -18637,7 +18641,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)
@@ -19886,7 +19890,7 @@ Partial Class Ventas
Optional CveAlmacenDestino As Integer = -1) As Integer
Dim OcurrioError As Boolean = False
Dim ContadorMovtosDetalles As Integer = 0
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
@@ -20757,7 +20761,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
@@ -21716,7 +21720,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")
@@ -21754,7 +21758,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")
@@ -21784,7 +21788,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()
@@ -22792,7 +22796,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
@@ -23303,7 +23307,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()
@@ -23724,7 +23728,7 @@ Partial Class Ventas
' Exit Sub
' End If
' Else
' CancelacionFecha = Now.Date
' CancelacionFecha = NowADS().Date
' CancelacionAcuse = ""
' End If
@@ -23819,7 +23823,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()
@@ -24047,11 +24051,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()
@@ -24059,15 +24063,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()
@@ -24075,7 +24079,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()
@@ -24085,7 +24089,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()
@@ -24473,7 +24477,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)
@@ -25310,7 +25314,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
@@ -26027,11 +26031,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))
@@ -26039,7 +26043,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
@@ -26273,7 +26277,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 = ""
@@ -27731,9 +27735,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
@@ -27825,9 +27829,9 @@ Partial Class Ventas
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
@@ -28414,7 +28418,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
@@ -28682,7 +28686,7 @@ Partial Class Ventas
GvPS.DataBind()
LblFolioFiscal.Text = ""
TxtFecha.Text = Now.ToShortDateString
TxtFecha.Text = NowADS().ToShortDateString
'DESACTIVA/ACTIVA BOTONES
TrVistaPrevia.Visible = True
@@ -28960,7 +28964,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
@@ -28993,9 +28997,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
@@ -29336,13 +29340,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
@@ -29434,7 +29438,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))
@@ -29450,7 +29454,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
@@ -30712,7 +30716,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)
@@ -30892,7 +30896,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()
@@ -31321,9 +31325,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"
@@ -31372,7 +31376,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
@@ -31411,7 +31415,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
@@ -31420,7 +31424,7 @@ Partial Class Ventas
TrVistaPrevia.Visible = True
TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString
TxtFechaVencimientoCotizacion.Text = NowADS().ToShortDateString
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
@@ -31698,15 +31702,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)
@@ -31975,7 +31979,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
@@ -32891,7 +32895,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()
@@ -33415,7 +33419,7 @@ 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}")
@@ -33424,7 +33428,7 @@ Partial Class Ventas
ObjFacturaProntoPago.Folio = Folio
ObjFacturaProntoPago.TipoDocto = "Egs"
ObjFacturaProntoPago.Fecha = Now
ObjFacturaProntoPago.Fecha = NowADS()
ObjFacturaProntoPago.Version = "4.0"
If ObjFacturaProntoPago.Cliente Is Nothing Then
@@ -33489,7 +33493,7 @@ Partial Class Ventas
ObjFacturaProntoPago.TipoDocumento = ""
End Select
ObjFacturaProntoPago.FechaPago = Now
ObjFacturaProntoPago.FechaPago = NowADS()
Dim DtVentasNC As DataTable = InicializaDTVentasNCProntoPago()
Dim TotalImporte As Decimal = ObjFacturaProntoPago.DtDetalle.SUMD("TotalImporte")
@@ -34171,8 +34175,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()
@@ -35129,7 +35133,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
@@ -35327,7 +35331,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