diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb
index 64dd189b6..38db7e34a 100644
--- a/App_Code/ClsCompras.vb
+++ b/App_Code/ClsCompras.vb
@@ -456,7 +456,7 @@ Public Class ClsCompras
Optional AF_Medida As Integer = -1, Optional AF_TipoMantenimiento As Integer = -1, Optional Referencia As String = "", Optional OtrosGastos As Decimal = 0,
Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0,
Optional IVAPorcentaje As Decimal = 0, Optional RetIVAPorcentaje As Decimal = 0, Optional RetISRPorcentaje As Decimal = 0, Optional IEPSPSPorcentaje As Decimal = 0, Optional IEPSPSIVAPorcentaje As Decimal = 0,
- Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
+ Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, Optional CveActivoFijoCompra As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -501,6 +501,7 @@ Public Class ClsCompras
.Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
+ .Add("@CveActivoFijoCompra", SqlDbType.Int).Value = CveActivoFijoCompra
End With
Try
diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index 31fe1900e..e860e2755 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -2723,7 +2723,7 @@ Public Class ClsGenerales
.Add("@SeElimino", SqlDbType.Int).Value = SeElimino
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
- .Add("@Id_Clave", SqlDbType.VarChar, 100).Value = Id_Clave
+ .Add("@Id_Clave", SqlDbType.VarChar, 1000).Value = Id_Clave
.Add("@IdPoliza", SqlDbType.Int).Value = IdPoliza
.Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
.Add("@CveUsuarioTabla", SqlDbType.Int).Value = CveUsuarioTabla
diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb
index ae1e97b84..4019544a7 100644
--- a/App_Code/ClsNominas.vb
+++ b/App_Code/ClsNominas.vb
@@ -3121,7 +3121,7 @@ Public Class ClsNominas
End Try
Return retorno
End Function
- Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Integer
+ Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer, Optional CveIE As Integer = -1) As Integer
Dim retorno As Integer = 0
DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure)
@@ -3136,6 +3136,7 @@ Public Class ClsNominas
.Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion)
.Add("@estatus", SqlDbType.Bit).Value = (estatus)
.Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta)
+ .Add("@CveIE", SqlDbType.Int).Value = (CveIE)
.Add("@CveMovtoPermanente", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 1e17136db..3d40cef7d 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -7321,6 +7321,7 @@ Public Class ClsPaginas
Dim Importe = ""
Dim TotalLetra = ""
Dim FechaRecibo = ""
+ Dim ProveedorIntermediario As String = ""
Dim RegimenFiscalCodigo As String = ""
Dim CFDIVersion As String = If(UsuarioActual.Empresa.Funcionalidad(350) = "1", "4.0", "3.3")
@@ -7385,6 +7386,7 @@ Public Class ClsPaginas
CveCliente = ObjBancos.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero
CveMoneda = ObjBancos.DtResultados.FiltroPrimeroValor("CveMoneda").ToEntero
FechaComprobante = ObjBancos.DtResultados.FiltroPrimeroValor("Fecha").ToDate
+ ProveedorIntermediario = ObjBancos.DtResultados.FiltroPrimeroValor("ProveedorIntermediario")
SerieFolio = $"{Serie}-{Folio}"
End If
ObjBancos.Dispose()
@@ -7628,6 +7630,11 @@ Public Class ClsPaginas
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
+
+ If UsuarioActual.CveEmpresa = 145 Then
+ params.Add(New ReportParameter("ProveedorIntermediario", ProveedorIntermediario))
+ End If
+
If File.Exists($"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc") Then
rutaArchivo = $"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc"
Else
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index f62a5b548..c5f8dd4f9 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -5155,6 +5155,27 @@ Public Class ClsVentas
Return Retorno
End Function
+ Public Function GetVentasUsadosSaldosAplicar(CveVentas As String, CveCliente As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Vta_VentasUsadosSaldosAplicarGet", CommandType.StoredProcedure)
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveVenta", SqlDbType.VarChar).Value = CveVentas
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los saldos de las ventas con usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function GetVentasGarantiaPendiente(CveVenta As Integer, Fecha As DateTime, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 2b1a6aa7f..888460422 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -2676,7 +2676,10 @@ Namespace Modelos
Dim ImporteConcepto12 As Decimal = 0
Dim ImporteAcumulado91 As Decimal = 0
Dim CveUltimaVenta As Integer = 0
- If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
+ If tipoCambio > 1 Then
+ Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
+ ConceptoContable = 293
+ End If
IdCtaContable = 0
If tipoCambio = 1 Then
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
@@ -3063,11 +3066,19 @@ Namespace Modelos
If ObjFactura.DtNCVinculadas IsNot Nothing Then
For Each row2 As DataRow In ObjFactura.DtNCVinculadas.Rows
- If row2("CveConceptoContable").ToString().ToEntero = 91 Then
+ If row2("CveConceptoContable").ToString().ToEntero.Contiene(91, 294) Then
importeMovimiento = (row2("Importe").ToString().ToDecimal * ValorMultiplicador)
sumaAmorticaciones += importeMovimiento
- If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
+
+ Dim CveConceptoAplicacionNC As Integer = 91
+ Dim CveConceptoPagoNC As Integer = 251
+
+ If tipoCambio > 1 Then
+ Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
+ CveConceptoAplicacionNC = 294
+ CveConceptoPagoNC = 301
+ End If
'CTACONTABLE
'IdCtaContable = IdCtaContAnticipos
@@ -3143,7 +3154,7 @@ Namespace Modelos
End If
End If
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2("CveVenta").ToString.ToEntero, ImporteMX:=ImporteMN91, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, CveConceptoAplicacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2("CveVenta").ToString.ToEntero, ImporteMX:=ImporteMN91, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
@@ -3158,7 +3169,7 @@ Namespace Modelos
End If
End If
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(row2("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=row2("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(row2("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=row2("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then
ErrorPrepoliza = True
Exit For
End If
diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb
index 3094bb25f..4ed591cec 100644
--- a/App_Code/Timbres.vb
+++ b/App_Code/Timbres.vb
@@ -1,176 +1,176 @@
-Imports System.Data
-Imports Extensiones
-
-Public Class Timbres
- Private _MsgError As StringBuilder
- Private _MensajeAlert As StringBuilder
- Public Property TieneError As Boolean
- Public ReadOnly Property MsgError As String
- Get
- Return _MsgError.ToString
- End Get
- End Property
-
- Public ReadOnly Property MensajeAlert As String
- Get
- Return _MensajeAlert.ToString
- End Get
- End Property
-
- Private Property CveMovimiento As Integer
- Private Property UsuarioActual As Usuario
- Private Property AplicaCP As Boolean
- Private Property FechaSalida As Date
- Private Property Serie As String
- Private Property Folio As Integer
- Private Property CveTimbre As Integer
-
- Private Property CPCliente As Integer
- Public Property ObjFactura As Modelos.Factura
-
- Public Sub New()
-
- End Sub
-
- Public Sub New(TipoDocto As String, tCveTimbre As Integer, tUsuarioActual As Usuario)
- _MsgError = New StringBuilder
- UsuarioActual = tUsuarioActual
- CveTimbre = tCveTimbre
- CreaObjetosTraslados(TipoDocto, tCveTimbre)
- End Sub
-
-
- Private Sub CreaObjetosTraslados(TipoDocto As String, CveTimbre As Integer)
+Imports System.Data
+Imports Extensiones
+
+Public Class Timbres
+ Private _MsgError As StringBuilder
+ Private _MensajeAlert As StringBuilder
+ Public Property TieneError As Boolean
+ Public ReadOnly Property MsgError As String
+ Get
+ Return _MsgError.ToString
+ End Get
+ End Property
+
+ Public ReadOnly Property MensajeAlert As String
+ Get
+ Return _MensajeAlert.ToString
+ End Get
+ End Property
+
+ Private Property CveMovimiento As Integer
+ Private Property UsuarioActual As Usuario
+ Private Property AplicaCP As Boolean
+ Private Property FechaSalida As Date
+ Private Property Serie As String
+ Private Property Folio As Integer
+ Private Property CveTimbre As Integer
+
+ Private Property CPCliente As Integer
+ Public Property ObjFactura As Modelos.Factura
+
+ Public Sub New()
+
+ End Sub
+
+ Public Sub New(TipoDocto As String, tCveTimbre As Integer, tUsuarioActual As Usuario)
+ _MsgError = New StringBuilder
+ UsuarioActual = tUsuarioActual
+ CveTimbre = tCveTimbre
+ CreaObjetosTraslados(TipoDocto, tCveTimbre)
+ End Sub
+
+
+ Private Sub CreaObjetosTraslados(TipoDocto As String, CveTimbre As Integer)
ObjFactura = New Modelos.Factura
- ObjFactura.Version = "3.3"
+ ObjFactura.Version = "3.3"
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then ObjFactura.Version = "4.0"
- ObjFactura.CveUsuario = UsuarioActual.CveUsuario
- ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
- ObjFactura.UsuarioActual = UsuarioActual
- 'ObjFactura.TipoCambio = 1
- ObjFactura.ConvertirPesos = False
- ObjFactura.CveMoneda = 1
- ObjFactura.Moneda = "XXX"
- ObjFactura.MonedaSAT = "XXX"
- ObjFactura.MonedaAbreviatura = "XXX"
- ObjFactura.TipoDocto = TipoDocto
- ObjFactura.TipoComprobante = "T"
-
- ObjFactura.Fecha = Now
- ObjFactura.FechaPago = Now
- ObjFactura.FechaEjecucion = Now
- ObjFactura.UsuarioCreo = UsuarioActual.Usuario
- ObjFactura.TipoDocumento = "Traspaso"
-
-
- ObjFactura.RFCReceptor = "XAXX010101000" ' RFC empresa traslado , si es entrega RFC Cliente
-
- ObjFactura.Inv_CveMovimiento = CveMovimiento
- ObjFactura.CveTimbre = CveTimbre
-
- If CveTimbre > 0 AndAlso ObjFactura.TipoComprobante = "T" Then
-
- ObjFactura.Timbre = PreParaTimbreCartaPorte(ObjFactura)
-
- End If
-
- End Sub
-
- Private Function PreParaTimbreCartaPorte(Obj As Modelos.Factura) As CFDITimbre
- Dim Timbre As New CFDITimbre
- Timbre.Comprobante.TipoComprobante = "T"
- Timbre.Comprobante.Fecha = Obj.Fecha
- Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
- Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
- Timbre.Comprobante.SubTotal = Obj.SubTotal
- Timbre.Comprobante.Descuentos = Obj.Descuento
- Timbre.Comprobante.Moneda = "XXX"
+ ObjFactura.CveUsuario = UsuarioActual.CveUsuario
+ ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
+ ObjFactura.UsuarioActual = UsuarioActual
+ 'ObjFactura.TipoCambio = 1
+ ObjFactura.ConvertirPesos = False
+ ObjFactura.CveMoneda = 1
+ ObjFactura.Moneda = "XXX"
+ ObjFactura.MonedaSAT = "XXX"
+ ObjFactura.MonedaAbreviatura = "XXX"
+ ObjFactura.TipoDocto = TipoDocto
+ ObjFactura.TipoComprobante = "T"
+
+ ObjFactura.Fecha = Now
+ ObjFactura.FechaPago = Now
+ ObjFactura.FechaEjecucion = Now
+ ObjFactura.UsuarioCreo = UsuarioActual.Usuario
+ ObjFactura.TipoDocumento = "Traspaso"
+
+
+ ObjFactura.RFCReceptor = "XAXX010101000" ' RFC empresa traslado , si es entrega RFC Cliente
+
+ ObjFactura.Inv_CveMovimiento = CveMovimiento
+ ObjFactura.CveTimbre = CveTimbre
+
+ If CveTimbre > 0 AndAlso ObjFactura.TipoComprobante = "T" Then
+
+ ObjFactura.Timbre = PreParaTimbreCartaPorte(ObjFactura)
+
+ End If
+
+ End Sub
+
+ Private Function PreParaTimbreCartaPorte(Obj As Modelos.Factura) As CFDITimbre
+ Dim Timbre As New CFDITimbre
+ Timbre.Comprobante.TipoComprobante = "T"
+ Timbre.Comprobante.Fecha = Obj.Fecha
+ Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
+ Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
+ Timbre.Comprobante.SubTotal = Obj.SubTotal
+ Timbre.Comprobante.Descuentos = Obj.Descuento
+ Timbre.Comprobante.Moneda = "XXX"
Timbre.Comprobante.TipoCambio = "" ' CONDICIÓN SI LA MONEDA ES 'XXX'
Timbre.Receptor.UsoCFDI = "S01"
- If ObjFactura.Version = "3.3" Then Timbre.Receptor.UsoCFDI = "P01"
-
- Dim totSubTotal As Decimal = Obj.SubTotal
- Dim totIVA As Decimal = Obj.IVA
- Dim totRetIVA As Decimal = Obj.RetIVA
- Dim totRetISR As Decimal = Obj.RetISR
- Dim i As Integer = 1
-
-
- Timbre.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString
-
-
- 'DETALLES
- Dim tPS As String = ""
-
- Dim CartaPorte As New CFDICartaPorte
- CartaPorte.TranspInternac = "No"
- CartaPorte.EntradaSalidaMercancia = ""
- CartaPorte.ViaEntradaSalida = ""
-
- CartaPorte.Mercancias.UnidadPeso = "KGM"
- CartaPorte.Mercancias.CargoporTasacion = 0
-
- Dim FI As Date = New Date(1900, 1, 1)
- Dim FF As Date = New Date(9999, 1, 1)
-
- Dim FechaLlegada As DateTime
- Dim Distancia As Integer = 1
-
- Dim ObjGrales As New ClsGenerales
-
- If ObjGrales.GetGralTimbre(CveTimbre, Obj.TipoDocto, FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then
-
- If ObjGrales.DtResultados.Rows.Count = 1 Then
- Dim DtMovimientos As DataTable = Nothing
- Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
-
- Timbre.Receptor.RFC = drT("EmpresaRFC").ToString
- Timbre.Receptor.Nombre = drT("EmpresaNombre").ToString
- Timbre.Receptor.DomicilioFiscalReceptor = drT("DomicilioFiscalReceptor").ToString
- Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString
-
- CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero
- FechaSalida = drT("FechaEntrega").ToString.ToDateTime
- FechaLlegada = drT("FechaLlegada").ToString.ToDateTime
- Distancia = drT("Distancia").ToString.ToEntero
-
- ObjFactura.Folio = drT("Folio").ToString.ToEntero
- ObjFactura.Serie = drT("Serie").ToString
- Timbre.Comprobante.Serie = Obj.Serie
- Timbre.Comprobante.Folio = Obj.Folio.ToString
-
- If drT("FolioFiscalRelacionado").ToString <> "" Then
-
- Timbre.CFDIRelacionados.TipoRelacion = "05"
- Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString)
-
- End If
-
- If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then
- DtMovimientos = ObjGrales.DtResultados
- Else
- TieneError = True
- _MsgError.AppendLine("Error al obtener Movimientos")
- End If
-
- ObjFactura.DtDetalle = DtMovimientos
-
- AplicaCP = Boolean.Parse(drT("AplicaCP").ToString)
-
- ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero
-
- ObjFactura.SetSubProyecto()
- ObjFactura.SetSubProyectoMatriz()
-
- If AplicaCP Then
-
- CartaPorte.FiguraTransporte.AutoTransporte.PermisoSCT = drT("ClaveTipoPermisoSCT").ToString '"TPAF01"
- CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString
- CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString
- CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString
-
+ If ObjFactura.Version = "3.3" Then Timbre.Receptor.UsoCFDI = "P01"
+
+ Dim totSubTotal As Decimal = Obj.SubTotal
+ Dim totIVA As Decimal = Obj.IVA
+ Dim totRetIVA As Decimal = Obj.RetIVA
+ Dim totRetISR As Decimal = Obj.RetISR
+ Dim i As Integer = 1
+
+
+ Timbre.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString
+
+
+ 'DETALLES
+ Dim tPS As String = ""
+
+ Dim CartaPorte As New CFDICartaPorte
+ CartaPorte.TranspInternac = "No"
+ CartaPorte.EntradaSalidaMercancia = ""
+ CartaPorte.ViaEntradaSalida = ""
+
+ CartaPorte.Mercancias.UnidadPeso = "KGM"
+ CartaPorte.Mercancias.CargoporTasacion = 0
+
+ Dim FI As Date = New Date(1900, 1, 1)
+ Dim FF As Date = New Date(9999, 1, 1)
+
+ Dim FechaLlegada As DateTime
+ Dim Distancia As Integer = 1
+
+ Dim ObjGrales As New ClsGenerales
+
+ If ObjGrales.GetGralTimbre(CveTimbre, Obj.TipoDocto, FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then
+
+ If ObjGrales.DtResultados.Rows.Count = 1 Then
+ Dim DtMovimientos As DataTable = Nothing
+ Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
+
+ Timbre.Receptor.RFC = drT("EmpresaRFC").ToString
+ Timbre.Receptor.Nombre = drT("EmpresaNombre").ToString
+ Timbre.Receptor.DomicilioFiscalReceptor = drT("DomicilioFiscalReceptor").ToString
+ Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString
+
+ CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero
+ FechaSalida = drT("FechaEntrega").ToString.ToDateTime
+ FechaLlegada = drT("FechaLlegada").ToString.ToDateTime
+ Distancia = drT("Distancia").ToString.ToEntero
+
+ ObjFactura.Folio = drT("Folio").ToString.ToEntero
+ ObjFactura.Serie = drT("Serie").ToString
+ Timbre.Comprobante.Serie = Obj.Serie
+ Timbre.Comprobante.Folio = Obj.Folio.ToString
+
+ If drT("FolioFiscalRelacionado").ToString <> "" Then
+
+ Timbre.CFDIRelacionados.TipoRelacion = "05"
+ Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString)
+
+ End If
+
+ If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then
+ DtMovimientos = ObjGrales.DtResultados
+ Else
+ TieneError = True
+ _MsgError.AppendLine("Error al obtener Movimientos")
+ End If
+
+ ObjFactura.DtDetalle = DtMovimientos
+
+ AplicaCP = Boolean.Parse(drT("AplicaCP").ToString)
+
+ ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero
+
+ ObjFactura.SetSubProyecto()
+ ObjFactura.SetSubProyectoMatriz()
+
+ If AplicaCP Then
+
+ CartaPorte.FiguraTransporte.AutoTransporte.PermisoSCT = drT("ClaveTipoPermisoSCT").ToString '"TPAF01"
+ CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString
+ CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString
+ CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString
+
If Obj.DtDetalle IsNot Nothing AndAlso Obj.DtDetalle.Rows.Count > 0 Then
If Obj.DtDetalle.MAX("ClaveMaterialPeligroso") <> "" Then
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString
@@ -178,45 +178,51 @@ Public Class Timbres
End If
End If
- CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroCarga = drT("NombreAseguradoraCarga").ToString
- CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroCarga = drT("NumPolizaSeguroCarga").ToString
- CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular = drT("ConfigCartaPorte").ToString
- CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString
- CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
-
- If drT("ClaveTipoRemolque1").ToString <> "" Then
- Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
- CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
- End If
-
- If drT("ClaveTipoRemolque2").ToString <> "" Then
- Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
- CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
- End If
-
- Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
- DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString,
- .Colonia = drT("DirOriClaveSATColonia").ToString,
- .CP = drT("DirOriCP").ToString,
- .Estado = drT("DirOriClaveSATEstado").ToString,
- .Pais = drT("DirOriClaveSATPais").ToString,
- .Municipio = drT("DIrOriClaveSATMunicipio").ToString,
- .Localidad = drT("DirOriClaveSATLocalidad").ToString}
-
- Dim DomDestino As CFDICartaPorteDomicilio = Nothing
-
-
- DomDestino = New CFDICartaPorteDomicilio With {.Calle = drT("DirDesCalle").ToString,
- .Colonia = drT("DirDesClaveSATColonia").ToString,
- .CP = drT("DirDesCP").ToString,
- .Estado = drT("DirDesClaveSATEstado").ToString,
- .Pais = drT("DirDesClaveSATPais").ToString,
- .Municipio = drT("DirDesClaveSATMunicipio").ToString,
- .Localidad = drT("DirDesClaveSATLocalidad").ToString}
-
- Dim NumRegIdTrib As String = ""
+ CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroCarga = drT("NombreAseguradoraCarga").ToString
+ CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroCarga = drT("NumPolizaSeguroCarga").ToString
+ CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular = drT("ConfigCartaPorte").ToString
+ CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString
+ CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
+
+ If drT("ClaveTipoRemolque1").ToString <> "" Then
+ Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
+ CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
+ End If
+
+ If drT("ClaveTipoRemolque2").ToString <> "" Then
+ Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
+ CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
+ End If
+
+ Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
+ DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString,
+ .Colonia = drT("DirOriClaveSATColonia").ToString,
+ .CP = drT("DirOriCP").ToString,
+ .Estado = drT("DirOriClaveSATEstado").ToString,
+ .Pais = drT("DirOriClaveSATPais").ToString,
+ .Municipio = drT("DIrOriClaveSATMunicipio").ToString,
+ .Localidad = drT("DirOriClaveSATLocalidad").ToString}
+
+ Dim DomDestino As CFDICartaPorteDomicilio = Nothing
+
+
+ DomDestino = New CFDICartaPorteDomicilio With {.Calle = drT("DirDesCalle").ToString,
+ .Colonia = drT("DirDesClaveSATColonia").ToString,
+ .CP = drT("DirDesCP").ToString,
+ .Estado = drT("DirDesClaveSATEstado").ToString,
+ .Pais = drT("DirDesClaveSATPais").ToString,
+ .Municipio = drT("DirDesClaveSATMunicipio").ToString,
+ .Localidad = drT("DirDesClaveSATLocalidad").ToString}
+
+ Dim NumRegIdTrib As String = ""
+ Dim ResidenciaFiscal As String = ""
If drT("DestinatarioRFC").ToString.Contiene("XEXX010101000") Then ' cuando es Extranjero, debe de llevar un numregidtrib
- NumRegIdTrib = "121585958"
+ ResidenciaFiscal = DomDestino.Pais
+
+ If Not String.IsNullOrEmpty(drT("COM_NumRegIdTrib").ToString()) Then
+ NumRegIdTrib = drT("COM_NumRegIdTrib").ToString()
+ End If
+
End If
Dim Ubica As New CFDICartaPorteUbicacion
@@ -231,6 +237,7 @@ Public Class Timbres
.NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString,
.Domicilio = DomDestino,
.DistanciaRecorrida = Distancia,
+ .ResidenciaFiscal = ResidenciaFiscal,
.NumRegIdTrib = NumRegIdTrib}
CartaPorte.Ubicaciones.Add(Ubica)
@@ -317,62 +324,62 @@ Public Class Timbres
'' T R A S L A D O S
'DETALLES
- If Obj.DtDetalle IsNot Nothing Then
- For Each drr As DataRow In Obj.DtDetalle.Rows
-
- If drr("PS").ToString.Length = 1 Then
- tPS = drr("Obs").ToString
- Else
- If drr("PS").ToString.Length = 0 Then
- tPS = ""
- Else
- tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
- End If
- End If
-
- 'CONDICIONANTE, ESPECIAL
- If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
-
- Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
- .Descripcion = tPS,
- .ValorUnitario = drr("PU").ToString.ToDecimal,
- .Importe = drr("TotalImporte").ToString.ToDecimal,
- .Descuento = drr("Descuento").ToString.ToDecimal,
- .Unidad = drr("UM").ToString,
- .ClaveUnidad = drr("SATClaveUM").ToString,
- .ClaveProdServ = drr("SATClaveProdServ").ToString,
- .Noidentificacion = drr("Noidentificacion").ToString,
- .CuentaPredial = "",
- .ObjetoImpuesto = "01"}
- 'VERIFICA SUMA SUBTOTALES
- If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
- concepto.Importe = totSubTotal
- End If
- totSubTotal = totSubTotal - concepto.Importe
-
- Timbre.Conceptos.Add(concepto)
- i += 1
- Next
- Else
- TieneError = True
- _MsgError.AppendLine("timbrado son detalle de productos")
- End If
-
- End If
-
- Else
- TieneError = True
- _MsgError.AppendLine("Consultar datos de timbrado")
- End If
-
- ObjGrales.Dispose()
- Else
- Timbre = Nothing
- _MsgError.AppendLine("Consultar datos de timbrado")
- End If
- Return Timbre
- End Function
-
+ If Obj.DtDetalle IsNot Nothing Then
+ For Each drr As DataRow In Obj.DtDetalle.Rows
+
+ If drr("PS").ToString.Length = 1 Then
+ tPS = drr("Obs").ToString
+ Else
+ If drr("PS").ToString.Length = 0 Then
+ tPS = ""
+ Else
+ tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
+ End If
+ End If
+
+ 'CONDICIONANTE, ESPECIAL
+ If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
+
+ Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
+ .Descripcion = tPS,
+ .ValorUnitario = drr("PU").ToString.ToDecimal,
+ .Importe = drr("TotalImporte").ToString.ToDecimal,
+ .Descuento = drr("Descuento").ToString.ToDecimal,
+ .Unidad = drr("UM").ToString,
+ .ClaveUnidad = drr("SATClaveUM").ToString,
+ .ClaveProdServ = drr("SATClaveProdServ").ToString,
+ .Noidentificacion = drr("Noidentificacion").ToString,
+ .CuentaPredial = "",
+ .ObjetoImpuesto = "01"}
+ 'VERIFICA SUMA SUBTOTALES
+ If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
+ concepto.Importe = totSubTotal
+ End If
+ totSubTotal = totSubTotal - concepto.Importe
+
+ Timbre.Conceptos.Add(concepto)
+ i += 1
+ Next
+ Else
+ TieneError = True
+ _MsgError.AppendLine("timbrado son detalle de productos")
+ End If
+
+ End If
+
+ Else
+ TieneError = True
+ _MsgError.AppendLine("Consultar datos de timbrado")
+ End If
+
+ ObjGrales.Dispose()
+ Else
+ Timbre = Nothing
+ _MsgError.AppendLine("Consultar datos de timbrado")
+ End If
+ Return Timbre
+ End Function
+
Public Class MMensajeCartaPorte
Public Property TieneError As Boolean
Public Property Mensaje As String
@@ -626,4 +633,4 @@ Public Class Timbres
End Function
-End Class
+End Class
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 28d3c6bbc..d887529d1 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -955,6 +955,11 @@ Partial Class Bancos_IE
LnkChqDevuelto.Visible = True
End If
+ If Not String.IsNullOrEmpty(ObjIE.DtResultados.Rows(0)("ProveedorIntermediario").ToString) Then
+ DivIntermediario.Visible = True
+ LtlIntermediarioTexto.Text = ObjIE.DtResultados.Rows(0)("ProveedorIntermediario").ToString
+ End If
+
'saco el tipo de transaccion
Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", ObjIE.CveTipoTransaccion)) 'Egs o Ing
If dr IsNot Nothing Then
diff --git a/Bancos/PrestamoPersonal.aspx b/Bancos/PrestamoPersonal.aspx
index 716f87abe..332b6e4ad 100644
--- a/Bancos/PrestamoPersonal.aspx
+++ b/Bancos/PrestamoPersonal.aspx
@@ -1,523 +1,587 @@
-<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="PrestamoPersonal.aspx.cs" Inherits="Bancos_PrestamoPersonal" %>
-
-
-
-
-
-
- Prestamo A Personal
-
-
-
-
-
-
-
-
-
-
-
-