You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Refund or cancel 2 quantity from 1st item and 1 quantity from second item.
Trigger refund
Now try to use Refund or cancel option to cancel the one quantity remaining in the first item. (you can see the option is disabled)
Expected behavior
The Customer support should be able to cancel multiple times on line item until it reaches 0.
Environment (please complete the following information):
@vendure/core version: Vendure2.1.0
Nodejs version - Node 18
Database (mysql/postgres etc): Postgres
Additional context
In the above mentioned scenario see the item where I cannot select refund / cancel to proceed with full item cancellation from Admin UI
The text was updated successfully, but these errors were encountered:
@michaelbromley I was debugging the code and it seems the following code is the root cause of the issue lineCanBeRefundedOrCancelled(line) { const refundedCount = this.order.payments ?.reduce((all, payment) => [...all, ...payment.refunds], []) .filter(refund => refund.state !== 'Failed') .reduce((all, refund) => [...all, ...refund.lines], []) .filter(refundLine => refundLine.orderLineId === line.id) .reduce((sum, refundLine) => sum + refundLine.quantity, 0) ?? 0; return refundedCount < **line.quantity**;
Here the line.quantity will always get reduced with cancellation, so the check is always against the remaning quantity in the order than the order placed quantity.
** Multiple Cancellations on a same line item not allowed from admin UI **
To Reproduce
Expected behavior
The Customer support should be able to cancel multiple times on line item until it reaches 0.
Environment (please complete the following information):
Additional context

In the above mentioned scenario see the item where I cannot select refund / cancel to proceed with full item cancellation from Admin UI
The text was updated successfully, but these errors were encountered: