Files
pmgr/models/transaction.php
abijah 58d3cbf66b First pass at entering charges for a lease. This works, but does not have the ability to add multiple charges, and does not mirror the payment method, which is ajax based.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@231 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-07-06 18:34:44 +00:00

32 lines
617 B
PHP

<?php
class Transaction extends AppModel {
var $name = 'Transaction';
/* var $validate = array( */
/* 'stamp' => array('date') */
/* ); */
var $belongsTo = array(
);
var $hasMany = array(
'LedgerEntry',
);
function beforeSave() {
if(isset($this->data['Transaction']['stamp']) &&
$this->data['Transaction']['stamp'] !== 'CURRENT_TIMESTAMP') {
$this->data['Transaction']['stamp'] =
$this->dateFormatBeforeSave($this->data['Transaction']['stamp']);
}
else {
$this->data['Transaction']['stamp'] = null;
}
return parent::beforeSave();
}
}
?>