45 lines
1.1 KiB
PHP
Executable file
45 lines
1.1 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'
|
|
)
|
|
);
|
|
|
|
}
|
|
?>
|