--Timbrado de Servicio parcial de construcción

This commit is contained in:
JPerez
2025-07-05 15:05:45 -07:00
parent 21414781c5
commit 18940adf9b
6 changed files with 169 additions and 6 deletions

View File

@@ -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 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 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 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 Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd") DataAdapter("PA_VentasAdd")
@@ -593,7 +593,7 @@ Public Class ClsVentas
.Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatusTurno .Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatusTurno
.Add("@Addenda", SqlDbType.VarChar).Value = Addenda .Add("@Addenda", SqlDbType.VarChar).Value = Addenda
.Add("@Bloqueada", SqlDbType.Bit).Value = Bloqueada .Add("@Bloqueada", SqlDbType.Bit).Value = Bloqueada
.Add("@CveVentaComplemento", SqlDbType.Bit).Value = CveVentaComplemento .Add("@CveComplementoTimbrado", SqlDbType.Int).Value = CveComplementoTimbrado
.Add("@ComplementoSAT", SqlDbType.VarChar).Value = ComplementoSAT .Add("@ComplementoSAT", SqlDbType.VarChar).Value = ComplementoSAT
End With End With
'SqlTypes.SqlDateTime.Null 'SqlTypes.SqlDateTime.Null

View File

@@ -426,6 +426,8 @@ Namespace Modelos
'required 'required
Public Property Municipio As String Public Property Municipio As String
'required 'required
Public Property CveEstado As Integer
'required
Public Property Estado As String Public Property Estado As String
'required 'required
Public Property CodigoPostal As String Public Property CodigoPostal As String
@@ -8034,6 +8036,7 @@ Namespace Modelos
Public Property DescripcionContrato As String = "" Public Property DescripcionContrato As String = ""
Public Property NumeroDescripcionContrato As String = "" Public Property NumeroDescripcionContrato As String = ""
Public Property CveComplementoTimbrado As Integer = 0 Public Property CveComplementoTimbrado As Integer = 0
Public Property ComplementoSAT As String = ""
Public Property ComplementoINE As Modelos.ComplementoINE Public Property ComplementoINE As Modelos.ComplementoINE
Public Property FordGSDB As String = "" Public Property FordGSDB As String = ""
Public Property FordASN As String = "" Public Property FordASN As String = ""

View File

@@ -9,6 +9,8 @@ Imports System.Reflection
Imports System.Xml Imports System.Xml
Imports System.Xml.Serialization Imports System.Xml.Serialization
Imports Extensiones Imports Extensiones
Imports Modelos
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq Imports Newtonsoft.Json.Linq
Imports Profact.TimbraCFDI33.Complementos Imports Profact.TimbraCFDI33.Complementos
Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte30 Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte30
@@ -993,7 +995,7 @@ Public Class Timbrado
' Retorno = If(Ret = "", True, False) ' Retorno = If(Ret = "", True, False)
Case 3 Case 3
Retorno = TimbrarFacturaProFactv40(UsuarioActual, Ventas) Retorno = TimbrarFacturaProFactV40(UsuarioActual, Ventas)
Case 4 Case 4
Dim Ret As String = TimbrarFacturaGoCFDIv40(Ventas, UsuarioActual, CvePACEspecial) Dim Ret As String = TimbrarFacturaGoCFDIv40(Ventas, UsuarioActual, CvePACEspecial)
If Ret <> "" Then MensajeErrorCFDI = Ret If Ret <> "" Then MensajeErrorCFDI = Ret
@@ -2829,6 +2831,17 @@ concep.DescripcionesEspecificas.NumeroSerie)
End If End If
#End Region #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" #Region "Genera XML"
Dim ArchivoGenerado As Boolean = False Dim ArchivoGenerado As Boolean = False
Try Try

Binary file not shown.

View File

@@ -3436,6 +3436,110 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">S. Parcial construcción</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="display: none;">
<div class="form-body">
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
NumPerLicoAut
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtNumPerLicoAut" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
Calle
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCCalle" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
No Exterior
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCNoExt" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
No Interior
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCNoInt" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
Colonia
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCColonia" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
Localidad
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCLocalidad" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
Referencia
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCReferencia" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
Municipio
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCMunicipio" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
Estado
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlSCEstado" DataTextField="NombreEstado" DataValueField="CveEstado" runat="server" CssClass="form-control input-sm select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4">
Código Postal
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtSCCP" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
@@ -8256,7 +8360,7 @@
</div> </div>
<div id="DivCancelarEgs" runat="server" visible="false"> <div id="DivCancelarEgs" runat="server" visible="false">
<h5> <h5>
<asp:CheckBox ID="ChkCancelarNC" runat="server" Checked="false"/><asp:Label ID="Label4" Text="Cancelar Nota de crédito" runat="server"></asp:Label> <asp:CheckBox ID="ChkCancelarNC" runat="server" Checked="false" /><asp:Label ID="Label4" Text="Cancelar Nota de crédito" runat="server"></asp:Label>
</h5> </h5>
</div> </div>
</div> </div>

View File

@@ -15,6 +15,7 @@ Imports Microsoft.Reporting.WebForms
Imports Modelos Imports Modelos
Imports Newtonsoft.Json.Linq Imports Newtonsoft.Json.Linq
Imports GemBox.Spreadsheet Imports GemBox.Spreadsheet
Imports Newtonsoft.Json
Partial Class Ventas Partial Class Ventas
Inherits ClsPaginas Inherits ClsPaginas
@@ -2737,6 +2738,10 @@ Partial Class Ventas
CargaDdlClientesSucursal() CargaDdlClientesSucursal()
End If 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 'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
@@ -5295,6 +5300,26 @@ Partial Class Ventas
End If 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")))) 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" 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")))) 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() HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
@@ -13498,6 +13523,25 @@ Partial Class Ventas
End If 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 End Sub
Private Sub CreaObjetosVentaDevolucion() Private Sub CreaObjetosVentaDevolucion()
@@ -14811,7 +14855,6 @@ Partial Class Ventas
End If End If
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC, 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.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, 0, factura.FechaPago, factura.Fecha, factura.MotivoDescuento, 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, 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, CveLineaAdicional:=CveLAdicional, DescripcionVenta:=DescripcionVenta,
CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir, 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.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Else Else
If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then