public static void IsPosibleDelete(long oid, ETipoAcreedor providerType)
        {
            QueryConditions conditions = new QueryConditions
            {
                TipoAcreedor = new ETipoAcreedor[1] {
                    providerType
                },
                Acreedor = ProviderBaseInfo.New(oid, providerType),
                Estado   = EEstado.NoAnulado
            };

            InputDeliveryList albaranes = InputDeliveryList.GetList(conditions, false);

            if (albaranes.Count > 0)
            {
                throw new iQException(Resources.Messages.ALBARANES_ASOCIADOS);
            }

            InputInvoiceList facturas = InputInvoiceList.GetList(conditions, false);

            if (facturas.Count > 0)
            {
                throw new iQException(Resources.Messages.FACTURAS_ASOCIADAS);
            }

            conditions.PaymentType = ETipoPago.Factura;

            PaymentList pagos = PaymentList.GetList(conditions, false);

            if (pagos.Count > 0)
            {
                throw new iQException(Resources.Messages.PAGOS_ASOCIADOS);
            }
        }
        public ExpensesReportVerticalRpt GetInformeGastoVerticalListReport(ExpenseList list,
                                                                           ExpedienteList expedientes,
                                                                           ReportFilter filter,
                                                                           InputDeliveryLineList conceptos)
        {
            if (list == null)
            {
                return(null);
            }

            ExpensesReportVerticalRpt doc = new ExpensesReportVerticalRpt();

            List <ResumenGastoPrint> pList     = new List <ResumenGastoPrint>();
            InputDeliveryList        albaranes = InputDeliveryList.GetList(false);

            foreach (ExpedientInfo item in expedientes)
            {
                if (filter.SoloIncompletos)
                {
                    if (list.ExpedienteIsComplete(item.Oid))
                    {
                        continue;
                    }
                }

                ResumenGastoPrint registro = ResumenGastoPrint.New(item, list, conceptos, albaranes);

                if (registro.Proveedor != null ||
                    registro.Naviera != null ||
                    registro.Despachante != null ||
                    registro.TransportistaDestino != null ||
                    registro.TransportistaOrigen != null)
                {
                    pList.Add(registro);
                }
            }

            doc.SetDataSource(pList);

            FormatHeader(doc);

            return(doc);
        }