View | Details | Raw Unified | Return to bug 36066
Collapse All | Expand All

(-)a/Koha/REST/V1/Acquisitions/Orders.pm (-2 / +9 lines)
Lines 183-189 sub update { Link Here
183
183
184
=head3 delete
184
=head3 delete
185
185
186
Controller function that handles deleting a Koha::Patron object
186
Controller function that handles deleting a Koha::Acquisition::Order object
187
188
Note that we only allow deletion when the status is cancelled.
187
189
188
=cut
190
=cut
189
191
Lines 197-202 sub delete { Link Here
197
            status  => 404,
199
            status  => 404,
198
            openapi => { error => 'Order not found' }
200
            openapi => { error => 'Order not found' }
199
        );
201
        );
202
    } elsif ( ( $order->orderstatus && $order->orderstatus ne 'cancelled' ) || !$order->datecancellationprinted ) {
203
        # Koha may (historically) have inconsistent order data here (e.g. cancelled without date)
204
        return $c->render(
205
            status  => 403,
206
            openapi => { error => 'Order status must be cancelled' }
207
        );
200
    }
208
    }
201
209
202
    return try {
210
    return try {
203
- 

Return to bug 36066