diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb index 5a6526ea1..4899c1242 100644 --- a/App_Code/ClsContPAQi.vb +++ b/App_Code/ClsContPAQi.vb @@ -1162,6 +1162,8 @@ Public Class ClsContPAQi StrSQL.AppendLine("") StrSQL.AppendLine(" BEGIN TRY") StrSQL.AppendLine("") + StrSQL.AppendLine(" SET ARITHABORT ON; ") + StrSQL.AppendLine("") StrSQL.AppendLine(" CREATE TABLE #TablaContable (") StrSQL.AppendLine(" Id INT,") StrSQL.AppendLine(" IdPoliza INT,") diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 07ef0da67..20a20bd32 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -1171,13 +1171,14 @@ Public Class ClsContabilidad End Function - Public Function ContabilizaDesContabilizaPrePoliza(CvePrePoliza As Integer, Contabilizar As Boolean, CveEmpresa As Integer) As Boolean + Public Function ContabilizaDesContabilizaPrePoliza(CvePrePoliza As Integer, Contabilizar As Boolean, CveEmpresa As Integer, Optional Folio As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_PrePolizasContabilizarDescontabilizar") With SqlAdapter.SelectCommand.Parameters .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@Contabilizar", SqlDbType.Bit).Value = Contabilizar .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Folio", SqlDbType.Int).Value = Folio .Add("@FolioPoliza", SqlDbType.Int).Direction = ParameterDirection.Output End With Try diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 03ccd11b5..813d87af3 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -723,7 +723,8 @@ Public Class ClsMovimientos Public Function GetCxPPeriodo(CveProveedor As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveUsuarioResponsable As Integer, CveUsuarioRegistro As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer, CveSucursal As Integer, - TipoCambio As Integer, TCEspecifico As Double, FechaCorte As Date, CveUsuarioConsulta As Integer, CveTipoProveedor As Integer) As Boolean + TipoCambio As Integer, TCEspecifico As Double, FechaCorte As Date, CveUsuarioConsulta As Integer, CveTipoProveedor As Integer, + Optional TipoDocto As String = "-1", Optional CveMoneda As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_RepCxPPeriodo") With SqlAdapter.SelectCommand.Parameters @@ -740,6 +741,8 @@ Public Class ClsMovimientos .Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor + .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto + .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 73bf24f1a..3f2ff3384 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3238,6 +3238,43 @@ Public Class ClsNominas End Function #End Region #End Region + + + + Public Function GetLayoutAltaBanorte(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_LayoutAltaBanorteGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el layout de nominas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + + Public Function GetDispersionNominaBanorte(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_DispersionNominaBanorteGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el layout de nominas Banorte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index a2a007864..628310288 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -33,7 +33,7 @@ Public Class ClsOC Public Property CveIEAnticipo As Integer Public Property CveProveedorAnticipo As Integer Public Property FolioIEAnticipo As Integer - Public Property ImporteAnticipo As Double + Public Property ImporteAnticipo As Decimal Public Property FolioAdicional As String Public Property EntregaDirecta As Boolean @@ -79,16 +79,16 @@ Public Class ClsOC Public Property RFC As String Public Property LugarEntrega As String Public Property Cancelacion As String - Public Property PorcentajeIVA As Double + Public Property PorcentajeIVA As Decimal Public Property CveCliente As Integer Public Property CveVendedor As Integer Public Property PrioridadObservacion As String - Public Property SubTotal As Double - Public Property IVA As Double - Public Property RetIVA As Double - Public Property RetISR As Double - Public Property IEPS As Double - Public Property Total As Double + Public Property SubTotal As Decimal + Public Property IVA As Decimal + Public Property RetIVA As Decimal + Public Property RetISR As Decimal + Public Property IEPS As Decimal + Public Property Total As Decimal Public Property CvePresupuestoEgreso As Integer Public Property RequiereCotizacion As Boolean Public Property CveActivoFijo As Integer @@ -98,8 +98,8 @@ Public Class ClsOC Public Property SubProyecto As String Public Property UsuarioSolicito As String Public Property UsuarioAutorizo As String - Public Property Descuento As Double - Public Property Pendiente As Double + Public Property Descuento As Decimal + Public Property Pendiente As Decimal Public Property NombreCliente As String Public Property SucCalle As String Public Property SucNoExt As String @@ -274,7 +274,7 @@ Public Class ClsOC Extension = Data.Rows(0)("Extension").ToString Usuario = Data.Rows(0)("Usuario").ToString Me.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero - Me.Total = Data.Rows(0)("Total").ToString.ToDouble + Me.Total = Data.Rows(0)("Total").ToString.ToDecimal Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero @@ -416,7 +416,7 @@ Public Class ClsOC Return Retorno End Function - Public Function AddCotizacionDetalle(pCveCotizacion As Integer, pCvePS As Integer, pPrecioUnitario As Double, pCantidad As Double, pCveUM As Integer, pCantidadSurtir As Double, pFechaEntrega As String, pObservacion As String, pCveOrdenCompraDetalle As Integer) As Boolean + Public Function AddCotizacionDetalle(pCveCotizacion As Integer, pCvePS As Integer, pPrecioUnitario As Decimal, pCantidad As Decimal, pCveUM As Integer, pCantidadSurtir As Decimal, pFechaEntrega As String, pObservacion As String, pCveOrdenCompraDetalle As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_CotizacionesDetalleAdd") @@ -425,9 +425,9 @@ Public Class ClsOC .Add("@CveCotizacion", SqlDbType.Int).Value = pCveCotizacion .Add("@CvePS", SqlDbType.Int).Value = pCvePS .Add("@PU", SqlDbType.Money).Value = pPrecioUnitario - .Add("@Cantidad", SqlDbType.Float).Value = pCantidad + .Add("@Cantidad", SqlDbType.Decimal).Value = pCantidad .Add("@CveUM", SqlDbType.Int).Value = pCveUM - .Add("@CantidadSurtir", SqlDbType.Float).Value = pCantidadSurtir + .Add("@CantidadSurtir", SqlDbType.Decimal).Value = pCantidadSurtir .Add("@FechaEntrega", SqlDbType.VarChar).Value = pFechaEntrega .Add("@Observacion", SqlDbType.VarChar).Value = pObservacion .Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = pCveOrdenCompraDetalle @@ -452,14 +452,14 @@ Public Class ClsOC Return Retorno End Function - Public Function UpdateCotizacionDetalle(pCveCotizacionDetalle As Integer, pPrecioUnitario As Double, pCantidadSurtir As Double, pFechaEntrega As String, pObservacion As String) As Boolean + Public Function UpdateCotizacionDetalle(pCveCotizacionDetalle As Integer, pPrecioUnitario As Decimal, pCantidadSurtir As Decimal, pFechaEntrega As String, pObservacion As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_CotizacionesDetalleUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@PU", SqlDbType.Money).Value = pPrecioUnitario - .Add("@CantidadSurtir", SqlDbType.Float).Value = pCantidadSurtir + .Add("@CantidadSurtir", SqlDbType.Decimal).Value = pCantidadSurtir .Add("@FechaEntrega", SqlDbType.VarChar).Value = pFechaEntrega .Add("@Observacion", SqlDbType.VarChar).Value = pObservacion .Add("@CveCotizacionDetalle", SqlDbType.Int).Value = pCveCotizacionDetalle @@ -546,107 +546,6 @@ Public Class ClsOC End Function #End Region - 'Public Function GetEstatusCompra(ByVal CveEstatusCompra As Integer, ByVal EstatusCompra As String) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraGet") - ' Try - ' SqlAdapter.Fill(Data) - - ' If Data.Rows.Count = 1 Then - ' _CveEstatusCompra = Data.Rows(0)("CveEstatusCompra").ToString().ToEntero() - ' _EstatusCompra = Data.Rows(0)("EstatusCompra").ToString() - ' _Estatus = Data.Rows(0)("Estatus").ToString = "True" - ' _FechaIng = Data.Rows(0)("FechaIng").ToString().ToDate() - ' _CveUsuario = Data.Rows(0)("CveUsuario").ToString().ToEntero() - ' _NombreUsuario = Data.Rows(0)("Nombre").ToString() - ' End If - - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al obtener el Catálogo de Estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - 'Public Function AddEstatusCompra(ByVal Descripcion As String, Estatus As Boolean, ByVal CveUsuario As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraAdd") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@EstatusOrdenCompra", SqlDbType.VarChar).Value = Descripcion - ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - - ' Retorno = True - ' Catch ex As SqlException - ' If ex.Number = 2627 Then - ' Alert("La Clave o Descripción del EstatusCompra ya existe.", TipoMensaje.MsgAdvertencia) - ' Else - ' OnError("Ocurrió un error al guardar el nuevo estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End If - ' Catch ex As Exception - ' OnError("Ocurrió un error al guardar el nuevo estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - 'Public Function UpdateEstatusCompra(ByVal Descripcion As String, Estatus As Boolean, ByVal CveEstatusCompra As Integer, ByVal CveUsuario As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraUpdate") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@EstatusOrdenCompra", SqlDbType.VarChar).Value = Descripcion - ' '.Add("@pCveUsuario", SqlDbType.Int).Value = CveUsuario - ' .Add("@Estatus", SqlDbType.Bit).Value = Estatus - ' .Add("@CveEstatusOrdenCompra", SqlDbType.Int).Value = CveEstatusCompra - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - - ' Retorno = True - ' Catch ex As SqlException - ' If ex.Number = 2627 Then - ' Alert("La Clave o Descripción del Estatus de Compra ya existe.", TipoMensaje.MsgAdvertencia) - ' Else - ' OnError("Ocurrió un error al guardar los cambios en el estatus de compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End If - ' Catch ex As Exception - ' OnError("Ocurrió un error al guardar los cambios en el estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - 'Public Function RemoveEstatusCompra(ByVal CveEstatusCompra As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_OC_EstatusOrdenCompraRemove") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveEstatusOrdenCompra", SqlDbType.Int).Value = CveEstatusCompra - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al eliminar el estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - 'End Function - - #Region "O R D E N E S - D E - C O M P R A S" Public Function GetOC(ObjOrdenCompra As Modelos.OrdenCompra) As Boolean @@ -707,7 +606,7 @@ Public Class ClsOC _Folio = dr("Folio").ToString.ToEntero _CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero _FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero - _ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDouble + _ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDecimal _CveProveedorAnticipo = dr("CveProveedorAnticipo").ToString.ToEntero _CveEmpresa = dr("CveEmpresa").ToString.ToEntero _CveProyecto = dr("CveProyecto").ToString.ToEntero @@ -752,32 +651,15 @@ Public Class ClsOC Me.SucursalTelefono = If(Not IsDBNull(dr("TelefonoSucursal")), dr("TelefonoSucursal").ToString, "") ProveedorContacto = dr("ContactoNombre").ToString - PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDouble - SubTotal = dr("SubTotal").ToString.ToDouble - Descuento = dr("Descuento").ToString.ToDouble - IVA = dr("IVA").ToString.ToDouble - RetIVA = dr("RetIVA").ToString.ToDouble - RetISR = dr("RetISR").ToString.ToDouble - IEPS = dr("IEPS").ToString.ToDouble - Total = dr("Total").ToString.ToDouble - Pendiente = dr("Pendiente").ToString.ToDouble - 'If Not IsDBNull(dr("SubTotal")) Then - ' SubTotal = dr("SubTotal").ToString.ToDouble - ' If IVA <= 0 Then - ' _IVA = _SubTotal * dr("PorcentajeIVA").ToString.ToDouble - ' End If - ' _Total = _SubTotal + _IVA - _Descuento - _RetIVA - _RetISR - 'End If - - '_CveSupervisara = dr("CveSupervisara").ToString.ToEntero - '_CveAutoriza = dr("CveAutoriza").ToString.ToEntero - '_CveAutorizara = dr("CveAutorizara").ToString.ToEntero - - '_NombreSupervisa = dr("NombreSupervisa").ToString - - '_NombreAutoriza = dr("NombreAutoriza").ToString - '_FechaSupervisa = dr("FechaSupervisa").ToString.ToDate - '_FechaAutoriza = dr("FechaAutoriza").ToString.ToDate + PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal + SubTotal = dr("SubTotal").ToString.ToDecimal + Descuento = dr("Descuento").ToString.ToDecimal + IVA = dr("IVA").ToString.ToDecimal + RetIVA = dr("RetIVA").ToString.ToDecimal + RetISR = dr("RetISR").ToString.ToDecimal + IEPS = dr("IEPS").ToString.ToDecimal + Total = dr("Total").ToString.ToDecimal + Pendiente = dr("Pendiente").ToString.ToDecimal 'RequiereCotizacion = CType(dr("RequiereCotizacion"), Boolean) SubProyecto = dr("SubProyecto").ToString @@ -820,9 +702,9 @@ Public Class ClsOC pFechaEstimadaEntrega As String, pLugarEntrega As String, pCveUsuario As Integer, pCveEmpresa As Integer, pCvePresupuestoEgreso As Integer, Optional pCveProveedor As Integer = -1, Optional pCveProveedorSucursal As Integer = -1, Optional IDPoliza As Integer = -1, Optional RequiereCotizacion As Boolean = False, Optional CveUsuarioAsignado As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "", - Optional PorcentajeIVA As Double = 0.16, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, + Optional PorcentajeIVA As Decimal = 0.16, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, - Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Double = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1) As Boolean + Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraAdd") @@ -971,7 +853,7 @@ Public Class ClsOC Return Retorno End Function - Public Function UpdateOrdenCompraDetalleAjuste(CveOrdenCompra As Integer, CveOrdenCompraDetalle As Integer, Diferencia As Double, CveUsuarioModifico As Integer) As Boolean + Public Function UpdateOrdenCompraDetalleAjuste(CveOrdenCompra As Integer, CveOrdenCompraDetalle As Integer, Diferencia As Decimal, CveUsuarioModifico As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraDetalleAjusteUpdate") With SqlAdapter.SelectCommand.Parameters @@ -1028,7 +910,7 @@ Public Class ClsOC pCveProveedor As Integer, pCveOrdenCompra As Integer, pCveUsuarioModifico As Integer, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "", Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", - Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Double = 0.16) As Boolean + Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraUpdate") @@ -1266,18 +1148,18 @@ Public Class ClsOC Return Retorno End Function - Public Function AddOrdenCompraDetalle(pCveOrdenCompra As Integer, pCantidad As Double, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Double, pCveSubProyecto As Integer, pCveActivoFijo As Integer, - pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0, - Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0, - Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, - Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean + Public Function AddOrdenCompraDetalle(pCveOrdenCompra As Integer, pCantidad As Decimal, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Decimal, pCveSubProyecto As Integer, pCveActivoFijo As Integer, + pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Decimal = 0, + Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional Total As Decimal = 0, + Optional CveContratoDetalle As Integer = -1, 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 CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraDetalleAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveOrdenCompra", SqlDbType.Int).Value = pCveOrdenCompra - .Add("@Cantidad", SqlDbType.Float).Value = pCantidad - .Add("@Descuento", SqlDbType.Float).Value = Descuento + .Add("@Cantidad", SqlDbType.Decimal).Value = pCantidad + .Add("@Descuento", SqlDbType.Decimal).Value = Descuento .Add("@Importe", SqlDbType.Float).Value = pImporte .Add("@CveUnidadMedida", SqlDbType.Int).Value = pCveUnidadMedida .Add("@CvePS", SqlDbType.Int).Value = pCvePS @@ -1290,16 +1172,16 @@ Public Class ClsOC .Add("@vCveOrdenCompraDetalle", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@IEPSPS", SqlDbType.Money).Value = IEPSPS .Add("@IEPSPSIVA", SqlDbType.Money).Value = IEPSPSIVA - .Add("@IVA", SqlDbType.Float).Value = IVA - .Add("@RetIVA", SqlDbType.Float).Value = RetIVA - .Add("@RetISR", SqlDbType.Float).Value = RetISR - .Add("@Total", SqlDbType.Float).Value = Total + .Add("@IVA", SqlDbType.Decimal).Value = IVA + .Add("@RetIVA", SqlDbType.Decimal).Value = RetIVA + .Add("@RetISR", SqlDbType.Decimal).Value = RetISR + .Add("@Total", SqlDbType.Decimal).Value = Total .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle - .Add("@IVAPorcentaje", SqlDbType.Float).Value = IVAPorcentaje - .Add("@RetIVAPorcentaje", SqlDbType.Float).Value = RetIVAPorcentaje - .Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje - .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje - .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje + .Add("@IVAPorcentaje", SqlDbType.Decimal).Value = IVAPorcentaje + .Add("@RetIVAPorcentaje", SqlDbType.Decimal).Value = RetIVAPorcentaje + .Add("@RetISRPorcentaje", SqlDbType.Decimal).Value = RetISRPorcentaje + .Add("@IEPSPSPorcentaje", SqlDbType.Decimal).Value = IEPSPSPorcentaje + .Add("@IEPSPSIVAPorcentaje", SqlDbType.Decimal).Value = IEPSPSIVAPorcentaje .Add("@CveVentaDetalleCotizacion", SqlDbType.Int).Value = CveVentaDetalleCotizacion .Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle @@ -1322,11 +1204,11 @@ Public Class ClsOC Return Retorno End Function - Public Function UpdateOrdenCompraDetalle(pCantidad As Double, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Double, pCveSubProyecto As Integer, pCveActivoFijo As Integer, - pObservacion As String, pCveUsuario As Integer, pCveOrdenCompraDetalle As Integer, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0, - Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0, - Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, - Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveTipoGastoObra As Integer = -1) As Integer + Public Function UpdateOrdenCompraDetalle(pCantidad As Decimal, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Decimal, pCveSubProyecto As Integer, pCveActivoFijo As Integer, + pObservacion As String, pCveUsuario As Integer, pCveOrdenCompraDetalle As Integer, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Decimal = 0, + Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional Total As Decimal = 0, + Optional CveContratoDetalle As Integer = -1, 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 CveTipoGastoObra As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_OC_OrdenesCompraDetalleUpdate") @@ -1336,8 +1218,8 @@ Public Class ClsOC .Add("@Cantidad", SqlDbType.Float).Value = pCantidad .Add("@CveUnidadMedida", SqlDbType.Int).Value = pCveUnidadMedida .Add("@CvePS", SqlDbType.Int).Value = pCvePS - .Add("@Descuento", SqlDbType.Float).Value = Descuento - .Add("@Importe", SqlDbType.Float).Value = pImporte + .Add("@Descuento", SqlDbType.Decimal).Value = Descuento + .Add("@Importe", SqlDbType.Decimal).Value = pImporte .Add("@CveSubProyecto", SqlDbType.Int).Value = pCveSubProyecto .Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = pCveOrdenCompraDetalle .Add("@CveActivoFijo", SqlDbType.Int).Value = pCveActivoFijo @@ -1346,16 +1228,16 @@ Public Class ClsOC .Add("@CveUsuario", SqlDbType.Int).Value = pCveUsuario .Add("@IEPSPS", SqlDbType.Money).Value = IEPSPS .Add("@IEPSPSIVA", SqlDbType.Money).Value = IEPSPSIVA - .Add("@IVA", SqlDbType.Float).Value = IVA - .Add("@RetIVA", SqlDbType.Float).Value = RetIVA - .Add("@RetISR", SqlDbType.Float).Value = RetISR - .Add("@Total", SqlDbType.Float).Value = Total + .Add("@IVA", SqlDbType.Decimal).Value = IVA + .Add("@RetIVA", SqlDbType.Decimal).Value = RetIVA + .Add("@RetISR", SqlDbType.Decimal).Value = RetISR + .Add("@Total", SqlDbType.Decimal).Value = Total .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle - .Add("@IVAPorcentaje", SqlDbType.Float).Value = IVAPorcentaje - .Add("@RetIVAPorcentaje", SqlDbType.Float).Value = RetIVAPorcentaje - .Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje - .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje - .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje + .Add("@IVAPorcentaje", SqlDbType.Decimal).Value = IVAPorcentaje + .Add("@RetIVAPorcentaje", SqlDbType.Decimal).Value = RetIVAPorcentaje + .Add("@RetISRPorcentaje", SqlDbType.Decimal).Value = RetISRPorcentaje + .Add("@IEPSPSPorcentaje", SqlDbType.Decimal).Value = IEPSPSPorcentaje + .Add("@IEPSPSIVAPorcentaje", SqlDbType.Decimal).Value = IEPSPSIVAPorcentaje .Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra End With @@ -2412,7 +2294,7 @@ Public Class ClsOC Return Retorno End Function - Public Function AddSolicitudAnticipo(CveOrdenCompra As Integer, Importe As Double, CveEmpresa As Integer) As Boolean + Public Function AddSolicitudAnticipo(CveOrdenCompra As Integer, Importe As Decimal, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_SolicitudAnticipoAdd") @@ -2496,16 +2378,16 @@ Public Class ClsOC End Function #Region " OC DETALLE - SALDOS [ SURTIDO INV | VINCULADO COMP ]" - Public Function OrdenesCompraDetalleSaldosInvCompraAdd(CveOCDetalle As Integer, CveInvDetalle As Integer, CantidadSurtida As Double, CveCompraDetalle As Integer, CantidadVinculada As Double) As Boolean + Public Function OrdenesCompraDetalleSaldosInvCompraAdd(CveOCDetalle As Integer, CveInvDetalle As Integer, CantidadSurtida As Decimal, CveCompraDetalle As Integer, CantidadVinculada As Decimal) As Boolean Dim Retorno As Boolean = False DataAdapter("OC_OrdenesCompraDetalleSaldosInvCompraAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveOCDetalle", SqlDbType.Int).Value = CveOCDetalle .Add("@CveInvDetalle", SqlDbType.Int).Value = CveInvDetalle - .Add("@CantidadSurtida", SqlDbType.Float).Value = CantidadSurtida + .Add("@CantidadSurtida", SqlDbType.Decimal).Value = CantidadSurtida .Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle - .Add("@CantidadVinculada", SqlDbType.Float).Value = CantidadVinculada + .Add("@CantidadVinculada", SqlDbType.Decimal).Value = CantidadVinculada End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 4614f98e8..e89ff7969 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -7171,8 +7171,11 @@ Public Class ClsPaginas 'DATOS GENERALES + If UsuarioActual.CveEmpresa.Contiene(15) Then + params.Add(New ReportParameter("CP", UsuarioActual.Empresa.CP.ToString)) + End If + - 'params.Add(New ReportParameter("CP", UsuarioActual.Empresa.CP.ToString)) params.Add(New ReportParameter("Observaciones", Vta.Observaciones)) params.Add(New ReportParameter("CveVendedor", Vta.CveVendedor.ToString)) params.Add(New ReportParameter("Status", Vta.EstatusFactura)) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index ae57244f9..21be0f560 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -838,7 +838,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateEstatusVenta(CveVenta As Integer, CveEstatusFactura As Integer, CveEmpresa As Integer, Optional Num2 As Integer = -1) As Boolean + Public Function UpdateEstatusVenta(CveVenta As Integer, CveEstatusFactura As Integer, CveEmpresa As Integer, Optional Num2 As Integer = -1, Optional CveEstatusRefacturacion As Integer = -1, Optional CveMotivoCancelacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasEstatusUpdate") @@ -848,6 +848,8 @@ Public Class ClsVentas .Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Num2", SqlDbType.Float).Value = Num2 + .Add("@CveEstatusRefacturacion", SqlDbType.Int).Value = CveEstatusRefacturacion + .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index b49be482e..e6fbe82fd 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4845,7 +4845,8 @@ Namespace Modelos End If 'SI YA ESTA TIMBRADA, NUEVO PROCESO REFACTURACION, ASIGNA LA CANCELACION PENDIENTE - If EsRefacturacion AndAlso Me.CveEstatusFactura = 3 AndAlso CveMotivoCancelacion > 0 Then + 'EL ESTATUS REFACTURACION 4 ES PARA LAS QUE NO SE PUDIERON CANCELAR, DEBE OBLIGAR A CANCELAR ANTE EL SAT + If EsRefacturacion AndAlso Me.CveEstatusFactura = 3 AndAlso CveMotivoCancelacion > 0 AndAlso CveEstatusRefacturacion <> 4 Then CveEstatusFacturaAsignado = 23 End If diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 248704414..6a595d10c 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -761,6 +761,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim EsDistribuidor As Integer = IfNull(context.Request("esdistribuidor"), "-1").ToString.ToEntero + Dim cveclienteclasificacion = IfNull(context.Request("cveclienteclasificacion"), "-1").ToString.ToEntero + Dim usuario As Usuario = UsuarioActual(context) Dim CveEmpresa As String If IsNothing(usuario) Then @@ -772,7 +774,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'sino existe, recarga los datos If context.Application(AppNombre) Is Nothing Then Dim ObjClientes As New ClsClientes - If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then + If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1, CveClienteClasificacion:=cveclienteclasificacion) Then context.Application(AppNombre) = ObjClientes.DtResultados End If ObjClientes.Dispose() diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index 959d3de1b..028df676e 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -104,7 +104,8 @@ - + + @@ -281,9 +282,10 @@ + - + @@ -560,8 +562,8 @@ function txtSumaTntermediario(txt) { var comision2 = ToDouble($('#C_TxtComisionIntermediario').val()); if (comision2 > ValorTotalSeleccionado) { - $('#C_TxtComisionIntermediario').val(ComisionIntermediario); - alert("No es posible poner un importe superior a lo seleccionado"); + //$('#C_TxtComisionIntermediario').val(ComisionIntermediario); + //alert("No es posible poner un importe superior a lo seleccionado"); } else { saldo = ValorTotalSeleccionado - descuento + comision - comision2 - IVA; $('#C_lblValorTotal').text(FormatoNumero(saldo, 2)); @@ -653,6 +655,32 @@ ComisionIntermediario = 0; } + + + function SelectorNotas(Chk) { + + + $(`.CssSelector input[type=checkbox]`).each(function () { + + if (Chk.checked) { + + if (! $(this).prop('checked')) { + $(this).click(); + } + + + } else { + + if ($(this).prop('checked')) { + $(this).click(); + } + } + + + }); + + } + diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 4ed0fa810..60a92a6c8 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -215,6 +215,19 @@ + + +
+ + + + + +
+ + + +
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 03f75a6a1..92b0c29b6 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -843,6 +843,9 @@ Partial Class Bancos_IE DdlMotivoCancelacion.DataBind() DdlMotivoCancelacion.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + If UsuarioActual.Empresa.UsaAC Then + DvFolioACCondiciones.Visible = True + End If End If End Sub @@ -861,6 +864,8 @@ Partial Class Bancos_IE End Try + + CveIEDeposito = ObjIE.DtResultados(0)("CveIEDepositoPadre").ToString.ToEntero CuentaDepositoPadre = ObjIE.DtResultados(0)("CuentaDepositoPadre").ToString Cuenta = ObjIE.DtResultados(0)("NumCuenta").ToString @@ -4554,15 +4559,24 @@ Partial Class Bancos_IE Dim TipoMovimiento As Integer = 1 + Dim CveTipoTransaccionCancelacion As Integer = DdlTipoTransaccionCancelacion.SelectedValue.ToEntero + If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then GeneraCancelacionEnCero = False TipoMovimiento = 2 + + If DdlTipoTransaccionCancelacion.SelectedValue.ToEntero = -1 Then + CveTipoTransaccionCancelacion = 16 'Validacion manual para solo enviar el correcto + End If + End If + Dim CvePrePolizaCancelacion As Integer = 0 If Not GeneraCancelacionEnCero Then 'CANCELA IE MES ANTERIOR - CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, + CveTipoTransaccionCancelacion:=CveTipoTransaccionCancelacion) If CvePrePolizaCancelacion <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ANTERIOR" @@ -4577,7 +4591,8 @@ Partial Class Bancos_IE MensajeError = "Error al desbloquear prepoliza." Else 'CANCELA IE MES ACTUAL - CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) + CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, + CveTipoTransaccionCancelacion:=CveTipoTransaccionCancelacion) If CvePrePolizaCancelacion <= 0 Then ErrorCancelar = True MensajeError = "Error al cancelar IE MES ACTUAL" @@ -4792,7 +4807,7 @@ Partial Class Bancos_IE Else 'siempre se hace una cancelación - If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) <= 0 Then + If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2, 16) <= 0 Then ErrorCancelar = True End If diff --git a/Bancos/RepIngresosPorComprobar.aspx b/Bancos/RepIngresosPorComprobar.aspx index 3bbaeab4d..f3f6b3b13 100644 --- a/Bancos/RepIngresosPorComprobar.aspx +++ b/Bancos/RepIngresosPorComprobar.aspx @@ -32,9 +32,10 @@
  • Cliente: - + <%-- - + --%> +
  •  F.I.: diff --git a/Bancos/RepIngresosPorComprobar.aspx.vb b/Bancos/RepIngresosPorComprobar.aspx.vb index fbafecc6f..ad3c68233 100644 --- a/Bancos/RepIngresosPorComprobar.aspx.vb +++ b/Bancos/RepIngresosPorComprobar.aspx.vb @@ -27,8 +27,17 @@ Partial Class Bancos_RepIngresosPorComprobar Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then - 'DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) - 'DdlProveedores.DataBind() + + + Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + If EsWS Then + DdlClientes.setEsWebService(True) + Else + DdlClientes.setEsWebService(False) + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + DdlClientes.DataBind() + DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + End If If UsuarioActual.TienePermisoProceso(91) Then @@ -58,15 +67,16 @@ Partial Class Bancos_RepIngresosPorComprobar If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1" If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1" + Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero) - If Mov.GetIngresosPorComprobar(FechaI, FechaF, DdlClientes.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then + If Mov.GetIngresosPorComprobar(FechaI, FechaF, CveCliente, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then DtDatos = Mov.DtResultados CargaGrid("") UPDatos.Update() End If - If Mov.GetIngresosAnticiposPorComprobar(FechaI, FechaF, DdlClientes.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then + If Mov.GetIngresosAnticiposPorComprobar(FechaI, FechaF, CveCliente, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then DtAnticipos = Mov.DtResultados CargaGrid("") UpAnt.Update() @@ -77,13 +87,26 @@ Partial Class Bancos_RepIngresosPorComprobar End Sub Protected Sub BtnCargarProveedores_Click(sender As Object, e As System.EventArgs) Handles BtnCargarClientes.Click - DdlClientes.CssClass += " select2me" - DdlClientes.Items.Clear() - DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientes.DataBind() - DdlClientes.Items.Insert(0, New ListItem("Todos", "-1")) - DdlClientes.Attributes.Remove("onclick") + + Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + If EsWS Then + DdlClientes.setEsWebService(True) + Else + DdlClientes.setEsWebService(False) + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) + DdlClientes.DataBind() + DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1")) + End If + + + 'DdlClientes.CssClass += " select2me" + 'DdlClientes.Items.Clear() + 'DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) + + 'DdlClientes.DataBind() + 'DdlClientes.Items.Insert(0, New ListItem("Todos", "-1")) + 'DdlClientes.Attributes.Remove("onclick") End Sub diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index f3fd68e1b..399a06781 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2149,18 +2149,8 @@ Partial Class Compras_Compras Private Sub CargaRetIVAConcepto(Optional Cambio As Boolean = False) - - - - If TrRetIVA.Visible Then TdRetIVAConcepto.Visible = True - - - - - - End If If Cambio Then @@ -2174,15 +2164,12 @@ Partial Class Compras_Compras End If DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4")) - - 'If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then - DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5")) - 'End If - + ''If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then + 'DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5")) + ''End If End If - UpPS.Update() End Sub @@ -3380,6 +3367,47 @@ Partial Class Compras_Compras DdlRetIVAConcepto.SelectedValueExist("2") ' flete pf DdlRetIVAConcepto.SelectedValueExist("3") ' fletes pm DdlRetISRConcepto.SelectedValueExist("1") ' honorarios + ElseIf ObjProveedor.DIOTCveTipoOperacion = 0 Then + + + If CveFactura > 0 Then + + If RetIVAOriginal > 0 Then + Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal + + If (CalRetIVAPor).RoundAD(6) = 0.106667 Then + DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profecionales + End If + + If (CalRetIVAPor).RoundAD(2) = 0.04 Then '4 Fletes + + If RFCProv.Length = 13 Then + DdlRetIVAConcepto.SelectedValueExist("2") + Else + DdlRetIVAConcepto.SelectedValueExist("3") + End If + + + End If + + End If + + If RetISROriginal > 0 Then + + Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal + + If (CalRetISRPor).RoundAD(1) = 0.1 Then '10 Sercviios profecionales + DdlRetISRConcepto.SelectedValueExist("1") + End If + + If (CalRetISRPor).RoundAD(4) = 0.0125 Then '1.25 Recico regimen simplificado confianza + DdlRetISRConcepto.SelectedValueExist("3") + End If + + End If + + End If + End If LbAgregar.Enabled = True @@ -4013,9 +4041,7 @@ Partial Class Compras_Compras Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click - 'If Not AjustaCombustibles() Then - ' Exit Sub - 'End If + '------------------ INICIA VALIDACIONES ------------------ @@ -4437,6 +4463,10 @@ Partial Class Compras_Compras '------------------TERMINA VALIDACIONES------------------ + + + + 'si hay necesidad de actualizar el globaldtps If RegeneraPS Then 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) @@ -5219,7 +5249,7 @@ Partial Class Compras_Compras 'QUEMA SALDOS DE INV-COMPRA | MERCANCIA RECIBIDA POR ADELANTADO (OC) | PP 176 If OCVinculada And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then For Each Row As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows - If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Row("CveOrdenCompraDetalle").ToString.ToEntero, -1, -1, Row("CveCompraDetalle").ToString.ToEntero, Row("Cantidad").ToString.ToDouble) Then + If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Row("CveOrdenCompraDetalle").ToString.ToEntero, -1, -1, Row("CveCompraDetalle").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal) Then ErrorSaldosInvComp = True Exit For End If @@ -5894,7 +5924,10 @@ Partial Class Compras_Compras Dim IdCtaContable As Integer = 0 Dim Concepto As String = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, $"{TxtSerie.Text}-{TxtFolio.Text}", If(TxtDocumentoFolio.Visible, TxtDocumentoFolio.Text, If(TxtDocumentoFolioCaja.Visible, TxtDocumentoFolioCaja.Text, ConceptoPersonal))) Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) + + Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) + + Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation Dim PorcentajeImpuesto As Decimal = 0 CveConceptoOriginal = ConceptoContable @@ -8939,7 +8972,7 @@ Partial Class Compras_Compras IdCtaContable = 0 Dim Concepto As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text) Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) + Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) Dim PorcentajeImpuesto As Decimal = 0 Dim ConceptoPartida As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text) @@ -10558,7 +10591,7 @@ Partial Class Compras_Compras Dim importeMovimiento As Decimal = 0 Dim IdCtaContable As Integer = 0 Dim importeMN As Decimal = 0 - Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1) + Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1) Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation Select Case ConceptoContable @@ -10775,7 +10808,7 @@ Partial Class Compras_Compras 'End If 'AGREGA MOVIMIENTO - If importeMovimiento <> 0 Then + If importeMovimiento <> 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}" If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, IdSegmentoNegocio, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero) Then ErrorPrepoliza = True diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index a42199ad8..27a2772a3 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -1198,14 +1198,17 @@ Partial Class PopUpVerFactura Dim Usuario As String = $" Usuario: {Nombre}" If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + + 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) params.Add(New ReportParameter("AgrupoPor", $"{FechaCorte}{Usuario}")) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1311,7 +1314,7 @@ Partial Class PopUpVerFactura Private Sub ImprimeGastoContrato(CveContrato As Integer, CveContratoGasto As Integer) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim Dr As DataRow = Nothing Dim ObjContratos As New ClsContratos @@ -1345,7 +1348,9 @@ Partial Class PopUpVerFactura End If params.Add(New ReportParameter("Utilidad", $"$ {(SumaUtilidad - SumaGasto).ToString.FormatoNumero()}")) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1493,14 +1498,9 @@ Partial Class PopUpVerFactura If Dt.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - - 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) - - If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", LogoRuta)) Else @@ -1920,7 +1920,7 @@ Partial Class PopUpVerFactura If DtConceptos.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Imagen.Exists Then Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) @@ -3437,8 +3437,15 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("NombreEntrego", Personal)) params.Add(New ReportParameter("Responsable", Personal)) params.Add(New ReportParameter("NombreRecibio", Capturo.ToUpper)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("LogoPath", logouri)) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + If DtMovimientos.COUNT("Serie") > 0 Then params.Add(New ReportParameter("MostrarSerieLote", "1")) Else @@ -3523,8 +3530,14 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("NombreEntrego", Capturo.ToUpper)) params.Add(New ReportParameter("Responsable", Personal)) params.Add(New ReportParameter("NombreRecibio", Personal)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("LogoPath", logouri)) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If If DtMovimientos.COUNT("Serie") > 0 Then params.Add(New ReportParameter("MostrarSerieLote", "1")) Else @@ -4962,7 +4975,8 @@ Partial Class PopUpVerFactura End If Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) If Not ReporteEmpresa.Exists Then params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) @@ -4970,7 +4984,8 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -5166,10 +5181,9 @@ Partial Class PopUpVerFactura ObjAF.Dispose() Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -6257,7 +6271,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CodigoTD", CodigoTD)) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -6315,7 +6331,7 @@ Partial Class PopUpVerFactura ObjPS.Dispose() Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim DtDatos As New DataTable Dim params As New List(Of ReportParameter) @@ -6394,7 +6410,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("CodigoTD", CodigoTD)) If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 06170b6ba..d8176bb72 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -713,18 +713,36 @@ Partial Class Compras_Proveedores Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) - Dim nodo As XmlNode = XMLDoc.DocumentElement - If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" - namespaces.AddNamespace(Prefijo, cfdVer) + Dim nodo As XmlNode = XMLDoc.DocumentElement Dim Version As String = ValorXml(nodo, "Version") + + If Version = "3.2" Then + Prefijo = "cfd" + cfdVer = "http://www.sat.gob.mx/cfd/2" + ElseIf Version = "3.3" Then + cfdVer = "http://www.sat.gob.mx/cfd/3" + + Else ' se considera que es la version 4.0 + cfdVer = "http://www.sat.gob.mx/cfd/4" + End If + + + + 'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2" + namespaces.AddNamespace(Prefijo, cfdVer) + + + + + Dim node As XmlNode node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces) If node IsNot Nothing Then TxtRFC.Text = ValorXml(node, "rfc") - If Version = "3.3" Then + If Version = "3.3" Or Version = "4.0" Then TxtRazonSocial.Text = HttpUtility.HtmlDecode(ValorXml(node, "Nombre")) TxtNombreComercial.Text = HttpUtility.HtmlDecode(ValorXml(node, "Nombre")) ChkEstado.Checked = True diff --git a/Compras/RepCxPPeriodo.aspx b/Compras/RepCxPPeriodo.aspx index 397894da3..0f4881bb5 100644 --- a/Compras/RepCxPPeriodo.aspx +++ b/Compras/RepCxPPeriodo.aspx @@ -48,9 +48,7 @@
    Proveedor:
    - - - +
    Clasificación:
    @@ -126,6 +124,16 @@
    +
    Tipo Docto:
    +
    + + + + + + + +
diff --git a/Compras/RepCxPPeriodo.aspx.cs b/Compras/RepCxPPeriodo.aspx.cs index 5b9f2a458..49054ae32 100644 --- a/Compras/RepCxPPeriodo.aspx.cs +++ b/Compras/RepCxPPeriodo.aspx.cs @@ -44,8 +44,28 @@ public partial class Compras_RepCxPPeriodo : ClsPaginas TipoCambio = 1; TCEspecifico = -1; - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.DataBind(); + + + + //DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); + //DdlProveedor.DataBind(); + + + + if (UsuarioActual.Empresa.Funcionalidad(105) == "1") { + DdlProveedor.setEsWebService(true); + DdlProveedor.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedor.SelectedText = "Todos"; + DdlProveedor.SelectedValue = "-1"; + } + else { + DdlProveedor.setEsWebService(false); + DdlProveedor.ddl.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); + DdlProveedor.ddl.DataBind(); + DdlProveedor.ddl.Items.Insert(0, new ListItem("Todos", "-1")); + } + + DdlUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}").FiltraParametros("ProveedoresResponsables > 0"); DdlUsuarioResponsable.DataBind(); @@ -72,10 +92,16 @@ public partial class Compras_RepCxPPeriodo : ClsPaginas { if (RblTipoCambio.SelectedValue.ToEntero() == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; } + + int CveProveedor = DdlProveedor.SelectedValue.ToEntero() > 0 ? DdlProveedor.SelectedValue.ToEntero() : -1; + + string TipoDocto = (DdlTipoDocto.GetSelectedValuesM() == "") ? "-1" : DdlTipoDocto.GetSelectedValuesM(); + ClsMovimientos ObjMov = new ClsMovimientos(); - if (ObjMov.GetCxPPeriodo(DdlProveedor.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),DdlProveedoresClasificaciones.SelectedValue.ToEntero(), + if (ObjMov.GetCxPPeriodo(CveProveedor, DdlSubProyecto.SelectedValue.ToEntero(),DdlProveedoresClasificaciones.SelectedValue.ToEntero(), DdlUsuarioResponsable.SelectedValue.ToEntero(),DdlUsuarioRegistro.SelectedValue.ToEntero(),DdlEstatusCompra.SelectedValue.ToEntero(),UsuarioActual.CveEmpresa, - DdlGrupo.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),TipoCambio,TCEspecifico,txtCorteA.Text.ToDate(),UsuarioActual.CveUsuario,DdlTipoProveedor.SelectedValue.ToEntero())) + DdlGrupo.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),TipoCambio,TCEspecifico,txtCorteA.Text.ToDate(),UsuarioActual.CveUsuario, + DdlTipoProveedor.SelectedValue.ToEntero(), TipoDocto: TipoDocto)) { GvDatos.DataSource = ObjMov.DtResultados; DtDatos = ObjMov.DtResultados; @@ -234,7 +260,7 @@ public partial class Compras_RepCxPPeriodo : ClsPaginas if (DdlGrupo.SelectedValue != "-1") StrFiltro.AppendFormat(" Grupo: {0}", DdlGrupo.SelectedItem.Text); if (DdlProveedor.SelectedValue != "-1") - StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedor.SelectedItem.Text); + StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedor.ddl.SelectedItem.Text); if (DdlProveedoresClasificaciones.SelectedValue != "-1") StrFiltro.AppendFormat(" Clasificación Proveedor: {0}", DdlProveedoresClasificaciones.SelectedItem.Text); if (DdlTipoProveedor.SelectedValue != "-1") diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index bb3a00671..c73ff32d0 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1581,7 +1581,10 @@ Partial Class Compras_eFacturas swTiempo.AppendFormat("espera: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds) swmili = sw.ElapsedMilliseconds sw.Start() - VerificaCorreo(True) + + If VerificaCorreo(True) Then + CargaDatos() + End If sw.Stop() swTiempo.AppendFormat("Verifica En la app: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds) @@ -1695,6 +1698,9 @@ Partial Class Compras_eFacturas RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalFacturas")) + + + 'Alert(String.Format("Se cargaron {0} Facturas", Arreglo.Count), TipoMensaje.MsgInformacion) End Sub @@ -2847,6 +2853,37 @@ Partial Class Compras_eFacturas Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML")) Dim Prefijo As String = "" + + + + + Dim DTDocumentosRelacionados As New DataTable + DTDocumentosRelacionados.Columns.Add("Serie") + DTDocumentosRelacionados.Columns.Add("SerieFolio") + + DTDocumentosRelacionados.Columns.Add("IdDocumento") + DTDocumentosRelacionados.Columns.Add("Folio", GetType(Integer)) + DTDocumentosRelacionados.Columns.Add("MonedaDR") + DTDocumentosRelacionados.Columns.Add("MetodoDePagoDR") + DTDocumentosRelacionados.Columns.Add("ImpPagado", GetType(Decimal)) + + DTDocumentosRelacionados.Columns.Add("CveFactura", GetType(Integer)) + DTDocumentosRelacionados.Columns.Add("CveCompra", GetType(Integer)) + DTDocumentosRelacionados.Columns.Add("CveIE", GetType(Integer)) + DTDocumentosRelacionados.Columns.Add("Fecha", GetType(Date)) + + DTDocumentosRelacionados.Columns.Add("FolioPago") + DTDocumentosRelacionados.Columns.Add("ImportePago", GetType(Decimal)) + DTDocumentosRelacionados.Columns.Add("FechaPago", GetType(Date)) + DTDocumentosRelacionados.Columns.Add("CveMetodoPago", GetType(Integer)) + DTDocumentosRelacionados.Columns.Add("SerieFolioCompra") + DTDocumentosRelacionados.Columns.Add("CvePrePolizaDetalle", GetType(Integer)) + + DTDocumentosRelacionados.Columns.Add("Tipo", GetType(String)) + DTDocumentosRelacionados.Columns.Add("Manual", GetType(Boolean)) + + + If IO.File.Exists(Archivo) Then @@ -2913,30 +2950,7 @@ Partial Class Compras_eFacturas UUIDPago = ValorXML(nodeTFD, "UUID") LblUUID.Text = UUIDPago - Dim DTDocumentosRelacionados As New DataTable - DTDocumentosRelacionados.Columns.Add("Serie") - DTDocumentosRelacionados.Columns.Add("SerieFolio") - DTDocumentosRelacionados.Columns.Add("IdDocumento") - DTDocumentosRelacionados.Columns.Add("Folio", GetType(Integer)) - DTDocumentosRelacionados.Columns.Add("MonedaDR") - DTDocumentosRelacionados.Columns.Add("MetodoDePagoDR") - DTDocumentosRelacionados.Columns.Add("ImpPagado", GetType(Decimal)) - - DTDocumentosRelacionados.Columns.Add("CveFactura", GetType(Integer)) - DTDocumentosRelacionados.Columns.Add("CveCompra", GetType(Integer)) - DTDocumentosRelacionados.Columns.Add("CveIE", GetType(Integer)) - DTDocumentosRelacionados.Columns.Add("Fecha", GetType(Date)) - - DTDocumentosRelacionados.Columns.Add("FolioPago") - DTDocumentosRelacionados.Columns.Add("ImportePago", GetType(Decimal)) - DTDocumentosRelacionados.Columns.Add("FechaPago", GetType(Date)) - DTDocumentosRelacionados.Columns.Add("CveMetodoPago", GetType(Integer)) - DTDocumentosRelacionados.Columns.Add("SerieFolioCompra") - DTDocumentosRelacionados.Columns.Add("CvePrePolizaDetalle", GetType(Integer)) - - DTDocumentosRelacionados.Columns.Add("Tipo", GetType(String)) - DTDocumentosRelacionados.Columns.Add("Manual", GetType(Boolean)) Dim nodePagosN As XmlNodeList @@ -3140,7 +3154,9 @@ Partial Class Compras_eFacturas 'saco la información de lo vinculado en el ie - ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe") + 'ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe") + ImporteIES = DTDocumentosRelacionados.FiltraParametros("CveIE > 0").SUM("ImportePago") + DiferenciaImportes = Monto - ImporteIES ObjCompras.Dispose() diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index b09cf0b9f..72c196a84 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -88,9 +88,9 @@ Agregar Concepto -
  • - Crear a partir de -
  • +
  • + Crear a partir de +
  • @@ -156,8 +156,14 @@
    -
    - +
    + + + + + + +
    @@ -710,6 +716,8 @@ + diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index bbb576de3..05f6994b1 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -277,6 +277,21 @@ Partial Class ContabilidadC_RegPrePolizaS ValidaCrearAPartirDe() DvPlantilla.Visible = False UPPDocumento.Visible = False + + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + + If Folio.ToEntero > 0 Then + BtnDescontabilizar.Visible = True + LnkFolioManual.Visible = False + Else + BtnDescontabilizar.Visible = False + LnkFolioManual.Visible = True + End If + + End If + + + Exit Sub ElseIf Request("CvePrePolizaOrigen") IsNot Nothing AndAlso IsNumeric(Request("CvePrePolizaOrigen")) AndAlso Request("CvePrePolizaOrigen").ToEntero > 0 Then @@ -2695,22 +2710,51 @@ Partial Class ContabilidadC_RegPrePolizaS Dim ObjConta As New ClsContabilidad - If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero - ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) - End If + If UsuarioActual.Empresa.TipoContabilidad = 1 Then + + If Folio.ToEntero = 0 Then + + Dim FolioManual As Integer = If(TxtFolio.Text.ToEntero > 0, TxtFolio.Text.ToEntero, -1) + + + + If ObjConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, True, UsuarioActual.CveEmpresa, Folio:=FolioManual) Then + + Alert($"Contabilizado Correctamente Folio { ObjConta.ContaFolio.ToString()}.", TipoMensaje.MsgInformacion) + + TxtFolio.Text = ObjConta.ContaFolio.ToString() + LnkFolioManual.Visible = False + UpPoliza.Update() + + End If - If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then - If UsuarioActual.Empresa.TipoContabilizacion = 1 Then - Alert(String.Format("Prepóliza contabilizada.

    Folio: {0} ", ObjConta.FolioPoliza), ModExtensiones.TipoMensaje.MsgInformacion) - Else - Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) End If Else - Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + + If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero + ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) + End If + + If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then + If UsuarioActual.Empresa.TipoContabilizacion = 1 Then + Alert(String.Format("Prepóliza contabilizada.

    Folio: {0} ", ObjConta.FolioPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + Else + Alert(String.Format("Prepóliza contabilizada.

    Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion) + End If + + Else + + Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + End If + End If + + + + ObjConta.Dispose() End Sub @@ -3159,13 +3203,38 @@ Partial Class ContabilidadC_RegPrePolizaS End Sub + + #End Region + Private Sub BtnDescontabilizar_Click(sender As Object, e As EventArgs) Handles BtnDescontabilizar.Click + + Dim ObjConta As New ClsContabilidad + + + If ObjConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, False, UsuarioActual.CveEmpresa) Then + Alert("Descontabilizado Correctamente.", TipoMensaje.MsgInformacion) + TxtFolio.Text = "" + LnkFolioManual.Visible = True + End If + + ObjConta.Dispose() + + UpPoliza.Update() + End Sub + + Private Sub LnkFolioManual_Click(sender As Object, e As EventArgs) Handles LnkFolioManual.Click + + TxtFolio.Enabled = True + TxtFolio.Focus() + UpPoliza.Update() + + End Sub End Class diff --git a/Contabilidad/RepBalanzaComprobacion.aspx b/Contabilidad/RepBalanzaComprobacion.aspx index 9d91861d0..5986fd478 100644 --- a/Contabilidad/RepBalanzaComprobacion.aspx +++ b/Contabilidad/RepBalanzaComprobacion.aspx @@ -3,16 +3,28 @@ -
  • - Exporta Excel - <%--   --%> -
  • -
  • - Imprimir - <%--  --%> -
  • -
    + + + + +
  • + Exporta Excel + <%--   --%> +
  • +
  • + Imprimir + <%--  --%> +
  • +
    + + + + +
    + + + Balanza de Comprobación diff --git a/Contabilidad/RepBalanzaComprobacion.aspx.vb b/Contabilidad/RepBalanzaComprobacion.aspx.vb index 04f9191b3..f9bbddfb3 100644 --- a/Contabilidad/RepBalanzaComprobacion.aspx.vb +++ b/Contabilidad/RepBalanzaComprobacion.aspx.vb @@ -228,10 +228,15 @@ Partial Class Contabilidad_RepBalanzaComprobacion GenerarPDFCrystal("EXCEL") End Sub Private Sub GenerarPDFCrystal(Optional Formato As String = "PDF") - Dim Archivo As New System.IO.FileInfo(String.Format("{0}Contabilidad/Reportes/RepBalanzaComprobacion.rpt", UsuarioActual.Empresa.Ruta)) + Dim Archivo As New System.IO.FileInfo(String.Format("{0}Contabilidad/Reportes/RepBalanzaComprobacion.rpt", Server.MapPath("~"))) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + 'If UsuarioActual.CveUsuario = 100 Then + ' Alert(String.Format("{0}Contabilidad/Reportes/RepBalanzaComprobacion.rpt", Server.MapPath("~"))) + ' End If + ' Exit Sub + If Not IsNothing(DtDatos) Then 'Dim dr As DataRow = DtCxC.Rows(0) Dim lista = New List(Of CrystalParametro) @@ -245,7 +250,9 @@ Partial Class Contabilidad_RepBalanzaComprobacion lista.Add(New CrystalParametro("pImg", "")) End If - ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Contabilidad/Reportes/RepBalanzaComprobacion.rpt"), DtDatos, lista, "Balanza de Comprobación", Formato), "Balanza de Comprobación", Formato) + Dim DTTemp As DataTable = DtDatos.Copy + + ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Contabilidad/Reportes/RepBalanzaComprobacion.rpt"), DTTemp, lista, "Balanza de Comprobación", Formato), "Balanza de Comprobación", Formato) Else Alert("No se tienen registrados movimientos", TipoMensaje.MsgAdvertencia) diff --git a/Contabilidad/Reportes/RepBalanzaComprobacion.rpt b/Contabilidad/Reportes/RepBalanzaComprobacion.rpt index 2b98edb34..b9c06261a 100644 Binary files a/Contabilidad/Reportes/RepBalanzaComprobacion.rpt and b/Contabilidad/Reportes/RepBalanzaComprobacion.rpt differ diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb index 12c5b1dec..dc9a65081 100644 --- a/CxC/RepCxCDetalle.aspx.vb +++ b/CxC/RepCxCDetalle.aspx.vb @@ -910,8 +910,13 @@ Partial Class RepCxCDetalle 'End If Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + Dim logouri As String = "" + If Imagen.Exists Then + logouri = String.Format("file://{0}", Imagen.FullName) + End If + + Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("FechaInicio", FechaI)) diff --git a/CxC/RepCxCPeriodo.aspx b/CxC/RepCxCPeriodo.aspx index e210ecc1b..a7089fb86 100644 --- a/CxC/RepCxCPeriodo.aspx +++ b/CxC/RepCxCPeriodo.aspx @@ -117,7 +117,8 @@ - + +
    diff --git a/CxC/RepCxCPeriodo.aspx.cs b/CxC/RepCxCPeriodo.aspx.cs index 35de41dd3..d0d2003d1 100644 --- a/CxC/RepCxCPeriodo.aspx.cs +++ b/CxC/RepCxCPeriodo.aspx.cs @@ -39,13 +39,18 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas } } + + + + private void InicializaValores() { TipoCambio = 1; TCEspecifico = -1; //CargaClientes - if (UsuarioActual.CveEmpresa == 119) { + if (UsuarioActual.Empresa.Funcionalidad(105) == "1") + { DdlClientesWS.setEsWebService(true); } else @@ -93,8 +98,11 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas if (RblTipoCambio.SelectedValue.ToEntero() == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; } + + int CveCliente = DdlClientesWS.SelectedValue.ToEntero() > 0 ? DdlClientesWS.SelectedValue.ToEntero() : -1; + ClsMovimientos ObjMov = new ClsMovimientos(); - if (ObjMov.GetCxCPeriodo(DdlClientesWS.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),DdlVendedor.SelectedValue.ToEntero(),DdlUsuario.SelectedValue.ToEntero(), + if (ObjMov.GetCxCPeriodo(CveCliente, DdlSubProyecto.SelectedValue.ToEntero(),DdlVendedor.SelectedValue.ToEntero(),DdlUsuario.SelectedValue.ToEntero(), -1,"-1",UsuarioActual.CveEmpresa,DdlGrupo.SelectedValue.ToEntero(),DdlResponsable.SelectedValue.ToEntero(),TipoCambio,TCEspecifico, TipoDocto,txtCorteA.Text.ToDate(), DdlEstatusCliente.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, DdlCobranzaEstatus.SelectedValue.ToEntero(), DdlClienteClasificacion.SelectedValue.ToEntero())){ GvDatos.DataSource = ObjMov.DtResultados; @@ -107,13 +115,34 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas private void CargaClientes() { - if (UsuarioActual.CveEmpresa != 119) + + if (UsuarioActual.Empresa.Funcionalidad(105) == "1") + { + DdlClientesWS.setEsWebService(true); + + if( DdlClienteClasificacion.SelectedValue.ToEntero() > 0) + { + DdlClientesWS.ddlWS.Attributes.Add("data-cveclienteclasificacion", DdlClienteClasificacion.SelectedValue); + DdlClientesWS.txtValue.Value = ""; + DdlClientesWS.txtText.Value = ""; + + } + else + { + DdlClientesWS.ddlWS.Attributes.Add("data-cveclienteclasificacion", "-1"); + } + + } + else { DdlClientesWS.ddl.Items.Clear(); DdlClientesWS.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero()} OR {DdlClienteClasificacion.SelectedValue.ToEntero()} = -1"); DdlClientesWS.DataBind(); DdlClientesWS.ddl.Items.Insert(0, new ListItem("Todos", "-1")); } + + UPFiltros.Update(); + } protected void DdlClienteClasificacion_SelectedIndexChanged(object sender, EventArgs e) diff --git a/Empresas/119/Formatos/RepIVA.rpt b/Empresas/119/Formatos/RepIVA.rpt index a324e45bd..c09e9e811 100644 Binary files a/Empresas/119/Formatos/RepIVA.rpt and b/Empresas/119/Formatos/RepIVA.rpt differ diff --git a/Empresas/119/Formatos/RepIVAAcreditable.rpt b/Empresas/119/Formatos/RepIVAAcreditable.rpt index 5caea88e1..33999cb6e 100644 Binary files a/Empresas/119/Formatos/RepIVAAcreditable.rpt and b/Empresas/119/Formatos/RepIVAAcreditable.rpt differ diff --git a/Empresas/15/Formatos/Factura.rdlc b/Empresas/15/Formatos/Factura.rdlc index 077ad259e..ec17632f6 100644 --- a/Empresas/15/Formatos/Factura.rdlc +++ b/Empresas/15/Formatos/Factura.rdlc @@ -768,15 +768,7 @@ - - - - - 83140 + =Parameters!CP.Value + + + + + - =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value) + =Parameters!FormaPago.Value - true @@ -4074,13 +4082,13 @@ - 0.74104in + 0.73688in - 0.57756in + 0.5734in - 0.67516in + 0.671in @@ -4329,9 +4337,9 @@ DataSet3 0.26817in - 5.86887in + 5.88134in 0.34081in - 1.99376in + 1.98129in 3