diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 7aff5b396..1cfd182a5 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -2683,7 +2683,10 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza As Integer, CveConcepto As Integer, TipoMovto As Integer, IdCtaContable As Integer, Orden As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, CveProveedor As Integer, Optional CvePersonal As Integer = -1) As Boolean
+ Public Function AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza As Integer, CveConcepto As Integer, TipoMovto As Integer,
+ IdCtaContable As Integer, Orden As Integer, CveUsuario As Integer, CveEmpresa As Integer,
+ CveSubProyecto As Integer, CveProveedor As Integer, Optional CvePersonal As Integer = -1,
+ Optional PorcentajeImpuesto As Decimal = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_PlantillasPolizasDetalleAdd")
@@ -2699,6 +2702,7 @@ Public Class ClsContabilidad
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
+ .Add("@PorcentajeImpuesto", SqlDbType.SmallMoney).Value = PorcentajeImpuesto
End With
Try
@@ -2715,7 +2719,9 @@ Public Class ClsContabilidad
End Try
Return Retorno
End Function
- Public Function UpdateConta_PlantillasPolizasDetalle(CveConcepto As Integer, TipoMovto As Integer, IdCtaContable As Integer, Orden As Integer, CvePlantillaPolizaDetalle As Integer, CveSubProyecto As Integer, CveProveedor As Integer, Optional CvePersonal As Integer = -1) As Boolean
+ Public Function UpdateConta_PlantillasPolizasDetalle(CveConcepto As Integer, TipoMovto As Integer, IdCtaContable As Integer, Orden As Integer,
+ CvePlantillaPolizaDetalle As Integer, CveSubProyecto As Integer, CveProveedor As Integer,
+ Optional CvePersonal As Integer = -1, Optional PorcentajeImpuesto As Decimal = 0) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Conta_PlantillasPolizasDetalleUpdate")
@@ -2729,6 +2735,7 @@ Public Class ClsContabilidad
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
+ .Add("@PorcentajeImpuesto", SqlDbType.SmallMoney).Value = PorcentajeImpuesto
End With
Try
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 6c3cd5518..6b853e4f4 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -4006,7 +4006,7 @@ Namespace Modelos
'1 NORMAL, 2 CON PAGOS
Dim ModalidadRefacturacion As Integer = UsuarioActual.Empresa.Funcionalidad(586).ToEntero()
- If ModalidadRefacturacion <= 0 Then
+ If EsRefacturacion AndAlso ModalidadRefacturacion <= 0 Then
Retorno.Mensaje = "La factura no se puede refacturar debido a que la empresa no tiene asignada una modalidad de refacturación."
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
diff --git a/Ashx/GenerarPDFFactura.ashx b/Ashx/GenerarPDFFactura.ashx
new file mode 100644
index 000000000..bf3b15b44
--- /dev/null
+++ b/Ashx/GenerarPDFFactura.ashx
@@ -0,0 +1,281 @@
+<%@ WebHandler Language="VB" Class="GenerarPDFFactura" %>
+
+Imports System
+Imports System.Web
+Imports System.Data
+Imports Newtonsoft.Json
+Imports Newtonsoft.Json.Linq
+Imports Extensiones
+Imports System.IO
+Imports Microsoft.Reporting.WebForms
+
+Public Class GenerarPDFFactura : Implements IHttpHandler
+
+ Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
+ Get
+ Return False
+ End Get
+ End Property
+
+ Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
+ Dim retorno As String = "no se encontro la variable"
+
+ Try
+ Dim datos As ParametroWS = Nothing
+ If context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing Then
+ context.Response.ContentType = "application/json"
+ Using reader As New StreamReader(context.Request.InputStream)
+ Dim json = reader.ReadToEnd()
+ datos = JsonConvert.DeserializeObject(Of ParametroWS)(json)
+ End Using
+ End If
+
+ If datos IsNot Nothing Then
+ Dim ListaDS = New List(Of ReportDataSource)
+ Dim Parametros As New List(Of ReportParameter)
+
+ Dim Formato = context.Server.MapPath("/") + "Empresas/1/Report.rdlc"
+
+ Parametros.Add(New ReportParameter("Empresa", datos.Empresa.Empresa))
+ Parametros.Add(New ReportParameter("RFC", datos.Empresa.RFC))
+ Parametros.Add(New ReportParameter("DomicilioExpedicion", datos.Empresa.DomicilioFiscal))
+ Parametros.Add(New ReportParameter("Serie", datos.Factura.Serie))
+ Parametros.Add(New ReportParameter("Folio", datos.Factura.Folio))
+ Parametros.Add(New ReportParameter("Fecha", datos.Factura.Fecha))
+ Parametros.Add(New ReportParameter("ClienteNombre", datos.Cliente.NombreComercial))
+ Parametros.Add(New ReportParameter("ClienteDireccion", datos.Cliente.Calle + " Colonia " + datos.Cliente.Colonia + " " + datos.Cliente.Ciudad + ", " + datos.Cliente.Estado))
+ Parametros.Add(New ReportParameter("ClienteLugar", datos.Cliente.Ciudad))
+ Parametros.Add(New ReportParameter("ClienteRFC", datos.Cliente.RFC))
+ Parametros.Add(New ReportParameter("ImporteLetra", datos.Factura.Total.Texto2Letras()))
+ Parametros.Add(New ReportParameter("FormaPago", datos.Factura.FormaPago))
+ Parametros.Add(New ReportParameter("MetodoPago", datos.Factura.MetodoPago))
+ Parametros.Add(New ReportParameter("SelloCFDI", ""))
+ Parametros.Add(New ReportParameter("SelloSAT", ""))
+ Parametros.Add(New ReportParameter("CadenaOriginal", ""))
+ Parametros.Add(New ReportParameter("FolioFiscal", datos.Factura.UUID))
+ Parametros.Add(New ReportParameter("SerieCertificadoSAT", ""))
+ Parametros.Add(New ReportParameter("FechaCertificado", ""))
+ Parametros.Add(New ReportParameter("CertificadoContribuyente", ""))
+ Parametros.Add(New ReportParameter("UsoCFDI", datos.Factura.UsoCFDI))
+ Parametros.Add(New ReportParameter("Vencimiento", Now.AddDays(30)))
+ Parametros.Add(New ReportParameter("SubTotal", datos.Factura.SubTotal))
+ Parametros.Add(New ReportParameter("IVA", datos.Factura.IVA))
+ Parametros.Add(New ReportParameter("IEPS", datos.Factura.IEPS))
+ Parametros.Add(New ReportParameter("Total", datos.Factura.Total))
+ Parametros.Add(New ReportParameter("QR", ""))
+
+ Dim DtDatos As New DataTable
+ DtDatos.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
+ DtDatos.Columns.Add(New DataColumn("UnidadMedida", GetType(String)))
+ DtDatos.Columns.Add(New DataColumn("PS", GetType(String)))
+ DtDatos.Columns.Add(New DataColumn("PU", GetType(Decimal)))
+ DtDatos.Columns.Add(New DataColumn("IVA", GetType(Decimal)))
+ DtDatos.Columns.Add(New DataColumn("IEPS", GetType(Decimal)))
+ DtDatos.Columns.Add(New DataColumn("Total", GetType(Decimal)))
+
+ For Each PS In datos.Factura.ListaProductos
+ Dim Row = DtDatos.NewRow()
+ Row("Cantidad") = PS.Cantidad
+ Row("UnidadMedida") = PS.UnidadMedida
+ Row("PS") = PS.CodigoPS
+ Row("PU") = PS.PU
+ Row("IVA") = PS.IVA
+ Row("IEPS") = PS.IEPS
+ Row("Total") = (PS.Cantidad * PS.PU) + PS.IVA + PS.IEPS
+
+ DtDatos.Rows.Add(Row)
+ Next
+ ListaDS.Add(New ReportDataSource("DsProductos", DtDatos))
+
+ ImprimirbytesPDF(context, StreamPDF(context, Formato, ListaDS, Parametros), "test")
+ End If
+
+ Catch ex As Exception
+ ex.GuardaLog(ex.ToString())
+ context.Response.Write(retorno)
+ End Try
+
+ End Sub
+
+ Public Function StreamPDF(ByVal context As HttpContext, RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte()
+ 'limpio ReportViwer
+ Dim sw As New System.Diagnostics.Stopwatch()
+ sw.Start()
+
+ If IsNothing(MR) Then MR = New ReportViewer
+ Dim Bytes As Byte() = Nothing
+ Try
+ ' MasterReporteador.LocalReport.DataSources.Clear()
+ For Each RDS As ReportDataSource In DataSource
+ MR.LocalReport.DataSources.Add(RDS)
+ Next
+
+ MR.LocalReport.ReportPath = RutaReporte
+ MR.ProcessingMode = ProcessingMode.Local
+ MR.LocalReport.EnableExternalImages = True
+ MR.LocalReport.SetParameters(Parametros)
+ MR.LocalReport.Refresh()
+ Dim Warnings As Warning() = Nothing
+ Dim StreamIds As String() = Nothing
+ Dim MimeType As String = Nothing
+ Dim Encoding As String = Nothing
+ Dim Extension As String = Nothing
+ Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings)
+ Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException
+ GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
+ 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
+ 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
+ Catch ex As Exception
+ GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}")
+ 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017
+ 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}")
+ End Try
+
+ sw.Stop()
+ If sw.Elapsed.TotalSeconds > 10 Then
+ GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ")
+ End If
+
+ Return Bytes
+ End Function
+
+ Public Sub ImprimirbytesPDF(ByVal context As HttpContext, bytes As Byte(), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional Descarga As Boolean = False)
+ 'limpio ReportViwer
+ Dim mimeType As String = Nothing
+ Dim extension As String = Nothing
+
+ 'If Descarga Then
+ ' Try
+ ' bytes = bytes
+ ' File.WriteAllBytes(String.Format("{0}PDF/whatever.gif", UsuarioActual.Empresa.Ruta), img)
+ ' Catch ex As Exception
+ ' If UsuarioActual.CveRol = 1 Then
+ ' Alert(ex.Message, TipoMensaje.MsgAdvertencia)
+ ' Else
+ ' Alert("Ocurrió un error al generar la descarga. Favor de contactar a soporte tecnico cod'IMPDFclspag'", TipoMensaje.MsgAdvertencia)
+ ' End If
+ ' End Try
+ 'End If
+
+ Try
+
+ bytes = bytes
+ context.Response.Buffer = True
+ context.Response.Clear()
+ context.Response.ContentType = mimeType
+ context.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}.{1}", NombreArchivo, If(Formato = "PDF", "pdf", "xls")))
+ context.Response.BinaryWrite(bytes) ' create the file
+ context.Response.Flush() ' send it to the client to download
+ context.Response.SuppressContent = True
+ context.ApplicationInstance.CompleteRequest()
+ context.Response.End()
+
+ Catch ex As Exception
+ End Try
+ End Sub
+
+
+ Public Class FacturaWS
+ Public Property Id As Integer
+ Public Property CveVenta As Integer
+ Public Property CveCliente As Integer
+ Public Property NombreCliente As String
+ Public Property Fecha As DateTime
+ Public Property CveSubCentroCosto As Integer
+ Public Property CveTipoDocumento As Integer
+ Public Property TipoDocumento As String
+ Public Property Serie As String
+ Public Property Folio As Integer
+ Public Property CveVendedor As Integer
+ Public Property CveUsuario As Integer
+ Public Property CveEstatusVenta As Integer
+ Public Property EstatusVenta As String
+ Public Property UUID As String
+ Public Property ListaProductos As List(Of ProductoWS)
+ Public Property CveUsoCFDI As Integer
+ Public Property UsoCFDI As String
+ Public Property CveMetodoPago As Integer
+ Public Property MetodoPago As String
+ Public Property ClaveMetodoPagoSAT As String
+ Public Property CveFormaPago As Integer
+ Public Property FormaPago As String
+ Public Property ClaveFormaPagoSAT As String
+ Public Property Observaciones As String
+ Public Property CveMoneda As Integer
+ Public Property TipoCambio As Double
+ Public Property FechaIng As DateTime
+ Public Property CveEmpresa As Integer
+ Public Property SubTotal As Double
+ Public Property Descuentos As Double
+ Public Property IVA As Double
+ Public Property IEPS As Double
+ Public Property Total As Double
+ End Class
+
+ Public Class ProductoWS
+ Public Property Id As Integer
+ Public Property CveVentaDetalle As Integer
+ Public Property CveVenta As Integer
+ Public Property CveProductoServicio As Integer
+ Public Property CodigoPS As String
+ Public Property CveUnidadMedida As Integer
+ Public Property UnidadMedida As String
+ Public Property Cantidad As Double
+ Public Property Observacion As String
+ Public Property PU As Double
+ Public Property Descuento As Double
+ Public Property IVA As Double
+ Public Property IEPS As Double
+ Public Property IVAPorcentaje As Double
+ Public Property IEPSPorcentaje As Double
+ Public Property CveSubCentroCosto As Integer
+ Public Property SubCentroCosto As String
+ End Class
+
+ Public Class ClienteWS
+ Public Property Id As Integer
+ Public Property CveCliente As Integer
+ Public Property RazonSocial As String
+ Public Property NombreComercial As String
+ Public Property RFC As String
+ Public Property Codigo As String
+ Public Property Calle As String
+ Public Property NoExterior As String
+ Public Property Colonia As String
+ Public Property Ciudad As String
+ Public Property Municipio As String
+ Public Property Estado As String
+ Public Property CodigoPostal As Integer
+ Public Property Contacto As String
+ Public Property ContactoTelefono As String
+ Public Property Correo As String
+ Public Property CveVendedor As Integer
+ Public Property Estatus As Boolean
+ Public Property CveUsuario As Integer
+ Public Property CveEmpresa As Integer
+ Public Property CveRegimenFiscal As Integer
+ Public Property RegimenFiscal As String
+ Public Property CodigoRegimenFiscal As String
+ End Class
+
+ Public Class EmpresaWS
+ Public Property Id As Integer
+ Public Property CveEmpresa As Integer
+ Public Property Empresa As String
+ Public Property RFC As String
+ Public Property DomicilioFiscal As String
+ Public Property ArchivoCER As String
+ Public Property ArchivoKEY As String
+ Public Property FieldPassword As String
+ Public Property CveRegimenFiscal As Integer
+ Public Property RegimenFiscal As String
+ End Class
+
+ Public Class ParametroWS
+ Public Property Factura As FacturaWS
+ Public Property Cliente As ClienteWS
+ Public Property Empresa As EmpresaWS
+ End Class
+
+
+End Class
\ No newline at end of file
diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs
index 451c90e33..bebd16b8c 100644
--- a/Bancos/Devoluciones.aspx.cs
+++ b/Bancos/Devoluciones.aspx.cs
@@ -370,8 +370,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
// DATOS PREPOLIZA
- if ((DdlTipoTransanccion.SelectedValue == "1"))
- FolioFijo = TxtFolio.Text.ToEntero();
+ if ( DdlTipoTransanccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransanccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0)
diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs
index 874e91841..535b52b64 100644
--- a/Bancos/PagoAcreedor.aspx.cs
+++ b/Bancos/PagoAcreedor.aspx.cs
@@ -299,8 +299,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
AsignaCuentaProveedor(DdlProveedores.SelectedValue.ToEntero());
// DATOS PREPOLIZA
- if ((DdlTipoTransaccion.SelectedValue == "1"))
- FolioFijo = TxtFolio.Text.ToEntero();
+ if ( DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
+
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0)
diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs
index e2d5b27ef..0a066a52f 100644
--- a/Bancos/PagoDeudor.aspx.cs
+++ b/Bancos/PagoDeudor.aspx.cs
@@ -339,9 +339,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas
}
// DATOS PREPOLIZA
- if ((DdlTipoTransaccionPrestamo.SelectedValue == "1"))
- FolioFijo = TxtFolioPrestamo.Text.ToEntero();
- CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PRESTAMO DEUDORES", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMonedaPrestamo, TxtFechaPrestamo.Text.ToDate(), DdlProveedorPrestamo.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccionPrestamo.SelectedValue, "-1", UsuarioActual.CveEmpresa));
+ if (DdlTipoTransaccionPrestamo.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolioPrestamo.Text.ToEntero();
+ CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PRESTAMO DEUDORES", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMonedaPrestamo, TxtFechaPrestamo.Text.ToDate(), DdlProveedorPrestamo.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccionPrestamo.SelectedValue, "-1", UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0)
{
@@ -674,8 +673,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas
}
// DATOS PREPOLIZA
- if ((DdlTipoTransaccion.SelectedValue == "1"))
- FolioFijo = TxtFolio.Text.ToEntero();
+ if (DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
+
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO DEUDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0)
diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs
index 60cd167ef..fc10b964d 100644
--- a/Bancos/PrestamoPersonal.aspx.cs
+++ b/Bancos/PrestamoPersonal.aspx.cs
@@ -250,8 +250,8 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas
AsignaCuentaPersonal(DdlFuncionarioEmpleadoPago.SelectedValue.ToEntero(), CveMoneda);
// DATOS PREPOLIZA
- if ((DdlTipoTransaccion.SelectedValue == "1"))
- FolioFijo = TxtFolio.Text.ToEntero();
+ if (DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
+
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlFuncionarioEmpleadoPago.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0)
@@ -539,9 +539,9 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas
AsignaCuentaPersonal(DdlFuncionarioEmpleadoPrestamo.SelectedValue.ToEntero(), CveMoneda);
// DATOS PREPOLIZA
- if ((DdlTipoTransanccionPrestamo.SelectedValue == "1"))
- FolioFijo = TxtFolioPrestamo.Text.ToEntero();
- CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PRESTAMO PERSONAL", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMoneda, TxtFechaPrestamo.Text.ToDate(), DdlFuncionarioEmpleadoPrestamo.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa));
+ if (DdlTipoTransanccionPrestamo.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119 ) FolioFijo = TxtFolioPrestamo.Text.ToEntero();
+
+ CvePrePoliza = ObjMov.AddPrePolizas("Bancos/PRESTAMO PERSONAL", CvePlantillaPoliza, TxtImportePrestamo.Text.Trim().ToDouble(), TxtImportePrestamo.Text.Trim().ToDouble(), CveMoneda, TxtFechaPrestamo.Text.ToDate(), DdlFuncionarioEmpleadoPrestamo.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0)
{
diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx
index 59f188c36..16ad716a1 100644
--- a/Bancos/ProveedoresAbonar.aspx
+++ b/Bancos/ProveedoresAbonar.aspx
@@ -358,7 +358,7 @@
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index 7ed2ecc68..9bfc2c3e8 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -709,7 +709,7 @@ Partial Class Bancos_ProveedoresAbonar
- Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("Original").ToDecimal)
+ Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal)
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then
Valida.EsValida = 1
diff --git a/Bancos/ProveedoresCreditos.aspx.vb b/Bancos/ProveedoresCreditos.aspx.vb
index 26580af8b..145376793 100644
--- a/Bancos/ProveedoresCreditos.aspx.vb
+++ b/Bancos/ProveedoresCreditos.aspx.vb
@@ -912,7 +912,7 @@ Partial Class Bancos_ProveedoresCreditos
Dim tImporteMonedaExtranjera As Decimal = 0
If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal
'cheque
- If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = TxtFolio.Text.ToEntero
+ If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = TxtFolio.Text.ToEntero
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/ProvCred", CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, TxtPagueseA.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
diff --git a/CRM/CatEtapasProceso.aspx b/CRM/CatEtapasProceso.aspx
index 3baa490c2..7143b56a1 100644
--- a/CRM/CatEtapasProceso.aspx
+++ b/CRM/CatEtapasProceso.aspx
@@ -15,6 +15,12 @@
Agregar Etapas de Proceso
+
+ PDF
+
+
+ Excel
+
diff --git a/CRM/CatEtapasProceso.aspx.cs b/CRM/CatEtapasProceso.aspx.cs
index 6bcb487ca..64ba4adf0 100644
--- a/CRM/CatEtapasProceso.aspx.cs
+++ b/CRM/CatEtapasProceso.aspx.cs
@@ -5,6 +5,7 @@ using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
+using Microsoft.Reporting.WebForms;
using Extensiones;
@@ -317,4 +318,36 @@ public partial class CRM_CatEtapasProceso : ClsPaginas
CargaDatos(DdlFiltroProceso.SelectedValue.ToEntero());
}
#endregion
+
+ protected void LnkImprimir_Click(object sender,EventArgs e)
+ {
+ Imprimir("PDF");
+ }
+
+ protected void LnkImprimirExcel_Click(object sender, EventArgs e)
+ {
+ Imprimir("EXCEL");
+ }
+
+ private void Imprimir(string formato)
+ {
+ System.IO.FileInfo Image = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
+ string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
+
+ List param = new List();
+
+ param.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
+ if (Image.Exists)
+ {
+ param.Add(new ReportParameter("LogoPath", logouri));
+ }
+ else
+ {
+ param.Add(new ReportParameter("LogoPath", ""));
+ }
+ param.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
+ param.Add(new ReportParameter("FechaImpresion", DateTime.Today.ToString()));
+
+ ImprimirPDF("Empresas/Grales/Formatos/RepCatEtapasProceso.rdlc", TmpDT, param, "Report Cat Etapas Proceso", formato);
+ }
}
\ No newline at end of file
diff --git a/CRM/CatProbabilidadAcercamiento.aspx b/CRM/CatProbabilidadAcercamiento.aspx
index e2978bb2b..30b72d4c0 100644
--- a/CRM/CatProbabilidadAcercamiento.aspx
+++ b/CRM/CatProbabilidadAcercamiento.aspx
@@ -15,6 +15,12 @@
diff --git a/Contabilidad/PlantillasPolizasDetalle.aspx.vb b/Contabilidad/PlantillasPolizasDetalle.aspx.vb
index e778a21ea..282658576 100644
--- a/Contabilidad/PlantillasPolizasDetalle.aspx.vb
+++ b/Contabilidad/PlantillasPolizasDetalle.aspx.vb
@@ -158,6 +158,7 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
DTDetalle.Columns.Add("IdCtaContable", GetType(Integer))
DTDetalle.Columns.Add("Orden", GetType(String))
DTDetalle.Columns.Add("Usuario", GetType(String))
+ DTDetalle.Columns.Add("PorcentajeImpuesto", GetType(Decimal))
End Sub
#End Region
@@ -172,7 +173,7 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
CvePlantilla = ObjPlantillaPoliza.CvePlantillaPoliza
If DTDetalle.Rows.Count > 0 Then
For Each Row As DataRow In DTDetalle.Rows
- If Not ObjPlantillaPoliza.AddConta_PlantillasPolizasDetalles(CvePlantilla, Row("CveConcepto").ToString.ToEntero, Row("TipoMovto").ToString.ToEntero, Row("IdCtaContable").ToString.ToEntero, Row("Orden").ToString.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero) Then
+ If Not ObjPlantillaPoliza.AddConta_PlantillasPolizasDetalles(CvePlantilla, Row("CveConcepto").ToString.ToEntero, Row("TipoMovto").ToString.ToEntero, Row("IdCtaContable").ToString.ToEntero, Row("Orden").ToString.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlPorcentajeImpuesto.SelectedValue.ToDecimal) Then
ErrorPlantilla = True
Exit For
End If
@@ -228,7 +229,7 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
If HdnModalidad.Value = "I" Then
If CvePlantillaPoliza > 0 Then
- If ObjPlantillaPolizaDetalle.AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza, DdlConcepto.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, TxtOrden.Text.Trim.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero) Then
+ If ObjPlantillaPolizaDetalle.AddConta_PlantillasPolizasDetalles(CvePlantillaPoliza, DdlConcepto.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, TxtOrden.Text.Trim.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlPorcentajeImpuesto.SelectedValue.ToDecimal) Then
TxtOrden.Text = ""
updatatos()
Alert("El nuevo Registro se guardó correctamente.", TipoMensaje.MsgInformacion)
@@ -260,7 +261,7 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
If HdnID.Value.ToEntero <> -1 Then
If CvePlantillaPoliza > 0 Then
If ObjPlantillaPolizaDetalle.UpdateConta_PlantillasPolizasDetalle(DdlConcepto.SelectedValue.ToEntero, DdlTipoMovimiento.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.ToEntero, TxtOrden.Text.Trim.ToEntero,
- HdnID.Value.ToEntero, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero) Then
+ HdnID.Value.ToEntero, DDLSubProyecto.SelectedValue.ToEntero, DDLProveedor.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlPorcentajeImpuesto.SelectedValue.ToDecimal) Then
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
updatatos()
Else
@@ -352,6 +353,13 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
DdlPersonal.Visible = False
LblPersonal.Visible = False
End If
+ If DdlConcepto.SelectedValue.Contiene("19", "61") Then ' conceptos de IVA Acreditable e IVA Trasladado
+ DdlPorcentajeImpuesto.Visible = True
+ LblPorcentajeImpuesto.Visible = True
+ Else
+ DdlPorcentajeImpuesto.Visible = False
+ LblPorcentajeImpuesto.Visible = False
+ End If
End Sub
@@ -392,6 +400,15 @@ Partial Class Contabilidad_PlantillasPolizasDetalle
DdlPersonal.Visible = False
LblPersonal.Visible = False
End If
+ If DdlConcepto.SelectedValue.Contiene("19", "61") Then ' conceptos de IVA Acreditable e IVA Trasladado
+ DdlPorcentajeImpuesto.SelectedValueExist(GvRow.DataKey("PorcentajeImpuesto"))
+ DdlPorcentajeImpuesto.Visible = True
+ LblPorcentajeImpuesto.Visible = True
+ Else
+ DdlPorcentajeImpuesto.Visible = False
+ LblPorcentajeImpuesto.Visible = False
+ End If
+
UpModal.Update()
RegistraScript(String.Format("$('#{0}').modal();", "divAgregarSucursal"))
CargaDatos()
diff --git a/Contabilidad/RegPrePoliza.aspx b/Contabilidad/RegPrePoliza.aspx
index 88e35e479..691ac28d4 100644
--- a/Contabilidad/RegPrePoliza.aspx
+++ b/Contabilidad/RegPrePoliza.aspx
@@ -302,7 +302,7 @@
-
+ Cuenta
diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb
index 5b8d34dd4..06f7207db 100644
--- a/Contabilidad/RegPrePoliza.aspx.vb
+++ b/Contabilidad/RegPrePoliza.aspx.vb
@@ -296,8 +296,8 @@ Partial Class ContabilidadC_RegPrePoliza
.Add("Cuenta", Type.GetType("System.String"))
.Add("Referencia", Type.GetType("System.String"))
.Add("Concepto", Type.GetType("System.String"))
- .Add("Cargo", Type.GetType("System.Double"))
- .Add("Abono", Type.GetType("System.Double"))
+ .Add("Cargo", Type.GetType("System.Decimal"))
+ .Add("Abono", Type.GetType("System.Decimal"))
.Add("TipoMovto", Type.GetType("System.Int32"))
.Add("EsComodin", Type.GetType("System.Int32"))
.Add("CveConcepto", Type.GetType("System.Int32"))
@@ -316,7 +316,8 @@ Partial Class ContabilidadC_RegPrePoliza
.Add("IdCtaContable", Type.GetType("System.Int32"))
.Add("CveOC", Type.GetType("System.Int32"))
.Add("ConceptoContable", Type.GetType("System.String"))
- .Add("TC", Type.GetType("System.Double"))
+ .Add("TC", Type.GetType("System.Decimal"))
+ .Add("PorcentajeImpuesto", Type.GetType("System.Decimal"))
End With
End Sub
@@ -714,7 +715,8 @@ Partial Class ContabilidadC_RegPrePoliza
dr("CveProveedor") = drt("CveProveedor")
dr("CvePersonal") = drt("CvePersonal")
dr("CveClasificacion") = -1
- dr("MultipleSubProyecto") = drt("MultipleSubProyecto")
+ dr("MultipleSubProyecto") = drt("MultipleSubProyecto")
+ dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto")
DtMovimientos.Rows.Add(dr)
Next
@@ -861,6 +863,7 @@ Partial Class ContabilidadC_RegPrePoliza
Dim Importe As Double = 0
Dim TipoMovto As Boolean = False
Dim IdCtaContable As Integer = 0
+ Dim PorcentajeImpuesto As Decimal = 0
'Registra movimieno bancario
If CveConcepto = 30 Then
@@ -877,7 +880,8 @@ Partial Class ContabilidadC_RegPrePoliza
Dim CveCompra As Integer = -1
'inserto las compras que voy a pagarDdlSaldos
- For Each gvr As GridViewRow In GvMov.Rows
+ For Each gvr As GridViewRow In GvMov.Rows
+
If gvr.DataKey("IDCuenta").ToEntero > 0 Then
IdCtaContable = gvr.DataKey("IDCuenta")
End If
@@ -919,8 +923,9 @@ Partial Class ContabilidadC_RegPrePoliza
CveProveedor:=CveProveedor, CveCompra:=CveCompra,
CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero,
ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero,
- CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=If(gvr.DataKey("TC").ToString.ToDouble > 0, gvr.DataKey("TC").ToString.ToDouble, 1),
- ImporteME:=If(gvr.DataKey("TC").ToString.ToDouble > 0, (Importe / (gvr.DataKey("TC").ToString.ToDouble - 1)).RoundSQL, 0)) Then
+ CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, gvr.DataKey("TC").ToString.ToDecimal, 1),
+ ImporteME:=If(gvr.DataKey("TC").ToString.ToDecimal > 0, (Importe / (gvr.DataKey("TC").ToString.ToDecimal - 1)).RoundSQL, 0),
+ PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal) Then
Else
MsgError = "No se pudo insertar el detalle de la póliza2"
Exit For
diff --git a/Empresas/140/Formatos/Traslado.rdlc b/Empresas/140/Formatos/Traslado.rdlc
index 9cfc9c2ca..a7dbec927 100644
--- a/Empresas/140/Formatos/Traslado.rdlc
+++ b/Empresas/140/Formatos/Traslado.rdlc
@@ -540,7 +540,7 @@
- =Sum(Fields!Cantidad.Value, "DsInventarios")
+ =Sum(iif(Not Fields!Clasificacion.Value = "USADOS",CInt(Fields!Cantidad.Value),0),"DsInventarios")
- =Sum(iif(Fields!Clasificacion.Value = "USADOS",Fields!Cantidad.Value,0),"DsInventarios")
+ =Sum(iif(Fields!Clasificacion.Value = "USADOS",CInt(Fields!Cantidad.Value),0),"DsInventarios")
-
- true
- true
-
-
-
-
- =Parameters!SubProyecto.Value
-
-
-
-
-
-
- Textbox2
- 3.24566cm
- 0.00711cm
- 0.6cm
- 14.27979cm
- 6
-
-
- 2pt
- 2pt
- 2pt
- 2pt
-
- truetrue
@@ -849,7 +816,7 @@
- Origen 2:
+ Origen:
@@ -911,7 +878,7 @@
0.00711cm0.6cm14.27979cm
- 8
+ 7
@@ -930,7 +897,7 @@
0.1121cm2.53711cm4.08574cm
- 9
+ 8
diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc
index c16252ec5..ca6ada751 100644
--- a/Empresas/141/Formatos/Factura.rdlc
+++ b/Empresas/141/Formatos/Factura.rdlc
@@ -1546,7 +1546,7 @@
- FACTURA
+ =UCase(Parameters!TipoDocumento.Value)