diff --git a/cron/daily/50-check-virtual-cards-missing-receipts.ts b/cron/daily/50-check-virtual-cards-missing-receipts.ts index 788418badc2..9391434bc2e 100644 --- a/cron/daily/50-check-virtual-cards-missing-receipts.ts +++ b/cron/daily/50-check-virtual-cards-missing-receipts.ts @@ -24,7 +24,7 @@ const processVirtualCard = async (expenses: Array) => { const data = { expenses: expenses.map(e => ({ ...e.info, - url: `${config.host.website}/${collective.slug}/expenses/${e.id}?edit=1`, + url: `${config.host.website}/${collective.slug}/expenses/${e.id}`, })), virtualCard, host: host.info, diff --git a/server/graphql/v1/CollectiveInterface.js b/server/graphql/v1/CollectiveInterface.js index 04b126f2f3f..c54c1659aaa 100644 --- a/server/graphql/v1/CollectiveInterface.js +++ b/server/graphql/v1/CollectiveInterface.js @@ -52,7 +52,6 @@ import { PaginatedPaymentMethodsType, PaymentMethodBatchInfo, PaymentMethodType, - PayoutMethodType, TierType, UserType, } from './types'; @@ -608,10 +607,6 @@ export const CollectiveInterfaceType = new GraphQLInterfaceType({ }, }, }, - payoutMethods: { - type: new GraphQLList(PayoutMethodType), - description: 'The list of payout methods that this collective can use to get paid', - }, giftCardsBatches: { type: new GraphQLList(PaymentMethodBatchInfo), description: @@ -1649,24 +1644,6 @@ const CollectiveFields = () => { return paymentMethods.filter(pm => !pm.expiryDate || pm.expiryDate > now); }, }, - payoutMethods: { - type: new GraphQLList(PayoutMethodType), - description: 'The list of payout methods that this collective can use to get paid', - async resolve(collective, _, req) { - if (!req.remoteUser || !req.remoteUser.isAdminOfCollective(collective)) { - return null; - } else { - const payoutMethods = await req.loaders.PayoutMethod.byCollectiveId.load(collective.id); - return payoutMethods.filter(pm => { - if (pm.type === PayoutMethodTypes.STRIPE && collective.id !== PlatformConstants.OfitechCollectiveId) { - return false; - } - - return true; - }); - } - }, - }, giftCardsBatches: { type: new GraphQLList(PaymentMethodBatchInfo), description: diff --git a/server/graphql/v1/types.js b/server/graphql/v1/types.js index 98386273a3f..9ebf221abf8 100644 --- a/server/graphql/v1/types.js +++ b/server/graphql/v1/types.js @@ -26,8 +26,7 @@ import { filterContributors } from '../../lib/contributors'; import { sanitizeStripeError } from '../../lib/stripe'; import twoFactorAuthLib from '../../lib/two-factor-authentication'; import models, { Op, sequelize } from '../../models'; -import { PayoutMethodTypes } from '../../models/PayoutMethod'; -import { canSeeExpenseAttachments, canSeeExpensePayoutMethodPrivateDetails } from '../common/expenses'; +import { canSeeExpenseAttachments } from '../common/expenses'; import { hasSeenLatestChangelogEntry } from '../common/user'; import { Unauthorized } from '../errors'; import { idEncode, IDENTIFIER_TYPES } from '../v2/identifiers'; @@ -84,36 +83,6 @@ const IsoDateString = new GraphQLScalarType({ }, }); -const PayoutMethodTypeEnum = new GraphQLEnumType({ - name: 'PayoutMethodTypeEnum', - values: Object.keys(PayoutMethodTypes).reduce((values, key) => { - return { ...values, [key]: { value: PayoutMethodTypes[key] } }; - }, {}), -}); - -// @deprecated Still used in Collective.payoutMethods by `expenseFormPayeeStepCollectivePickerSearchQuery` -export const PayoutMethodType = new GraphQLObjectType({ - name: 'PayoutMethod', - description: 'A payout method for expenses', - fields: () => ({ - id: { - type: GraphQLInt, - }, - type: { - type: PayoutMethodTypeEnum, - }, - name: { - type: GraphQLString, - }, - isSaved: { - type: GraphQLBoolean, - }, - data: { - type: GraphQLJSON, - }, - }), -}); - export const UserType = new GraphQLObjectType({ name: 'UserDetails', description: 'This represents the details of a User', @@ -798,17 +767,6 @@ export const ExpenseType = new GraphQLObjectType({ return expense.type; }, }, - PayoutMethod: { - type: PayoutMethodType, - deprecationReason: '2024-12-13: Please move to GraphQL v2', - async resolve(expense, _, req) { - if (!expense.PayoutMethodId || !(await canSeeExpensePayoutMethodPrivateDetails(req, expense))) { - return null; - } else { - return expense.payoutMethod || req.loaders.PayoutMethod.byId.load(expense.PayoutMethodId); - } - }, - }, privateMessage: { type: GraphQLString, async resolve(expense, args, req) { diff --git a/templates/emails/collective.expense.missing.receipt.hbs b/templates/emails/collective.expense.missing.receipt.hbs index 7f907cfb4fb..b9cd093e9a0 100644 --- a/templates/emails/collective.expense.missing.receipt.hbs +++ b/templates/emails/collective.expense.missing.receipt.hbs @@ -18,7 +18,7 @@ For accounting reasons, the Fiscal Host will need a description and receipt. The
- +
Submit Receipt
diff --git a/templates/emails/virtualcard.purchase.hbs b/templates/emails/virtualcard.purchase.hbs index e27d1fcb672..e91b6c8a3ce 100644 --- a/templates/emails/virtualcard.purchase.hbs +++ b/templates/emails/virtualcard.purchase.hbs @@ -11,14 +11,14 @@ Subject: Virtual Card Purchase

A card attached to {{collective.name}} was charged {{currency amount currency=currency precision=2}} and we need the responsible admin to input additional information. -For accounting reasons, the Fiscal Host will need a description and receipt. Please upload a receipt if you already have one. The card may be suspended if receipts are not provided. +For accounting reasons, the Fiscal Host will need a description and receipt. Please upload a receipt if you already have one. The card may be suspended if receipts are not provided.



- +
Submit Receipt
diff --git a/test/server/paymentProviders/stripe/virtual-cards.test.js b/test/server/paymentProviders/stripe/virtual-cards.test.js index 180800dc378..aac8d6f5a44 100644 --- a/test/server/paymentProviders/stripe/virtual-cards.test.js +++ b/test/server/paymentProviders/stripe/virtual-cards.test.js @@ -84,6 +84,6 @@ describe('server/paymentProviders/stripe/virtual-cards', () => { expect(emailTo).to.equal(collectiveAdmin.email); expect(subject).to.equal('Virtual Card Purchase'); expect(body).to.contain('A card attached to Open Collective was charged $1.00.'); - expect(body).to.contain(`