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.

CommentFileSizeAuthor
#6 645344.patch391 bytesburningdog
#4 645344.patch386 bytesburningdog
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Soren Jones’s picture

Version: 6.x-4.0-rc15 » 6.x-4.x-dev

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.

Soren Jones’s picture

Title: Delete receipt doesnt work » Empty ec_receipt_action_delete and ec_receipt_action_refund functions
burningdog’s picture

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)

burningdog’s picture

Status: Active » Needs review
FileSize
386 bytes

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.

Status: Needs review » Needs work

The last submitted patch, 645344.patch, failed testing.

burningdog’s picture

FileSize
391 bytes

Fine then :p

Soren Jones’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 645344.patch, failed testing.

gordon’s picture

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.