BDH. Direccion en PDF de Ajuste
This commit is contained in:
@@ -915,12 +915,206 @@ Partial Class PopUpVerFactura
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(Path)
|
||||
'HttpContext.Current.Response.Flush()
|
||||
HttpContext.Current.Response.End()
|
||||
HttpContext.Current.Response.End()
|
||||
Else
|
||||
|
||||
End If
|
||||
Archivo = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Protected Sub LnkGenerarPDF_Click(sender As Object, e As EventArgs)
|
||||
' GeneraPDFFactura()
|
||||
'End Sub
|
||||
'Private Sub GeneraPDFFactura()
|
||||
' Try
|
||||
' Dim objFactura = CreaObjetosVenta()
|
||||
' PdfFactura(objFactura)
|
||||
' objFactura.Dispose()
|
||||
' Catch ex As Exception
|
||||
' OnError("Ocurrió un error al generar el PDF", ex)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
'Private Function CreaObjetosTraslado() As Modelos.Factura
|
||||
' Dim ObjFactura = New Modelos.Factura
|
||||
' ObjFactura.Version = "3.3"
|
||||
' ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
' ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
' ObjFactura.TipoCambio = 0
|
||||
' ObjFactura.ConvertirPesos = False
|
||||
' ObjFactura.TipoCambio = 0
|
||||
' ObjFactura.CveMoneda = 1
|
||||
' ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
|
||||
' ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", "CveMoneda = 1")
|
||||
' ObjFactura.MonedaAbreviatura = GlobalDTMonedas.FiltroPrimeroValor("Abreviatura", $"CveMoneda = {ObjFactura.CveMoneda} ")
|
||||
' ObjFactura.TipoDocto = "Tra"
|
||||
' ObjFactura.RefDocto = ""
|
||||
' ObjFactura.Folio = Folio.ToEntero
|
||||
' ObjFactura.Serie = "Tra"
|
||||
' ObjFactura.CveMesa = -1
|
||||
' ObjFactura.Fecha = Now
|
||||
' ObjFactura.CvePrePoliza = -1
|
||||
' ObjFactura.FechaPago = Now
|
||||
' ObjFactura.MotivoDescuento = ""
|
||||
' ObjFactura.Observaciones = ""
|
||||
' ObjFactura.FechaEjecucion = Now
|
||||
' ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||
' ObjFactura.CveCondicionEntrega = -1
|
||||
' ObjFactura.CondicionEntrega = ""
|
||||
' ObjFactura.NumeroCuenta = ""
|
||||
' ObjFactura.CondicionesPago = 0
|
||||
' ObjFactura.FormaPago = 0
|
||||
' ObjFactura.PedidoContrato = ""
|
||||
' ObjFactura.OrdenCompra = ""
|
||||
' ObjFactura.NumeroContrato = ""
|
||||
' ObjFactura.NumeroDescripcionContrato = ""
|
||||
' ObjFactura.DescripcionContrato = ""
|
||||
' ObjFactura.CveCorte = -1
|
||||
' ObjFactura.TipoDocumento = "Traspaso"
|
||||
' ObjFactura.Alfa1 = ""
|
||||
' ObjFactura.Alfa2 = ""
|
||||
' ObjFactura.Alfa3 = ""
|
||||
' ObjFactura.Descuento = 0
|
||||
' ObjFactura.Amortizacion = 0
|
||||
' ObjFactura.CveContrato = 0
|
||||
' ObjFactura.CveVendedor = 0
|
||||
' ObjFactura.FechaVencimiento = Now
|
||||
' ObjFactura.TipoEstatus = 0
|
||||
' ObjFactura.Det_OrdenCompra = ""
|
||||
' ObjFactura.Inv_CveEstatusEntrega = 0
|
||||
' ObjFactura.FormaPago33 = ""
|
||||
' ObjFactura.MetodoPago33 = ""
|
||||
' ObjFactura.UsoCFDI = ""
|
||||
' ObjFactura.CveClienteSucursal = 0
|
||||
' Dim CveSubProyecto As Integer = -1
|
||||
' If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows.Count > 0 Then
|
||||
' CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($"CveAlmacen = {DdlAlmacen.SelectedValue}").Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
' End If
|
||||
' ObjFactura.CveSubProyecto = CveSubProyecto
|
||||
' ObjFactura.CveSubProyectoCobranza = CveSubProyecto
|
||||
' ObjFactura.CveSubProyectoEjecucion = CveSubProyecto
|
||||
|
||||
' ObjFactura.SubTotal = 0
|
||||
' ObjFactura.Descuento = 0
|
||||
' ObjFactura.Amortizacion = 0
|
||||
' ObjFactura.IVA = 0
|
||||
' ObjFactura.RetIVA = 0
|
||||
' ObjFactura.RetISR = 0
|
||||
' ObjFactura.IEPS = 0
|
||||
' ObjFactura.Total = 0
|
||||
' ObjFactura.RFCReceptor = "XAXX010101000"
|
||||
|
||||
' Dim dt As DataTable = DtMovimientos.Copy
|
||||
|
||||
' dt.Columns.Add("TotalImporte", Type.GetType("System.Double"))
|
||||
' dt.Columns.Add("Descuento", Type.GetType("System.Double"))
|
||||
' dt.Columns.Add("UM")
|
||||
' dt.Columns.Add("SATClaveUM")
|
||||
' dt.Columns.Add("SATClaveProdServ")
|
||||
' dt.Columns.Add("Noidentificacion")
|
||||
' dt.Columns.Add("CuentaPredial")
|
||||
' dt.Columns.Add("Obs")
|
||||
' dt.Columns.Add("ImporteIVA", Type.GetType("System.Double"))
|
||||
' dt.Columns.Add("PorcentajeIVA", Type.GetType("System.Double"))
|
||||
|
||||
|
||||
' For Each Row As DataRow In dt.Rows
|
||||
' Row("TotalImporte") = Row("Total")
|
||||
' Row("Descuento") = 0
|
||||
' Row("UM") = Row("UnidadMedida")
|
||||
' Row("SATClaveUM") = Row("SATClaveUnidadMedida")
|
||||
' Row("SATClaveProdServ") = Row("SATClavePS")
|
||||
' Row("Noidentificacion") = Row("Codigo")
|
||||
' Row("CuentaPredial") = ""
|
||||
' Row("Obs") = Row("Observaciones")
|
||||
' Row("ImporteIVA") = 0
|
||||
' Row("PorcentajeIVA") = 0
|
||||
' Next
|
||||
|
||||
' 'DETALLES
|
||||
' ObjFactura.DtDetalle = dt
|
||||
|
||||
' 'SUBPROYECTO
|
||||
' ObjFactura.SetSubProyectoMatriz(Me)
|
||||
' ObjFactura.SetSubProyecto(Me)
|
||||
|
||||
' ObjFactura.Inv_CveMovimiento = Me.CveMovimiento
|
||||
|
||||
' ObjFactura.Timbre = PreParaTimbreTraslado(ObjFactura)
|
||||
|
||||
' Return ObjFactura
|
||||
'End Function
|
||||
'Private Function PreParaTimbreTraslado(Obj As Modelos.Factura) As CFDITimbre
|
||||
' Dim Timbre As New CFDITimbre
|
||||
' Timbre.Comprobante.TipoComprobante = "T"
|
||||
' Timbre.Comprobante.Folio = Obj.Folio.ToString
|
||||
' Timbre.Comprobante.Serie = Obj.Serie
|
||||
' Timbre.Comprobante.Fecha = Obj.Fecha
|
||||
' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||
' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
|
||||
' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||
' Timbre.Comprobante.Subtotal = Obj.SubTotal
|
||||
' Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||
' Timbre.Comprobante.Moneda = Obj.MonedaSAT
|
||||
' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
|
||||
' Timbre.Comprobante.Total = Obj.Total
|
||||
|
||||
' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
||||
' Timbre.Comprobante.Confirmacion = ""
|
||||
|
||||
' Timbre.Receptor.RFC = "XAXX010101000"
|
||||
' Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa
|
||||
' 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
|
||||
|
||||
' 'DETALLES
|
||||
' Dim tPS As String = ""
|
||||
|
||||
' 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 = drr("CuentaPredial").ToString}
|
||||
' 'VERIFICA SUMA SUBTOTALES
|
||||
' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
|
||||
' concepto.Importe = totSubTotalW
|
||||
' End If
|
||||
' totSubTotal = totSubTotal - concepto.Importe
|
||||
|
||||
' 'SIEMPRE ESTAMOS AGREGANDO EL IVA
|
||||
' 'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
|
||||
|
||||
' Timbre.Conceptos.Add(concepto)
|
||||
' i += 1
|
||||
' Next
|
||||
' Return Timbre
|
||||
'End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " OP = 'Vta,Fact' - IMPRIME PDF VENTAS"
|
||||
@@ -4841,7 +5035,7 @@ Partial Class PopUpVerFactura
|
||||
Nombre = DatosClienteSeleccionado("Nombre").ToString
|
||||
Ciudad = DatosClienteSeleccionado("Ciudad").ToString
|
||||
Estado = DatosClienteSeleccionado("Estado").ToString
|
||||
Direccion = DatosClienteSeleccionado("Direccion").ToString
|
||||
Direccion = String.Format("{0} {1}{2} COL. {3}", DatosClienteSeleccionado("Direccion"), DatosClienteSeleccionado("NoInt"), DatosClienteSeleccionado("NoExt"), DatosClienteSeleccionado("Colonia"))
|
||||
Telefono = DatosClienteSeleccionado("Telefono").ToString
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user