<?php
class ShipmentInvoice extends AppModel {

	var $name = 'ShipmentInvoice';
	var $validate = array(
		'shipment_id' => array('numeric'),
		'principle_id' => array('numeric'),
		'currency_id' => array('numeric'),
		'invoice_number' => array('notempty'),
		'approved' => array('numeric')
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Shipment' => array(
			'className' => 'Shipment',
			'foreignKey' => 'shipment_id',
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'counterCache'=>true
		),
		'Principle' => array(
			'className' => 'Principle',
			'foreignKey' => 'principle_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),

		'FreightForwarder' => array(
			'className' => 'FreightForwarder',
			'foreignKey' => 'freight_forwarder_id'
		),
		'Currency' => array(
			'className' => 'Currency',
			'foreignKey' => 'currency_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

}
?>