Skip to content

Commit

Permalink
Merge pull request #4659 from opencollective/fix/new-cf-vat
Browse files Browse the repository at this point in the history
createOrder: Fix tax ID number
  • Loading branch information
Betree committed Oct 5, 2020
2 parents a580ca9 + 0aef5ad commit 964af7a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -18,7 +18,7 @@
"@hyperwatch/hyperwatch": "3.7.1",
"@octokit/auth-oauth-app": "3.0.5",
"@octokit/rest": "18.0.6",
"@opencollective/taxes": "3.0.0",
"@opencollective/taxes": "3.1.0",
"@paypal/payouts-sdk": "^1.0.0",
"algoliasearch": "3.35.1",
"apollo-server-express": "2.18.1",
Expand Down
4 changes: 2 additions & 2 deletions server/graphql/v1/mutations/orders.js
Expand Up @@ -394,10 +394,10 @@ export async function createOrder(order, loaders, remoteUser, reqIp) {
if (netAmountForCollective !== expectedAmountForCollective || order.taxAmount !== expectedTaxAmount) {
const prettyTotalAmount = formatCurrency(order.totalAmount, currency, 2);
const prettyExpectedAmount = formatCurrency(expectedAmountForCollective, currency, 2);
const taxInfo = expectedTaxAmount ? ` + ${formatCurrency(expectedTaxAmount, currency, 2)} tax` : '';
const taxInfoStr = expectedTaxAmount ? ` + ${formatCurrency(expectedTaxAmount, currency, 2)} tax` : '';
const platformFeeInfo = order.platformFee ? ` + ${formatCurrency(order.platformFee, currency, 2)} fees` : '';
throw new Error(
`This tier uses a fixed amount. Order total must be ${prettyExpectedAmount}${taxInfo}${platformFeeInfo}. You set: ${prettyTotalAmount}`,
`This tier uses a fixed amount. Order total must be ${prettyExpectedAmount}${taxInfoStr}${platformFeeInfo}. You set: ${prettyTotalAmount}`,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/graphql/v2/mutation/OrderMutations.js
Expand Up @@ -80,7 +80,7 @@ const orderMutations = {
taxAmount: tax && getValueInCentsFromAmountInput(tax.amount),
taxType: tax?.type,
countryISO: tax?.country,
taxIdNumber: tax?.idNumber,
taxIDNumber: tax?.idNumber,
isFeesOnTop: !isNil(platformFee),
paymentMethod: await getLegacyPaymentMethodFromPaymentMethodInput(order.paymentMethod),
fromCollective: { id: fromCollective.id },
Expand Down

0 comments on commit 964af7a

Please sign in to comment.