Added confirmation page, and more importantly date and comment settings, when reversing a charge.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@598 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-17 05:37:29 +00:00
parent a167b8a885
commit 4c44794212
3 changed files with 115 additions and 5 deletions

View File

@@ -185,6 +185,9 @@ class StatementEntry extends AppModel {
function reversable($id) {
$this->prEnter(compact('id'));
if (empty($id))
return $this->prReturn(false);
// Verify the item is an actual charge
$this->id = $id;
$charge_type = $this->field('type');
@@ -205,7 +208,7 @@ class StatementEntry extends AppModel {
* function: reverse
* - Reverses the charges
*/
function reverse($id, $stamp = null) {
function reverse($id, $stamp = null, $comment) {
$this->prEnter(compact('id', 'stamp'));
// Verify the item can be reversed
@@ -222,7 +225,7 @@ class StatementEntry extends AppModel {
// Record the reversal transaction
$result = $this->Transaction->addReversal
($charge, $stamp, 'Charge Reversal');
($charge, $stamp, $comment ? $comment : 'Charge Reversal');
if (empty($result['error'])) {
// Mark the charge as reversed