コード例 #1
0
ファイル: call-unbilled.php プロジェクト: sayemk/a2billing
end($SEL_Form->model)->fieldexpr = 'starttime';
$SEL_Form->model[] = new DateTimeField(_("Period to"), 'date_to');
end($SEL_Form->model)->does_add = false;
end($SEL_Form->model)->def_date = 'now';
end($SEL_Form->model)->fieldexpr = 'starttime';
$SEL_Form->model[] = new SqlRefFieldN(_("Agent"), 'agentid', 'cc_agent', 'id', 'name');
end($SEL_Form->model)->does_add = false;
$SEL_Form->search_exprs['date_from'] = '>=';
$SEL_Form->search_exprs['date_to'] = '<=';
$PAGE_ELEMS[] =& $SEL_Form;
// HelpElem::DoHelp(gettext("*-*"),'vcard.png');
$sform = new FormHandler('cc_call, cc_card, cc_card_group', _("Calls"), _("Call"));
$sform->checkRights(ACX_INVOICING);
$sform->init(null, false);
$sform->views['sums'] = new SumMultiView();
$sform->setAction('sums');
if ($FG_DEBUG) {
    $sform->views['dump-form'] = new DbgDumpView();
}
$SEL_Form->appendClauses($sform);
$sform->model[] = new FreeClauseField('cc_call.cardid = cc_card.id');
$sform->model[] = new FreeClauseField('cc_card.grp = cc_card_group.id');
$sform->model[] = new FreeClauseField('cc_call.invoice_id IS NULL');
$sform->model[] = new DateField(_("Start"), 'starttime');
$sform->model[] = new DateField(_("End"), 'endtime');
end($sform->model)->fieldexpr = 'starttime';
$sform->model[] = new IntField(_("Calls"), 'uniqueid');
$sform->model[] = new SecondsField(_("Duration"), "sessiontime");
end($sform->model)->fieldacr = _("Dur");
//$Sum_Form->model[] = new FloatField(_("Credit"), "pos_charge");
$sform->model[] = new MoneyField(_("Bill"), "sessionbill");
コード例 #2
0
ファイル: invoices_card.php プロジェクト: sayemk/a2billing
$tmp->Form->model[] = new DateTimeField(_("Time"), 'starttime');
$tmp->Form->model[] = new TextField(_("Number"), 'calledstation');
$tmp->Form->model[] = new TextField(_("Destination"), 'destination');
$tmp->Form->model[] = new SecondsField(_("Duration"), 'sessiontime');
end($tmp->Form->model)->fieldacr = _("Dur");
//$tmp->Form->model[] = new PKeyFieldTxt(_("ID"),'id');
$tmp->Form->model[] = new MoneyField(_("Bill"), 'sessionbill');
//one non-summed group
$tmp->Form->views['list']->sums[] = array('fns' => array('starttime' => true, 'calledstation' => true, 'destination' => true, 'sessiontime' => true, 'sessionbill' => true), 'order' => 'starttime');
//Per day/destination
$tmp->Form->views['list']->sums[] = array('title' => _("Sum per destination"), 'fns' => array('starttime' => false, 'destination' => true, 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'), 'order' => 'sessiontime', 'sens' => 'DESC');
$tmp->Form->views['list']->sums[] = array('title' => _("Total"), 'fns' => array('calledstation' => 'COUNT', 'sessiontime' => 'SUM', 'sessionbill' => 'SUM'));
$hform = new FormHandler('cc_card');
$hform->checkRights(ACX_INVOICING);
$hform->init(null, false);
$hform->setAction('details');
$hform->views['details'] = new DetailsView();
$hform->model[] = new FreeClauseField(str_dbparams(A2Billing::DBHandle(), 'id = (SELECT cardid FROM cc_invoices WHERE id = %#1)', array($dform->getpost_dirty('id'))));
//$hform->model[] = new PKeyField(_("ID"),'id');
$hform->model[] = new TextField(_("Local number"), 'useralias');
$hform->model[] = new TextFieldN(_("First name"), 'firstname');
$hform->model[] = new TextFieldN(_("Last name"), 'lastname');
$hform->model[] = new TextAreaField(_("Address"), 'address');
$hform->model[] = new TextFieldN(_("City"), 'city');
$hform->model[] = new TextFieldN(_("State"), 'state');
$hform->model[] = new TextFieldN(_("Country"), 'country');
$hform->model[] = new TextFieldN(_("Zipcode"), 'zipcode');
//$hform->model[] = new TextFieldN(_("Phone"),'phone');
$hform->model[] = new TextFieldN(_("Fax"), 'fax');
$PAGE_ELEMS[] =& $hform;
$PAGE_ELEMS[] =& $dform;
コード例 #3
0
ファイル: netmon_stats.php プロジェクト: sayemk/a2billing
$SEL_Form->fallbackClause = array('date_from');
/*$SEL_Form->model[] = new SqlRefFieldN(_("Agent"),'agentid','cc_agent','id','name');
	end($SEL_Form->model)->does_add = false;*/
$SEL_Form->search_exprs['date_from'] = '>=';
$SEL_Form->search_exprs['date_to'] = '<=';
//$SEL_Form->model[] = new SqlRefField(_("System"),'sysid','nm.system','id','name');
$SEL_Form->model[] = new SqlRefField(_("Node"), "par_id", "nm.attr_node", "id", "name");
end($SEL_Form->model)->combofield = "nm.full_name_attr(id)";
if ($sform->getAction() != 'printing') {
    $PAGE_ELEMS[] =& $SEL_Form;
}
// HelpElem::DoHelp(gettext("*-*"),'vcard.png');
$sform->views['idle'] = new IdleView();
$sform->views['printing'] = new IdleView();
if ($sform->getAction() == 'list') {
    $sform->setAction('idle');
}
$sform->views['sums'] = new SumMultiView();
if ($FG_DEBUG) {
    $sform->views['dump-form'] = new DbgDumpView();
}
$SEL_Form->appendClauses($sform);
$sform->model[] = new DateTimeField(_("Date"), 'tstamp');
end($sform->model)->fieldexpr = 'date_trunc(%trunc, tstamp)';
$sform->model[] = new FloatField(_("Value"), 'value');
// repeat the columns, so that we use other aggregates
$sform->model[] = new FloatField(_("Value"), 'value_min');
end($sform->model)->fieldexpr = 'value';
$sform->model[] = new FloatField(_("Value"), 'value_max');
end($sform->model)->fieldexpr = 'value';
/*$sform->model[] = new SecondsField(_("Average Length of Calls"), "aloc");