diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 7c11a3d3b..5cfe5cc22 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -293,7 +293,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, - Optional TipoCambio As Decimal = -1, Optional CveClasificacion As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean + Optional TipoCambio As Decimal = -1, Optional CveClasificacion As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional ImporteME As Decimal = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_PrePolizasDetalleUpdate") @@ -319,6 +319,7 @@ Public Class ClsContabilidad .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta .Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@ImporteME", SqlDbType.Money).Value = ImporteME.RoundSQL(3) End With Try diff --git a/App_Code/ClsExportaciones.vb b/App_Code/ClsExportaciones.vb index 8670c2847..ea59fddc9 100644 --- a/App_Code/ClsExportaciones.vb +++ b/App_Code/ClsExportaciones.vb @@ -120,7 +120,8 @@ Public Class ClsExportaciones End Sub #Region "EXPORTACIONES" - Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Boolean = True, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean + Public Function GetExportacion(Optional CveExportacion As Integer = -1, Optional CveEmpresa As Integer = -1, Optional EsExportacion As Boolean = True, Optional FechaInicio As Date = MinFecha, + Optional FechaFin As Date = MaxFecha, Optional CveSubProyecto As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Exp_ExportacionesRep") With SqlAdapter.SelectCommand.Parameters @@ -129,6 +130,7 @@ Public Class ClsExportaciones .Add("@EsExportacion", SqlDbType.Bit).Value = EsExportacion .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto End With Try SqlAdapter.Fill(Data) @@ -139,14 +141,16 @@ Public Class ClsExportaciones Return Retorno End Function - Public Function AddExportacion(NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, CveExportacionEstatus As Integer, - CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana As Integer, - CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String, - CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer, - CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean, EsExportacion As Boolean) As Integer + Public Function AddExportacion(CveSubProyecto As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, + CveExportacionEstatus As Integer, CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, + ClaveAduana As Integer, DescripcionContenedor As String, CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, + Sello2 As String, Sello3 As String, SCAC As String, CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, + CveDirImportador As Integer, CveDirConsignatario As Integer, CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, + ITN As String, Vinculacion As Boolean, EsExportacion As Boolean) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Exp_ExportacionesAdd") With SqlAdapter.SelectCommand.Parameters + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento .Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento .Add("@CveVenta", SqlDbType.Int).Value = CveVenta @@ -158,6 +162,7 @@ Public Class ClsExportaciones .Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario .Add("@CveAgente", SqlDbType.Int).Value = CveAgente .Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana + .Add("@DescripcionContenedor", SqlDbType.VarChar).Value = DescripcionContenedor .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte .Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor @@ -170,6 +175,7 @@ Public Class ClsExportaciones .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveDirExportador", SqlDbType.Int).Value = CveDirExportador + .Add("@CveDirImportador", SqlDbType.Int).Value = CveDirImportador .Add("@CveDirConsignatario", SqlDbType.Int).Value = CveDirConsignatario .Add("@CveIncoterm", SqlDbType.Int).Value = CveIncoterm .Add("@Notas", SqlDbType.VarChar).Value = Notas @@ -191,15 +197,17 @@ Public Class ClsExportaciones Return Retorno End Function - Public Function UpdateExportacion(CveExportacion As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, TipoExportacion As Integer, CveExportacionEstatus As Integer, - CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, CveAgente As Integer, ClaveAduana As Integer, - CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String, - CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, CveDirExportador As Integer, CveDirConsignatario As Integer, - CveIncoterm As Integer, Notas As String, CvePedimento As Integer, CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Boolean + Public Function UpdateExportacion(CveExportacion As Integer, CveSubProyecto As Integer, NumeroPedimento As String, FechaPedimento As Date, CveVenta As Integer, TipoCambio As Decimal, + TipoExportacion As Integer, CveExportacionEstatus As Integer, CveClienteExportador As Integer, CveClienteImportador As Integer, CveClienteConsignatario As Integer, + CveAgente As Integer, ClaveAduana As Integer, DescripcionContenedor As String, CveProveedor As Integer, MedioTransporte As Integer, TipoContenedor As Integer, + Sello1 As String, Sello2 As String, Sello3 As String, SCAC As String, CAAT As String, ContenedorPlaca As String, CveEmpresa As Integer, CveUsuario As Integer, + CveDirExportador As Integer, CveDirImportador As Integer, CveDirConsignatario As Integer, CveIncoterm As Integer, Notas As String, CvePedimento As Integer, + CveAgenteExtranjero As Integer, ITN As String, Vinculacion As Boolean) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Exp_ExportacionesUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveExportacion", SqlDbType.Int).Value = CveExportacion + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@NumeroPedimento", SqlDbType.VarChar).Value = NumeroPedimento .Add("@FechaPedimento", SqlDbType.Date).Value = FechaPedimento .Add("@CveVenta", SqlDbType.Int).Value = CveVenta @@ -211,6 +219,7 @@ Public Class ClsExportaciones .Add("@CveClienteConsignatario", SqlDbType.Int).Value = CveClienteConsignatario .Add("@CveAgente", SqlDbType.Int).Value = CveAgente .Add("@ClaveAduana", SqlDbType.Int).Value = ClaveAduana + .Add("@DescripcionContenedor", SqlDbType.VarChar).Value = DescripcionContenedor .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@MedioTransporte", SqlDbType.Int).Value = MedioTransporte .Add("@TipoContenedor", SqlDbType.Int).Value = TipoContenedor @@ -223,6 +232,7 @@ Public Class ClsExportaciones .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveDirExportador", SqlDbType.Int).Value = CveDirExportador + .Add("@CveDirImportador", SqlDbType.Int).Value = CveDirImportador .Add("@CveDirConsignatario", SqlDbType.Int).Value = CveDirConsignatario .Add("@CveIncoterm", SqlDbType.Int).Value = CveIncoterm .Add("@Notas", SqlDbType.VarChar).Value = Notas diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 65e819be0..e55dcc59d 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -7641,6 +7641,28 @@ Public Class ClsPaginas Return Nothing End If + 'SOLO FORMATO DE STIMULSOFT Y COMPLEMENTO DE SERVICIOS DE CONSTRUCCION + If UsuarioActual.Empresa.Funcionalidad(707) = "1" AndAlso Vta.CveComplementoTimbrado = 9 AndAlso Not String.IsNullOrEmpty(Vta.ComplementoSAT) Then + Dim settings As New JsonSerializerSettings + settings.NullValueHandling = NullValueHandling.Ignore + Dim pc As Modelos.MParcialesConstruccion = JsonConvert.DeserializeObject(Of Modelos.MParcialesConstruccion)(Vta.ComplementoSAT, settings) + + If pc IsNot Nothing Then + params.Add(New ReportParameter("SC_NumPerLicoAut", pc.NumPerLicoAut)) + params.Add(New ReportParameter("SC_Calle", pc.Calle)) + params.Add(New ReportParameter("SC_NoExterior", pc.NoExterior)) + params.Add(New ReportParameter("SC_NoInterior", pc.NoInterior)) + params.Add(New ReportParameter("SC_Colonia", pc.Colonia)) + params.Add(New ReportParameter("SC_Localidad", pc.Localidad)) + params.Add(New ReportParameter("SC_Referencia", pc.Referencia)) + params.Add(New ReportParameter("SC_Municipio", pc.Municipio)) + Dim Estado = GlobalDTGralEstados("MEX").FiltroPrimeroValor("NombreEstado", $"CveEstado = {pc.CveEstado}") + params.Add(New ReportParameter("SC_Estado", Estado)) + params.Add(New ReportParameter("SC_CodigoEstado", pc.Estado)) + params.Add(New ReportParameter("SC_CodigoPostal", pc.CodigoPostal)) + End If + End If + If NombreArchivo = "FacturaUSA" Then Dim DtBaseTotales As DataTable = Vta.DtDeduccion.Clone() @@ -7868,7 +7890,7 @@ Public Class ClsPaginas If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) End If - Dim urlHost As String = "http://sig.adssistemas.mx:7998/" + Dim urlHost As String = "http: //sig.adssistemas.mx:7998/" 'Dim urlHost As String = "http://localhost:2202/" If EsProduccion Then urlHost = "http://192.200.113.178:6599/" diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index a22fce440..1d32535fd 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -325,6 +325,26 @@ Public Class ClsProductosServicios Return Retorno End Function + + Public Function GetPS_APIMarcasStock(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Inv_APIMarcasStockGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al consultar el stock.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function Public Function GetPSSimplificado(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 68f28fc66..8ed054aa6 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -475,7 +475,7 @@ Public Class ClsVentas Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional RequiereOS As Boolean = False, Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional EsFacturaGlobal As Boolean = False, Optional CveSATPeriodicidad As Integer = -1, Optional CveSATMes As Integer = -1, Optional SATAnio As Integer = -1, Optional CveMotivoDevolucion As Integer = -1, - Optional CveCobranzaEstatusTurno As Integer = -1, Optional Addenda As String = "", Optional Bloqueada As Boolean = False) As Boolean + Optional CveCobranzaEstatusTurno As Integer = -1, Optional Addenda As String = "", Optional Bloqueada As Boolean = False, Optional CveComplementoTimbrado As Integer = -1, Optional ComplementoSAT As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -593,6 +593,8 @@ Public Class ClsVentas .Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatusTurno .Add("@Addenda", SqlDbType.VarChar).Value = Addenda .Add("@Bloqueada", SqlDbType.Bit).Value = Bloqueada + .Add("@CveComplementoTimbrado", SqlDbType.Int).Value = CveComplementoTimbrado + .Add("@ComplementoSAT", SqlDbType.VarChar).Value = ComplementoSAT End With 'SqlTypes.SqlDateTime.Null Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index c7fe1ca9c..278a0546d 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -412,6 +412,27 @@ Namespace Modelos End Class + + Public Class MParcialesConstruccion + 'required + Public Property NumPerLicoAut As String + 'required + Public Property Calle As String + Public Property NoExterior As String = "" + Public Property NoInterior As String = "" + Public Property Colonia As String = "" + Public Property Localidad As String = "" + Public Property Referencia As String = "" + 'required + Public Property Municipio As String + 'required + Public Property CveEstado As Integer + 'required + Public Property Estado As String + 'required + Public Property CodigoPostal As String + End Class + Public Class M_REM @@ -8015,6 +8036,7 @@ Namespace Modelos Public Property DescripcionContrato As String = "" Public Property NumeroDescripcionContrato As String = "" Public Property CveComplementoTimbrado As Integer = 0 + Public Property ComplementoSAT As String = "" Public Property ComplementoINE As Modelos.ComplementoINE Public Property FordGSDB As String = "" Public Property FordASN As String = "" diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index a0df85f43..e5770fa7b 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -9,6 +9,8 @@ Imports System.Reflection Imports System.Xml Imports System.Xml.Serialization Imports Extensiones +Imports Modelos +Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Imports Profact.TimbraCFDI33.Complementos Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte30 @@ -993,7 +995,7 @@ Public Class Timbrado ' Retorno = If(Ret = "", True, False) Case 3 - Retorno = TimbrarFacturaProFactv40(UsuarioActual, Ventas) + Retorno = TimbrarFacturaProFactV40(UsuarioActual, Ventas) Case 4 Dim Ret As String = TimbrarFacturaGoCFDIv40(Ventas, UsuarioActual, CvePACEspecial) If Ret <> "" Then MensajeErrorCFDI = Ret @@ -2829,6 +2831,17 @@ concep.DescripcionesEspecificas.NumeroSerie) End If #End Region + If Ventas.CveComplementoTimbrado = 9 Then + Dim settings As New JsonSerializerSettings + settings.NullValueHandling = NullValueHandling.Ignore + + Dim pc As Modelos.MParcialesConstruccion = JsonConvert.DeserializeObject(Of MParcialesConstruccion)(Ventas.ComplementoSAT, settings) + If pc IsNot Nothing Then + cfdi.ParcialesConstruccion(pc.NumPerLicoAut) + cfdi.Inmueble(pc.Calle, pc.NoExterior, pc.NoInterior, pc.Colonia, pc.Localidad, pc.Referencia, pc.Municipio, pc.Estado, pc.CodigoPostal) + End If + End If + #Region "Genera XML" Dim ArchivoGenerado As Boolean = False Try diff --git a/Ashx/E189.ashx b/Ashx/E189.ashx new file mode 100644 index 000000000..201b808b0 --- /dev/null +++ b/Ashx/E189.ashx @@ -0,0 +1,216 @@ +<%@ WebHandler Language="VB" Class="E189" %> + +Option Strict On +Option Explicit On + +Imports System.Data +Imports System.IO +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq +Imports Extensiones + +Public Class E189 : Implements IHttpHandler, System.Web.SessionState.IRequiresSessionState + + Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable + Get + Return False + End Get + End Property + + Private ReadOnly Property CveEmpresa As Integer = 189 + Private ReadOnly Property CveUsuario As Integer = 100 + Private ReadOnly Property NombreCadena As String = "Conexion" + + Public ReadOnly Property EsProduccion As Boolean + Get + If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then + Return False + Else + Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1") + End If + End Get + End Property + + +#Region "V A L I D A - D A T O S" + Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario + Dim UsuarioActual As Usuario = Nothing + Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa) + Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena) + UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100, CveEmpresa) + If UsuarioActual IsNot Nothing Then + HttpContext.Current.Session("UsuarioSIG") = UsuarioActual + 'CreaObjetoEmpresa(UsuarioActual) + End If + ObjUsuarios.Dispose() + + Return UsuarioActual + End Function + + 'Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario) + ' Dim ObjEmpresa As New ClsSisEmpresas() + ' If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then + ' If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then + ' Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados + + ' Dim EmpresasFuncionalidades As New HybridDictionary + ' For Each Row As Data.DataRow In dttmp.Rows + ' EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString) + ' Next + ' ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades) + ' End If + + ' UsuarioActual.Empresa = ObjEmpresa.Empresa + + ' End If + ' ObjEmpresa.Dispose() + 'End Sub +#End Region + + Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest + Dim retorno As String = "" + Dim MsgLog As New StringBuilder + MsgLog.AppendLine("Inicia Petición.") + Try + Dim Metodo As String = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString()) + MsgLog.AppendLine(Metodo) + + If Metodo = "Stock" Then + context.Response.ContentType = "application/json" + retorno = ConsultaDatos(context) + End If + + context.Response.Write(retorno) + + Catch ex As Exception + context.Response.ContentType = "text/html" + MsgLog.AppendLine("Error de procesamiento:" & ex.Message) + + Dim respuesta As New AuthMessage + respuesta.ErrorMessage = New ResponseMsgError() With {.message = "La solicitud no se pudo procesar."} + respuesta.IsSuccess = False + respuesta.StatusCode = 200 + retorno = JsonConvert.SerializeObject(respuesta.ErrorMessage) + context.Response.Write(retorno) + + End Try + MsgLog.ToString.GuardaLogAD("LogE119") + End Sub + + + Private Function ConsultaDatos(ByVal context As HttpContext) As String + Dim Respuesta As New ResponseMsg + Dim RespuestaError As New ResponseMsgError + Dim TieneError As Boolean = False + + Dim productos As JArray = Nothing + + Using ObjInventario As New ClsProductosServicios + If ObjInventario.GetPS_APIMarcasStock(189) AndAlso ObjInventario.DtResultados IsNot Nothing Then + productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP()) + Else + RespuestaError.message = "no se pudo obtener los datos" + TieneError = True + End If + End Using + + If TieneError Then + context.Response.StatusCode = 200 + Return JsonConvert.SerializeObject(RespuestaError) + Else + context.Response.StatusCode = 200 + Try + Return New JObject(New JProperty("productos", productos)).ToString() + Catch ex As Exception + RespuestaError.message = "Ocurrió un error al generar la petición" + Return JsonConvert.SerializeObject(RespuestaError) + End Try + + End If + End Function + + + + Private Class ResponseMsg + Sub New() + status = "success" + End Sub + Public Property status As String + Public Property data As Object + Public Property message As String + End Class + + Private Class ResponseMsgError + Sub New() + status = "error" + End Sub + Public Property status As String + Public Property message As String + End Class + + Private Class AuthMessage + Public Property IsSuccess As Boolean + Public Property ErrorMessage As ResponseMsgError + Public Property StatusCode As Integer + End Class + + 'Private Function ActualizarExistenciasJson(Todos As Boolean) As String + ' Dim payload = New JObject() + + ' Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0 + + ' Dim DtPS As DataTable = Nothing + ' Using ObjPS As New ClsProductosServicios + ' If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then + ' DtPS = ObjPS.DtResultados.Copy() + ' End If + ' End Using + + ' If DtPS IsNot Nothing Then + ' payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS))) + ' End If + + ' Return payload.ToString() + 'End Function + + + + Private Function Parametros(Cadena As String) As Hashtable + Dim P1() As String = Cadena.Split("&"c) + Dim Tmp As String + Dim P2() As String + + Dim URLParametros As New Hashtable + + For Each Tmp In P1 + P2 = Tmp.Replace("%26%", "&").Split("="c) + URLParametros.Add(P2(0).ToString.ToUpper, P2(1)) + Next + Return URLParametros + End Function + + Private Shared Function IsValidJson(ByVal strInput As String) As Boolean + If String.IsNullOrWhiteSpace(strInput) Then + Return False + End If + + strInput = strInput.Trim() + + If (strInput.StartsWith("{") AndAlso strInput.EndsWith("}")) OrElse (strInput.StartsWith("[") AndAlso strInput.EndsWith("]")) Then + + Try + Dim obj As JToken = JToken.Parse(strInput) + Return True + Catch jex As JsonReaderException + Console.WriteLine(jex.Message) + Return False + Catch ex As Exception + Console.WriteLine(ex.ToString()) + Return False + End Try + Else + Return False + End If + End Function + +End Class \ No newline at end of file diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index 9643bbd97..6e6eed7ae 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -242,11 +242,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransaccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), DdlProveedores.SelectedText.ToString(), ImporteBanco.ToString().ToDouble(), CveMonedaPago, TCPago.ToString().ToDouble(), TxtObservaciones.Text.Trim(), "", ChkAbonoCuenta.Checked, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); - - if (CveIE > 0) { - decimal Importe; decimal ImporteMN; decimal ImporteComision; @@ -286,6 +283,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas if (tCveMoneda > 1 && gvr.DataKey("FechaDocumento").ToDate() < TxtFechaDocumento.Text.ToDate().FirstDayOfMonth()) { TC = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();//obtengo el TC del mes anterior del pago + CveConceptoContablePago = 384; } ImporteBancosMN = (Importe * TCPago).RoundSQL(); ImporteAcreedorMN = (Importe * TC).RoundSQL(); @@ -323,6 +321,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas ImporteComision = ImporteComision.RoundSQL(); AcumImporteMN += ImporteMN; + if (tCveMoneda > 1 ) { CveConceptoContablePago = 384; } + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, ImporteMN, CveConceptoContablePago, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), CveIEDevolucion: gvr.DataKey("CveIE").ToEntero(), TipoCambio: TC, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyectoPago.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de pago acreedor"; @@ -619,10 +619,9 @@ public partial class Bancos_PagoAcreedor : ClsPaginas MsgError = "No se pudo insertar concepto de bancos"; } - if (CveMoneda != 1) { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteMN, CveConceptoContablePrestamo, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, ImporteMN, 383, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) { MsgError = "No se pudo insertar concepto de acreedor"; } diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index dc51fa6f8..171ed5e81 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Contabilidad/ContabilidadElectronica.aspx.vb b/Contabilidad/ContabilidadElectronica.aspx.vb index e63a0d6b2..b20d47dcd 100644 --- a/Contabilidad/ContabilidadElectronica.aspx.vb +++ b/Contabilidad/ContabilidadElectronica.aspx.vb @@ -186,7 +186,7 @@ Partial Class Contabilidad_ContabilidadElectronica Dim Archivopfx As String = $"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.FielPFX }" Dim Clavepfx As String = UsuarioActual.Empresa.FielPassword - Dim xsltPath As String + Dim xsltPath As String = "" Select Case Opcion Case 1 xsltPath = $"{AppDomain.CurrentDomain.BaseDirectory}Temp\CatalogoCuentas_1_3.xslt" @@ -265,7 +265,7 @@ Partial Class Contabilidad_ContabilidadElectronica Dim DtCuentas As New DataTable If UsuarioActual.Empresa.TipoContabilidad = 1 Then Dim objconta As New ClsContabilidad - If objconta.GetBalanzaComprobacion(FechaI, FechaF, 1, -1, -1, -1, UsuarioActual.CveEmpresa, 0) Then + If objconta.GetBalanzaComprobacion(FechaI, FechaF, 5, -1, -1, -1, UsuarioActual.CveEmpresa, 0) Then DtCuentas = objconta.DtResultados End If objconta.Dispose() diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 2f2481421..d5d511945 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1173,33 +1173,44 @@ Partial Class ContabilidadC_RegPrePolizaS If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then If CBool(row.DataKey("Modificado")) Then contador = contador + 1 + Dim tImporteME As Decimal = 0 + If CBool(row.DataKey("EsMonedaExtranjera")) Then tImporteME = row.DataKey("ImporteME").ToDecimal Dim ImporteIE As Decimal = If(row.FCLabel("TxtCargo").Text.ToDecimal <> 0, row.FCLabel("TxtCargo").Text.ToDecimal, row.FCLabel("TxtAbono").Text.ToDecimal) - If row.DataKey("CveConceptoContable").ToEntero = 30 AndAlso ImporteIE > 0 AndAlso row.DataKey("CveIE").ToDecimal <= 0 Then - Dim ObjIE As New ClsBancos(ObjContabilidad.IniciaTransacSQL) - CveIEAgregado = ObjIE.AddBancos_IE(row.DataKey("ContadoCuenta").ToEntero, row.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, row.DataKey("ContadoNumeroFolio"), - row.DataKey("ContadoBeneficiario"), ImporteIE, CveMoneda, 0, row.DataKey("ContadoObservaciones"), "", - False, False, 0, row.DataKey("CvePrePoliza").ToEntero, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveIEAgregado < 0 Then - 'MsgError = "No se pudo registrar movimiento bancario" + If row.DataKey("CveConceptoContable").ToEntero = 30 AndAlso ImporteIE > 0 AndAlso row.DataKey("CveIE").ToDecimal <= 0 Then + Dim ObjIE As New ClsBancos(ObjContabilidad.IniciaTransacSQL) + Dim tCveMoneda As Integer = GlobalDTBancosCuentasGral(UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveMoneda", $"CveCuenta = {row.DataKey("ContadoCuenta")}").ToEntero + CveIEAgregado = ObjIE.AddBancos_IE(row.DataKey("ContadoCuenta").ToEntero, row.DataKey("ContadoTipoTransaccion").ToEntero, TxtFechaDocumento.Text.ToDate, row.DataKey("ContadoNumeroFolio"), + row.DataKey("ContadoBeneficiario"), ImporteIE, tCveMoneda, row.DataKey("TC").ToDecimal, row.DataKey("ContadoObservaciones"), "", + False, False, 0, row.DataKey("CvePrePoliza").ToEntero, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveIEAgregado < 0 Then + 'MsgError = "No se pudo registrar movimiento bancario" + OcurrioError = True + Exit For + End If + End If + If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, + -1, If(row.DataKey("Cargo").ToDecimal <> 0, False, True), + If(row.DataKey("Cargo").ToDecimal <> 0, row.DataKey("Cargo").ToDecimal, row.DataKey("Abono").ToDecimal), + CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), + CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, + CveProveedor:=row.DataKey("CveProveedor").ToEntero, + CveCompra:=row.DataKey("CveCompra").ToEntero, + CveCliente:=row.DataKey("CveCliente").ToEntero, + CveVenta:=row.DataKey("CveVenta").ToEntero, + CveClasificacion:=row.DataKey("CveClasificacion").ToEntero, + CvePersonal:=row.DataKey("CvePersonal").ToEntero, + Referencia:=row.FCLiteral("TxtRef").Text, + TipoCambio:=row.DataKey("TC").ToDecimal, + CveActivoFijo:=row.DataKey("CveActivoFijo").ToEntero, + CveCuenta:=row.DataKey("CveCuenta").ToEntero, + ImporteME:=tImporteME, + CveUsuarioModifico:=UsuarioActual.CveUsuario, CveIE:=CveIEAgregado) Then OcurrioError = True Exit For End If End If - If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, - -1, If(row.DataKey("Cargo").ToDecimal <> 0, False, True), - If(row.DataKey("Cargo").ToDecimal <> 0, row.DataKey("Cargo").ToDecimal, row.DataKey("Abono").ToDecimal), - CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), - CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, - CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, CveClasificacion:=row.DataKey("CveClasificacion").ToEntero, - CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, - TipoCambio:=row.DataKey("TC").ToDecimal, CveActivoFijo:=row.DataKey("CveActivoFijo").ToEntero, - CveCuenta:=row.DataKey("CveCuenta").ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveIE:=CveIEAgregado) Then - OcurrioError = True - Exit For - End If - End If - Else + Else contador = contador + 1 Dim ImporteIE As Decimal = If(row.DataKey("Cargo").ToDecimal <> 0, row.DataKey("Cargo").ToDecimal, row.DataKey("Abono").ToDecimal) diff --git a/Contabilidad/RepBalanzaComprobacion.aspx b/Contabilidad/RepBalanzaComprobacion.aspx index 8cedf3845..616f23e5e 100644 --- a/Contabilidad/RepBalanzaComprobacion.aspx +++ b/Contabilidad/RepBalanzaComprobacion.aspx @@ -136,15 +136,10 @@ - -
- - -
- + +
" style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
@@ -153,27 +148,25 @@ + runat="server" GridLines="None" EmptyDataText="No se encontraron cuentas con los parametros establecidos." AutoGenerateColumns="False" OnRowDataBound="GvDatos_RowDataBound"> - + - + - - + - - + - + @@ -186,23 +179,23 @@
- + - +
- + - + - + - + - + @@ -218,13 +211,13 @@ - + - + - + diff --git a/Contabilidad/RepBalanzaComprobacion.aspx.vb b/Contabilidad/RepBalanzaComprobacion.aspx.vb index 59c8f5fb0..a545361c5 100644 --- a/Contabilidad/RepBalanzaComprobacion.aspx.vb +++ b/Contabilidad/RepBalanzaComprobacion.aspx.vb @@ -180,7 +180,7 @@ Partial Class Contabilidad2_RepBalanzaComprobacion RegistraScript("Enable();") End Sub - Protected Sub GvIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("CtaMayor") = "1" OrElse e.Row.DBCampo("CtaMayor") = "3" OrElse e.Row.DBCampo("CtaMayor") = "4" Then @@ -189,9 +189,11 @@ Partial Class Contabilidad2_RepBalanzaComprobacion 'Acomoda Deudor y Acreedor If e.Row.DBCampo("CveTipo") = "0" Then + 'e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left e.Row.FCLabel("LbSaldoInicial").Text = String.Format("{0} ", e.Row.DBCampo("SaldoInicial").FormatoNumero) - e.Row.FCLabel("LbSaldoInicial").Style.Remove("padding-right") - e.Row.FCLabel("LbSaldoActual").Text = " " + e.Row.FCLabel("LbSaldoInicial").Style.Add("padding-right", "65px") + e.Row.FCLabel("LbSaldoActual").Text = " " + e.Row.FCLabel("LbSaldoActual").Style.Add("padding-right", "65px") End If 'Colorea NEGATIVOS diff --git a/Export/ExpDetalle.aspx b/Export/ExpDetalle.aspx index fe76aeaae..ac4590e6d 100644 --- a/Export/ExpDetalle.aspx +++ b/Export/ExpDetalle.aspx @@ -1,27 +1,34 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ExpDetalle.aspx.cs" Inherits="Export_ExpDetalle" %> - + - + - - + + Exportación: + - +
  • Exportar PDF
  • - + - + - +
    +
    + + + + +
    @@ -64,7 +71,7 @@
    Fecha de Pedimento: -
    - - - - - - - - - - - - - - -
    +
    + + + + + + + + + + + + + + +
    @@ -154,7 +161,7 @@
    -
    +
    @@ -199,7 +206,7 @@
    -
    +
    @@ -208,6 +215,14 @@
    +
    + +
    + + + +
    +
    @@ -219,7 +234,7 @@
    - +
    @@ -252,7 +267,7 @@
    -
    +
    @@ -290,7 +305,7 @@
    -
    +
    @@ -336,11 +351,12 @@
    -
    +
    -
    - +
    + +
    @@ -389,7 +405,7 @@
    -
    +
    @@ -445,7 +461,7 @@
    -
    +
    @@ -464,7 +480,7 @@
    -
    +
    @@ -532,7 +548,7 @@
    -
    +
    @@ -612,106 +628,91 @@ - +

    - - - <%--asp:TemplateField HeaderText="Id" ItemStyle-HorizontalAlign="Left"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + + + <%--asp:TemplateField HeaderText="Id" ItemStyle-HorizontalAlign="Left"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - -   - - - - - - + + + + + + + + + + + + +
    @@ -731,115 +732,115 @@
    diff --git a/Sistemas/CatRoles.aspx b/Sistemas/CatRoles.aspx index f9b390ea6..fbf243d6d 100644 --- a/Sistemas/CatRoles.aspx +++ b/Sistemas/CatRoles.aspx @@ -4,40 +4,7 @@ - <%-- --%> +
  • diff --git a/Sistemas/CatRoles.aspx.vb b/Sistemas/CatRoles.aspx.vb index 893e8e3d3..583e90b56 100644 --- a/Sistemas/CatRoles.aspx.vb +++ b/Sistemas/CatRoles.aspx.vb @@ -4,17 +4,6 @@ Imports System.Data Partial Class CatRoles Inherits ClsPaginas - - Private Property DtRoles As DataTable - Get - Return CType(ViewState("DtRoles"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtRoles") = value - End Set - End Property - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then 'LnkCerrar.Style.Add("cursor", "hand") @@ -52,7 +41,7 @@ Partial Class CatRoles Public Sub CargaDatos() Dim Rol As New ClsSisRoles If Rol.GetRoles(-1, UsuarioActual.CveEmpresa) Then - DtRoles = Rol.DtResultados + If Rol.GetRoles(-1, -1) Then GlobalDTRoles(-1) = Rol.DtResultados GvDatos.DataSource = Rol.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GvDatos.DataBind() diff --git a/Transportes/Boletos.aspx.vb b/Transportes/Boletos.aspx.vb index ef72b2980..81bfebd0d 100644 --- a/Transportes/Boletos.aspx.vb +++ b/Transportes/Boletos.aspx.vb @@ -80,6 +80,8 @@ Partial Class Boletos If Request.QueryString("CveViaje") Is Nothing And UsuarioActual.CveVendedor <> Nothing And UsuarioActual.CveVendedor <> -1 Then Response.Redirect("/Transportes/RepViajes.aspx") End If + + Permisos() AsientoSeleccionado = "" CveViaje = IfNull(Request("CveViaje"), "0").ToString.ToEntero If CveViaje > 0 Then @@ -88,7 +90,6 @@ Partial Class Boletos Alert("Viaje no definido") End If - Permisos() End If End Sub diff --git a/Ventas/CatMetasVendedores.aspx b/Ventas/CatMetasVendedores.aspx index a449a738d..77746d7e5 100644 --- a/Ventas/CatMetasVendedores.aspx +++ b/Ventas/CatMetasVendedores.aspx @@ -168,11 +168,7 @@
  • -
    -
    Marca
    -
    - -
    +
    Mes y Año
    @@ -185,6 +181,12 @@
    +
    +
    Marca
    +
    + +
    +
    Clasificación Superior
    diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb index 33e5dc539..ccec178f6 100644 --- a/Ventas/CatMetasVendedores.aspx.vb +++ b/Ventas/CatMetasVendedores.aspx.vb @@ -44,7 +44,6 @@ Partial Class CatMetasVendedores GvDatos.Columns(1).Visible = False GvDatos.Columns(2).Visible = False GvDatos.Columns(3).Visible = False - GvDatos.Columns(4).Visible = False DivLblSucursal.Visible = False DivSucursal.Visible = False @@ -109,13 +108,15 @@ Partial Class CatMetasVendedores End Sub Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click + BtnAgregarMetaVendedor.Text = "Agregar" + ResetDatosSeleccionadosModal() RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) End Sub Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click Dim CveVendedor As Integer = DdlVendedores.SelectedValue.ToEntero() - Dim Fecha As Date = MinFecha + Dim Fecha As Date = TxtFechaI.Text.ToDate() Dim CveMarca As Integer = -1 Dim CveClasificacionSuperior As Integer = -1 Dim CveClasificacion As Integer = -1 @@ -128,14 +129,13 @@ Partial Class CatMetasVendedores Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) Exit Sub End If - Fecha = TxtFechaI.Text.ToDate() CveClasificacionSuperior = DdlClasificacionSup.SelectedValue.ToEntero CveClasificacion = DdlClasificacion.SelectedValue.ToEntero CveMarca = DdlMarca.SelectedValue.ToEntero Else - If Not (DdlVendedores.SelectedValue.ToEntero > 0) Then - Alert("Falta Seleccionar el vendedor") + If Not (DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "") Then + Alert(String.Format("Falta Seleccionar {0}{1}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) Exit Sub End If End If @@ -176,12 +176,11 @@ Partial Class CatMetasVendedores BtnAgregarMetaVendedor.Text = "Actualizar" Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero - DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor") + DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor") + TxtFechaI.Text = GvRow.DataKey("MesAño") If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - TxtFechaI.Text = GvRow.DataKey("MesAño") - DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup")) DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion")) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 234f39919..6ae40680e 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -3436,6 +3436,110 @@
    +
    +
    +
    +
    +
    + + S. Parcial construcción +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    @@ -8256,7 +8360,7 @@
    - +
    diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index b726c1827..045c653a6 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -15,6 +15,7 @@ Imports Microsoft.Reporting.WebForms Imports Modelos Imports Newtonsoft.Json.Linq Imports GemBox.Spreadsheet +Imports Newtonsoft.Json Partial Class Ventas Inherits ClsPaginas @@ -2737,6 +2738,10 @@ Partial Class Ventas CargaDdlClientesSucursal() End If + DdlSCEstado.DataSource = GlobalDTGralEstados("MEX") + DdlSCEstado.DataBind() + DdlSCEstado.Items.Insert(0, New ListItem("Seleccione", "-1")) + UPComplementosSAT.Update() 'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then @@ -5295,6 +5300,26 @@ Partial Class Ventas End If HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) + + If Not String.IsNullOrEmpty(DbRowVenta("ComplementoSAT").ToString()) AndAlso DbRowVenta("CveComplementoTimbrado").ToString() = "9" Then + Dim settings As New JsonSerializerSettings + settings.NullValueHandling = NullValueHandling.Ignore + + Dim pc As Modelos.MParcialesConstruccion = JsonConvert.DeserializeObject(Of MParcialesConstruccion)(DbRowVenta("ComplementoSAT").ToString(), settings) + If pc IsNot Nothing Then + TxtNumPerLicoAut.Text = pc.NumPerLicoAut + TxtSCCalle.Text = pc.Calle + TxtSCNoInt.Text = pc.NoInterior + TxtSCNoExt.Text = pc.NoExterior + TxtSCColonia.Text = pc.Colonia + TxtSCLocalidad.Text = pc.Localidad + TxtSCReferencia.Text = pc.Referencia + TxtSCMunicipio.Text = pc.Municipio + DdlSCEstado.SelectedValueExist(pc.CveEstado) + TxtSCCP.Text = pc.CodigoPostal + End If + End If + Case "Egs" HplDownXML.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", DbRowVenta("SerieFolio"), DbRowVenta("TipoDocto")))) HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() @@ -13498,6 +13523,25 @@ Partial Class Ventas End If + If Not String.IsNullOrEmpty(TxtNumPerLicoAut.Text.Trim()) Then + Dim ObjComplemento As New Modelos.MParcialesConstruccion + ObjComplemento.NumPerLicoAut = TxtNumPerLicoAut.Text.Trim + ObjComplemento.Calle = TxtSCCalle.Text.Trim + ObjComplemento.NoInterior = TxtSCNoInt.Text.Trim + ObjComplemento.NoExterior = TxtSCNoExt.Text.Trim + ObjComplemento.Colonia = TxtSCColonia.Text.Trim + ObjComplemento.Localidad = TxtSCLocalidad.Text.Trim + ObjComplemento.Referencia = TxtSCReferencia.Text.Trim + ObjComplemento.Municipio = TxtSCMunicipio.Text.Trim + ObjComplemento.CveEstado = DdlSCEstado.SelectedValue.ToEntero() + Dim Estado = GlobalDTGralEstados("MEX").FiltroPrimeroValor("ClaveImpuestoEstado", $"CveEstado = {ObjComplemento.CveEstado}") + ObjComplemento.Estado = Estado + ObjComplemento.CodigoPostal = TxtSCCP.Text.Trim + + ObjFactura.CveComplementoTimbrado = 9 + ObjFactura.ComplementoSAT = JsonConvert.SerializeObject(ObjComplemento) + End If + End Sub Private Sub CreaObjetosVentaDevolucion() @@ -14811,7 +14855,6 @@ Partial Class Ventas End If - If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC, factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, 0, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, @@ -14830,7 +14873,7 @@ Partial Class Ventas FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible, CveLineaAdicional:=CveLAdicional, DescripcionVenta:=DescripcionVenta, CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir, - Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveMotivoDevolucion:=CveMotivoDevolucion, CveCobranzaEstatusTurno:=DdlGestionCobranza.SelectedValue.ToEntero, Addenda:=factura.Addenda, Bloqueada:=factura.Bloqueada) Then + Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text, CveMotivoDevolucion:=CveMotivoDevolucion, CveCobranzaEstatusTurno:=DdlGestionCobranza.SelectedValue.ToEntero, Addenda:=factura.Addenda, Bloqueada:=factura.Bloqueada, CveComplementoTimbrado:=factura.CveComplementoTimbrado, ComplementoSAT:=factura.ComplementoSAT) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then