function uc_tax_report_params_form in Ubercart 6.2
Same name and namespace in other branches
- 5 uc_tax_report/uc_tax_report.module \uc_tax_report_params_form()
- 7.3 uc_tax_report/uc_tax_report.admin.inc \uc_tax_report_params_form()
Form for parameters on the tax report.
See also
uc_tax_report_params_form_validate()
uc_tax_report_params_form_submit()
1 string reference to 'uc_tax_report_params_form'
- uc_tax_report_report_page in uc_tax_report/
uc_tax_report.admin.inc - Displays the sales tax report form and table.
File
- uc_tax_report/
uc_tax_report.admin.inc, line 194 - Displays sales tax report.
Code
function uc_tax_report_params_form($form_state, $values) {
$form = array();
// Site time minus GMT time, in seconds
$timezone_offset = _uc_reports_timezone_offset();
$form['params'] = array(
'#type' => 'fieldset',
'#title' => t('Customize tax report parameters'),
'#description' => t('Adjust these values and update the report to build your sales tax report. Once submitted, the report may be bookmarked for easy reference in the future.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['params']['start_date'] = array(
'#type' => 'date',
'#title' => t('Start date'),
'#default_value' => array(
'month' => format_date($values['start_date'], 'custom', 'n', $timezone_offset),
'day' => format_date($values['start_date'], 'custom', 'j', $timezone_offset),
'year' => format_date($values['start_date'], 'custom', 'Y', $timezone_offset),
),
);
$form['params']['end_date'] = array(
'#type' => 'date',
'#title' => t('End date'),
'#default_value' => array(
'month' => format_date($values['end_date'], 'custom', 'n', $timezone_offset),
'day' => format_date($values['end_date'], 'custom', 'j', $timezone_offset),
'year' => format_date($values['end_date'], 'custom', 'Y', $timezone_offset),
),
);
$options = array();
foreach (uc_order_status_list() as $status) {
$options[$status['id']] = $status['title'];
}
$stat = $values['status'];
if ($stat === FALSE) {
$stat = variable_get('uc_reports_reported_statuses', array(
'completed',
));
}
$form['params']['status'] = array(
'#type' => 'select',
'#title' => t('Order statuses'),
'#description' => t('Only orders with selected statuses will be included in the report.') . '<br />' . t('Hold Ctrl + click to select multiple statuses.'),
'#options' => $options,
'#default_value' => $stat,
'#multiple' => TRUE,
'#size' => 5,
);
$form['params']['submit'] = array(
'#type' => 'submit',
'#value' => t('Update report'),
);
return $form;
}