Posted by EPO on November 28, 2009 at 12:00pm
5 followers
| Project: | e-Commerce |
| Version: | 6.x-4.x-dev |
| Component: | ec_receipt |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
in receipt module line 1254 I discovered this action on delete request.
function ec_receipt_action_delete($receipt, $context) {
return;
}please insert the missing function.
Comments
#1
This is part of a some code that was added to ec_receipt.module on March 19, 2009:
Diff of /contributions/modules/ecommerce/ec_receipt/ec_receipt.module
The added functions all seem to relate to admin/store/receipts [the ec_receipt_list view in ec_receipt.views_default.inc].
There are three bulk operations that were added to admin/store/receipts at this time: ec_receipt_action_delete, ec_receipt_action_allocate, and ec_receipt_action_refund.
ec_receipt_action_delete and ec_receipt_action_refund both seem to be dead ends.
Question:
Is admin/store/receipts [the ec_receipt_list view] a todo, an abandoned idea, or something else?
For reference:
ec_receipt_action_allocate calls ec_receipt_allocate, which is also called in ec_receipt_checkout_post_submit [in ec_receipt.checkout.inc].
Allocations can be reversed elsewhere at admin/store/receipts_alloc. "Reverse Allocation" on this page uses ec_receipt_reverse_allocation.
#2
#3
Is this as simple as
DELETE FROM {ec_receipt} WHERE erid = %receipt_id? Are there other tables we need to take into account? (Not that I can see, at least)#4
To answer the question from #1, admin/store/receipts shows a view of receipts. I don't know what ec_receipt_action_refund() is supposed to do. Well, it's supposed to refund receipts - is this returning money to users at some point?
I've implemented my suggestion from #3 to allow the deleting of receipts; patch attached.
#5
The last submitted patch, 645344.patch, failed testing.
#6
Fine then :p
#7
#8
The last submitted patch, 645344.patch, failed testing.
#9
This will not really work.
Just deleting the receipt is not going to leave artifacts such as allocation. We need to make sure that when delete a receipt we are able to. ie. The receipt is still allocated to a transaction, it needs to be unallocated and refunded before it can be deleted.
Allowing someone delete a receipt will cause the system to go out of balance.
I think this is why I didn't implement it and left this as it was.