diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 1e743cf35..241098fd9 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5606,7 +5606,7 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1) PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326) - + PaginaDict.Add("/Inventarios/RepRSCO.aspx".ToUpper(), 1328) @@ -5641,6 +5641,9 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad2/RepBalanceGeneralHorizontal.aspx".ToUpper(), -1) + PaginaDict.Add("/OS/RepServicioDomicilio.aspx".ToUpper(), -1) + + 'ECOMMERCE @@ -7041,6 +7044,9 @@ Public Class ClsPaginas Vta.SelloCFDi = "Sin Timbrar" Vta.SelloSAT = "Sin Timbrar" + Dim CETipoOperacion = "", CEClavePedimento As String = "", CEIncoterm As String = "", CEId As String = "", CEMotivoTraslado As String = "", CETipoCambio As String = "" + Dim RCETipoOperacion As String = "", RCEClavePedimento As String = "", RCEIncoterm As String = "", RCEMotivoTraslado As String = "" + 'SI ESTA TIMBRADA - CON XML If File.Exists(PathXML) AndAlso Vta.Serie <> "VistaPrevia" Then 'Cuando es vista previe y coincide la serie y folio se ponen los datos fiscales Dim XmlDoc As New System.Xml.XmlDocument @@ -7077,6 +7083,38 @@ Public Class ClsPaginas Vta.SelloCFDi = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloCFD").InnerText Vta.SelloSAT = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("SelloSAT").InnerText End If + + If XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Name = "cce11:ComercioExterior" Then + + CETipoOperacion = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoOperacion").InnerText + CEClavePedimento = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("ClaveDePedimento").InnerText + CEIncoterm = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("Incoterm").InnerText + + + Dim namespaces As XmlNamespaceManager = New XmlNamespaceManager(XmlDoc.NameTable) + namespaces.AddNamespace("cce11", "http://www.sat.gob.mx/ComercioExterior11") + + CEId = "" + Try + CEId = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).SelectSingleNode("//cce11:Destinatario", namespaces).Attributes("NumRegIdTrib").InnerText 'XmlDoc.SelectNodes("//cfdi:Complemento/tfd:TimbreFiscalDigital/cce11:Destinatario") + Catch ex As Exception + + End Try + + + CEMotivoTraslado = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("MotivoTraslado").InnerText + CETipoCambio = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes(i).Attributes("TipoCambioUSD").InnerText + + + + + RCETipoOperacion = GlobalDTTipoOperacion.FiltroPrimeroValor("Descripcion", $"ClaveSATTipoOperacion = '{CETipoOperacion}'") + RCEClavePedimento = GlobalDTClavePedimento.FiltroPrimeroValor("Descripcion", $"ClaveSATPedimento = '{CEClavePedimento}'") + RCEIncoterm = GlobalDTIncoterm.FiltroPrimeroValor("Descripcion", $"ClaveSATIncoterm = '{CEIncoterm}'") + RCEMotivoTraslado = GlobalDTSATMotivoTraslado.FiltroPrimeroValor("MotivoTraslado", $"ClaveSATMotivoTraslado = '{CEMotivoTraslado}'") + 'RCETipoCambio = {RCETipoCambio + End If + Next End If @@ -7191,6 +7229,17 @@ Public Class ClsPaginas Dim params As New List(Of ReportParameter) + + If RCETipoOperacion.Trim.Length > 0 Then + params.Add(New ReportParameter("CETipoOperacion", RCETipoOperacion)) + params.Add(New ReportParameter("CEClavePedimento", RCEClavePedimento)) + params.Add(New ReportParameter("CEIncoterm", RCEIncoterm)) + params.Add(New ReportParameter("CEId", CEId)) + params.Add(New ReportParameter("CEMotivoTraslado", RCEMotivoTraslado)) + params.Add(New ReportParameter("CETipoCamvio", CETipoCambio)) + End If + + If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then params.Add(New ReportParameter("CFDIVersion", Vta.Version)) If Vta.Cliente.CodigoRegimenFiscal.ToString.Length > 0 Then @@ -7915,7 +7964,7 @@ Public Class ClsPaginas Dim payload As New JObject( New JProperty("formato", Formato), New JProperty("ruta", RutaReporte), - New JProperty("UsarFormatoCompilado", false), + New JProperty("UsarFormatoCompilado", False), New JProperty("parametros", paramsArray), New JProperty("dataSource", dataSourceArray) ) diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index f74549f7e..9c23b4c77 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -22,22 +22,60 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Dim FI As Date Dim FF As Date - If context.Request("U").ToEntero > 0 Then - CveUsuario = context.Request("U").ToEntero - CveEmpresa = context.Request("E").ToEntero - FI = context.Request("start").ToDate + If context.Request("METODO") IsNot Nothing Then - FF = context.Request("end").ToDate - If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then - 'Convierte el objeto de Eventos en JSON - 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer - Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) + Select Case context.Request("METODO") + Case "servicio_domicilio" + + If context.Request("U").ToEntero > 0 Then + + CveUsuario = context.Request("U").ToEntero + CveEmpresa = context.Request("E").ToEntero + FI = context.Request("start").ToDate + FF = context.Request("end").ToDate + + If Not GetEventos(CveUsuario, CveEmpresa, FI, FF, CveOS:=-2) Then + 'Convierte el objeto de Eventos en JSON + 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer + Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) + + context.Response.Write(sJSON) + End If + + End If + + + Exit Select + Case Else + Exit Select + End Select + + + + Else + If context.Request("U").ToEntero > 0 Then + CveUsuario = context.Request("U").ToEntero + CveEmpresa = context.Request("E").ToEntero + FI = context.Request("start").ToDate + + FF = context.Request("end").ToDate + If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then + 'Convierte el objeto de Eventos en JSON + 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer + Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) + + context.Response.Write(sJSON) + End If - context.Response.Write(sJSON) End If - End If + + + + + + End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable @@ -47,14 +85,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState End Property - Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date) As Boolean + Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1) As Boolean Dim ObjEventos As New ClsOIEventos Dim ErrorEventos = False Dim CveEmpresaCRM As Integer = 0 - If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuario, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF) Then + If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuario, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF) Then If ObjEventos.DtResultados.Rows.Count > 0 Then events = New List(Of CalendarEvent) + Try For Each dr As DataRow In ObjEventos.DtResultados.Rows Dim cevent As CalendarEvent = New CalendarEvent() diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index f0da08cbc..a55268f82 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -6246,7 +6246,9 @@ }); $('input[name*=HdnOC1IVA]').each(function () { - SumaIVA += ToDouble($(this).val()); + + let tmpiva = (ToDouble($(this).val())).toFixed(2) + SumaIVA += ToDouble(tmpiva); }); $('input[name*=HdnOC1RetIVA]').each(function () { diff --git a/Empresas/1/Formatos/Factura.rdlc b/Empresas/1/Formatos/Factura.rdlc index 677f609ca..4ad240d0e 100644 --- a/Empresas/1/Formatos/Factura.rdlc +++ b/Empresas/1/Formatos/Factura.rdlc @@ -3173,8 +3173,468 @@ + + + + true + true + + + + + Tipo Operación: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CETipoOperacion.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Incoterm + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CEIncoterm.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Motivo Traslado + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CEMotivoTraslado.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Clave Pedimento + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CEClavePedimento.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Num Reg Id Trib + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CEId.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Tipo Cambio + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!CETipoCamvio.Value + + + + + + + Textbox80 + 2.73506cm + 2.46012cm + 0.36214cm + 13.59648cm + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COMPLEMENTO COMERCIO EXTERIOR + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + 16.99253cm + 0.53823cm + 3.0972cm + 19.06642cm + 47 + + = IIF( LEN(Parameters!CETipoOperacion.Value) > 0, False, True) + + + + + - 16.79496cm + 20.08973cm + + + + + + + + + + Reporte Servicios a Domicilio + + + + + + +
+
+ +
+
+
+ + Servicios a Domicilio +
+
+
+ +
+
+ + + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + diff --git a/OS/RepServicioDomicilio.aspx.vb b/OS/RepServicioDomicilio.aspx.vb new file mode 100644 index 000000000..ffb346f99 --- /dev/null +++ b/OS/RepServicioDomicilio.aspx.vb @@ -0,0 +1,272 @@ +Option Explicit On +Option Strict On + +Imports Extensiones +Imports System.Data +Imports Microsoft.Reporting.WebForms +Imports System.Web.Services + +Partial Class OS_RepServicioDomicilio + Inherits ClsPaginas + +#Region "PROPIEDADES" + + + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + + Private Property DtColor As DataTable + Get + Return DirectCast(ViewState("DtColor"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtColor") = value + End Set + End Property + Private Property Agrupador As String + Get + Return ViewState("Agrupador").ToString + End Get + + Set(value As String) + ViewState("Agrupador") = value + End Set + End Property + Private Property TCEspecifico As Double + Get + Return ViewState("TCEspecifico").ToString.ToDouble + End Get + + Set(value As Double) + ViewState("TCEspecifico") = value + End Set + End Property + Private Property TipoCambio As Integer + Get + Return ViewState("TipoCambio").ToString.ToEntero + End Get + + Set(value As Integer) + ViewState("TipoCambio") = value + End Set + End Property + + +#End Region + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + InicializaCalendar() + End If + End Sub + +#Region "CARGAS" + + Private Sub SetValues() + + + + End Sub + + + Private Sub CargaDatos() + + + End Sub + +#End Region + +#Region " FULL CALENDAR " + Private Sub InicializaCalendar() + RegistraScript("InitCalendar();") + + HdnU.Value = UsuarioActual.CveUsuario.ToString + HdnE.Value = UsuarioActual.CveEmpresa.ToString + + DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True + CargaTiposAgenda() + CheckRecurrencia.Attributes.Add("onclick", "CheckAdd(this);") + End Sub + Private Sub CargaTiposAgenda() + Dim ObjEventos As New ClsOIEventos + + If ObjEventos.GetAgendaTipo() Then + DdlAgedaTipo.DataSource = ObjEventos.DtResultados + DdlAgedaTipo.DataBind() + DdlAgedaTipo.Items.Insert(0, New ListItem("Seleccione", "-1")) + Else + Alert("Ocurrió un error al obtener los tipos de agenda. Por favor recargue la página", TipoMensaje.MsgError) + End If + + ObjEventos.Dispose() + End Sub + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + Dim ObjEventos As New ClsOIEventos + + Dim FechaInicio = TxtFechaInicioAgenda.Text.ToDateTime() + Dim FechaFin = TxtFechaFinAgenda.Text.ToDateTime() + + RegistraScript("GetView();") + + Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1" + If CheckRecurrencia.Checked Then + RecurrenciaTipo = RBLRecurrencia.SelectedValue.ToEntero + Frecuencia = TxtFrecuencia.Text.ToEntero + + 'OBTENEMOS LOS DIAS SELECCIONADOS EN LA OPCION DE RECURRENCIA POR SEMANA + Select Case RecurrenciaTipo + Case 3 + Dim StringDias = "" + For Each item As ListItem In CheckDiasSemana.Items + If item.Selected Then + If StringDias.Length > 0 Then + StringDias += "," + End If + StringDias += item.Value + End If + Next + If StringDias.Length > 0 Then + DiasSemana = StringDias + End If + End Select + + + 'If RBSinFechaFinAdd.Checked Then + ' RecurrenciaFin = "-1" + 'Else + If RBNumeroOcurrencias.Checked Then + RecurrenciaFin = TxtNumeroOcurrencias.Text + ElseIf RBFechaFin.Checked Then + RecurrenciaFin = TxtFechaFinRecurrencia.Text + Else + RecurrenciaFin = "-1" + End If + Else + If HdnCveEvento.Value.ToEntero > 0 Then + Frecuencia = -2 : DiasSemana = "-2" : Dias = -2 : Mes = -2 : RecurrenciaFin = "-2" + End If + End If + + '11/05/2018 - GASTO RECURRENTE + Dim CveTipoEvento As Integer = IIf(ChkGastoRecurrente.Checked, 10, 2).ToString().ToEntero() + Dim Importe As Double = Convert.ToDouble(IIf(ChkGastoRecurrente.Checked, TxtImporteGastoRecurrente.Text, "-1")) + + If HdnCveEvento.Value.ToEntero > 0 Then + If ObjEventos.UpdateEvento(TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, DdlAgedaTipo.SelectedValue.ToEntero, -1, FechaInicio, FechaFin, -1, "-1", HdnCveEvento.Value.ToEntero, "-1", + RecurrenciaTipo, Frecuencia, DiasSemana, Dias, Mes, RecurrenciaFin, Importe:=Importe) Then + Alert("El Evento se actualizó correctamente", TipoMensaje.MsgInformacion) + Else + Alert("Ocurrió un error al actualizar el evento", TipoMensaje.MsgAdvertencia) + End If + Else + If ObjEventos.AddEventoAgenda(DdlAgedaTipo.SelectedValue.ToEntero, TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + RecurrenciaTipo:=RecurrenciaTipo, Frecuencia:=Frecuencia, DiasSemana:=DiasSemana, Dia:=Dias, Mes:=Mes, RecurrenciaFin:=RecurrenciaFin, CveTipoEvento:=CveTipoEvento, Importe:=Importe) Then + + Alert("El Evento se guardó correctamente", TipoMensaje.MsgInformacion) + Else + Alert("Ocurrió un error al Guardar el evento", TipoMensaje.MsgAdvertencia) + End If + End If + + ObjEventos.Dispose() + RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234") + LimpiaModalAgenda() + + End Sub + Private Sub LimpiaModalAgenda() + TxtDescripcionAgenda.Text = "" + TxtAsuntoAgenda.Text = "" + DdlPrioridad.SelectedValue = "1" + TxtNumeroOcurrencias.Text = "" + TxtFechaFinRecurrencia.Text = "" + RBFechaFin.Checked = False + RBNumeroOcurrencias.Checked = False + RBLRecurrencia.SelectedValue = "1" + CheckDiasSemana.ClearSelection() + RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty) + TxtFrecuencia.Text = "1" + LblEmpresaCRM.Text = "" + End Sub + + Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs) + + Dim ObjEventos As New ClsOIEventos + RegistraScript("GetView();") + + If ObjEventos.RemoveEvento(HdnCveEvento.Value.ToEntero, UsuarioActual.CveEmpresa) Then + RegistraScript("Calendario();SetView();$('#ModalAgenda').modal('hide');", "1234") + Alert("El evento se eliminó correctamente", TipoMensaje.MsgInformacion) + Else + Alert("Ocurrió un error al eliminar el evento, por favor intente de nuevo.", TipoMensaje.MsgError) + End If + + ObjEventos.Dispose() + End Sub + + + Public Shared Function EliminaEvento(CveEvento As Integer, CveEmpresa As Integer) As String + Dim ObjEventos As New ClsOIEventos + + ObjEventos.RemoveEvento(CveEvento, CveEmpresa) + + ObjEventos.Dispose() + Return CveEvento.ToString + End Function + + + Public Shared Function ActualizaEvento(ClsEvent As CalendarEvent) As String + Dim ObjEventos As New ClsOIEventos + + Dim FechaInicio = DateTimeOffset.Parse(ClsEvent.start).DateTime + Dim FechaFin = DateTimeOffset.Parse(ClsEvent.end).DateTime + + If ObjEventos.UpdateEvento("-1", "-1", -1, -1, -1, FechaInicio, FechaFin, -1, "-1", ClsEvent.id) Then + End If + + ObjEventos.Dispose() + Return "a" + End Function + Protected Sub RBLRecurrencia_SelectedIndexChanged(sender As Object, e As EventArgs) + Select Case RBLRecurrencia.SelectedValue.ToEntero + Case 1 + LblTextoFrecuencia.Text = "Hora(s)" + TrDiasSemanaAdd.Style("display") = "none" + Case 2 + LblTextoFrecuencia.Text = "Dia(s)" + TrDiasSemanaAdd.Style("display") = "none" + Case 3 + LblTextoFrecuencia.Text = "Semana(s)" + TrDiasSemanaAdd.Style("display") = "block" + + 'Chequea los dias seleccionados en la recurrencia + For Each item As ListItem In CheckDiasSemana.Items + If HdnDiasSemanaAgendar.Value.Contains(item.Value) Then + item.Selected = True + Else + item.Selected = False + End If + Next + Case 4 + LblTextoFrecuencia.Text = "Mes(es)" + TrDiasSemanaAdd.Style("display") = "none" + Case 5 + LblTextoFrecuencia.Text = "Año(s)" + TrDiasSemanaAdd.Style("display") = "none" + Case Else + End Select + UpRecurrencia.Update() + End Sub + Protected Sub BtnActualizaAdd_Click(sender As Object, e As EventArgs) + RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty) + End Sub +#End Region + + +End Class