Added a flag to accounts, indicating whether they can be used for charges and/or payments. Invoice has already switch to this mechanism, but we're keeping receipt the same for now since I have bigger fish to fry.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@247 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-07 07:52:41 +00:00
parent ae85ed7907
commit 9c65d408fa
3 changed files with 35 additions and 47 deletions

View File

@@ -357,16 +357,6 @@ class CustomersController extends AppController {
*/
function receipt($id = null) {
/* if (!$id) { */
/* $this->Session->setFlash(__('Invalid Item.', true)); */
/* $this->redirect(array('action'=>'index')); */
/* } */
/* if ($this->RequestHandler->isPost()) { */
/* pr($this->data); */
/* //$this->redirect(array('action'=>'index')); */
/* $customer = $this->data; */
/* } */
if (isset($id)) {
$this->Customer->recursive = -1;
$customer = $this->Customer->read(null, $id);
@@ -379,6 +369,11 @@ class CustomersController extends AppController {
$charges = array('balance' => 0, 'entry' => array());
}
$A = new Account();
$payment_accounts = $A->paymentAccounts();
$default_account = $A->cashAccountID();
$this->set(compact('payment_accounts', 'default_account'));
$title = ($customer['name'] . ': Payment Entry');
$this->set(compact('customer', 'charges', 'title'));
}