Implemented ability to add a customer, and fixed the problem with flagging of the primary contact.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@220 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-06 03:01:28 +00:00
parent 09cb297dc7
commit 3e60f8d45e
4 changed files with 49 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ class CustomersController extends AppController {
array('name' => 'Current', 'url' => array('controller' => 'customers', 'action' => 'current')),
array('name' => 'Past', 'url' => array('controller' => 'customers', 'action' => 'past')),
array('name' => 'All', 'url' => array('controller' => 'customers', 'action' => 'all')),
array('name' => 'Add Tenant', 'url' => array('controller' => 'customers', 'action' => 'add')),
);
//var $components = array('RequestHandler');
@@ -286,6 +287,9 @@ class CustomersController extends AppController {
return;
}
$this->data['Customer']['primary_contact_id']
= $this->data['Contact'][$this->data['Customer']['primary_contact_entry']]['id'];
$this->Customer->create();
if (!$this->Customer->save($this->data, false)) {
pr("CUSTOMER SAVE FAILED");
@@ -367,6 +371,7 @@ class CustomersController extends AppController {
*/
function add() {
$this->edit();
}
/**************************************************************************