diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 6de97acfd..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, Optional CveVentaComplemento As Integer = -1, Optional ComplementoSAT As String = "") 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,7 +593,7 @@ Public Class ClsVentas .Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatusTurno .Add("@Addenda", SqlDbType.VarChar).Value = Addenda .Add("@Bloqueada", SqlDbType.Bit).Value = Bloqueada - .Add("@CveVentaComplemento", SqlDbType.Bit).Value = CveVentaComplemento + .Add("@CveComplementoTimbrado", SqlDbType.Int).Value = CveComplementoTimbrado .Add("@ComplementoSAT", SqlDbType.VarChar).Value = ComplementoSAT End With 'SqlTypes.SqlDateTime.Null diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 221a5f348..278a0546d 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -426,6 +426,8 @@ Namespace Modelos 'required Public Property Municipio As String 'required + Public Property CveEstado As Integer + 'required Public Property Estado As String 'required Public Property CodigoPostal As String @@ -8034,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/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/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 234f39919..6f798f530 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..5c8fb51c5 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")) + '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