Source for file specialcosts.php
Documentation is available at specialcosts.php
* Special costs for project/instrument usage editing
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
require_once 'inc/bb/configreader.php';
require_once 'inc/formslib/dbrow.php';
require_once 'inc/formslib/idfield.php';
require_once 'inc/formslib/textfield.php';
require_once 'inc/formslib/referencefield.php';
require_once 'inc/formslib/joindata.php';
* Special costs for project/instrument usage editing
$this->DBRow('projectrates', $project, 'projectid');
$this->restriction =
'instrid='.
qw($instrument).
' AND projectid='.
qw($project);
//$this->use2StepSync = 1;
$f->extraInfo('projects', 'id', 'name');
$f->duplicateName =
'project';
$f->extraInfo('instruments', 'id', 'name');
$f->duplicateName =
'instrument';
'costsettings', T_('Charging settings:'));
//$f->protoRow->DEBUG = 10;
$f->protoRow->autonumbering =
1;
$f->reportFields[] =
array('id' =>
'rate');
$rate =
new IdField('id', T_('Rate ID'), T_('Rate ID'));
sprintf($conf->value('language', 'money_format', '$%s'), '')),
T_('Cost of instrument use for a full day'), false);
$attrs =
array('size' =>
'6');
'precision' =>
$conf->value('language', 'money_decimal_places', 2))));
$hours=
new TextField('hourfactor', T_('Hourly rate multiplier'),
T_('Proportion of daily rate charged per hour'));
$attrs =
array('size' =>
'6', 'float' =>
true, 'precision' =>
3);
$halfs=
new TextField('halfdayfactor', T_('Half-day rate multiplier'),
T_('Proportion of daily rate charged per half-day'));
$discount=
new TextField('dailymarkdown', T_('Daily bulk discount %'),
T_('Discount for each successive day's booking'));
$discount->setAttr($attrs);
$f->addElement($discount);
$f->joinSetup('id', array('total' =>
1));
function delete($unused=
null) {
//delete our association in the costing table first
$result =
$this->fields['costsettings']->rows[0]->delete();
//then gracefully delete ourselves
Documentation generated on Tue, 06 Mar 2007 10:01:58 +0000 by phpDocumentor 1.3.0