cmc-sales/models/invoice.php
2011-03-14 11:21:56 +11:00

54 lines
1.2 KiB
PHP
Executable file

<?php
class Invoice extends AppModel {
var $name = 'Invoice';
// var $recursive = 2;
var $validate = array(
'issue_date' => array('date'),
'due_date' => array('date'),
'title' => array('notempty'),
'paid' => array('numeric'),
'enquiry_id' => array('numeric'),
'user_id' => array('numeric')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Enquiry' => array(
'className' => 'Enquiry',
'foreignKey' => 'enquiry_id',
'conditions' => '',
'fields' => '',
'order' => '',
'counterCache'=>true
),
'User' => array(
'className' => 'User',
'foreignKey' => 'user_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Customer' => array(
'className' => 'Customer',
'foreignKey' => 'customer_id'
),
'Job' => array(
'className' => 'Job',
'foreignKey' => 'job_id'
)
);
var $hasAndBelongsToMany = array(
'Email' => array(
'className' => 'Email',
'joinTable' => 'emails_invoices',
)
);
}
?>