?> <input type="hidden" name="hourly_rate" value="<?php echo htmlspecialchars($invoice['hourly_rate']); ?> " /> <input type="hidden" name="_redirect" value="" id="form_redirect" /> <?php $fields = array('fields' => array('name' => 'Name')); module_form::set_required($fields); module_form::prevent_exit(array('valid_exits' => array('.submit_button', '.save_invoice_item', '.save_invoice_payment', '.delete', '.apply_discount'))); hook_handle_callback('layout_column_half', 1, '35'); /* INVOICE DETAILS */ $fieldset_data = array('heading' => array('type' => 'h3', 'title' => 'Invoice Details'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array(array('title' => 'Invoice #', 'field' => array('type' => 'text', 'name' => 'name', 'value' => $invoice['name'])), array('title' => 'Status', 'field' => array('type' => 'select', 'name' => 'status', 'value' => $invoice['status'], 'blank' => false, 'options' => module_invoice::get_statuses(), 'allow_new' => true)), array('title' => 'Created Date', 'field' => array('type' => 'date', 'name' => 'date_create', 'value' => print_date($invoice['date_create']))), array('title' => 'Due Date', 'fields' => array(array('type' => 'date', 'name' => 'date_due', 'value' => print_date($invoice['date_due'])), array('type' => 'checkbox', 'name' => 'overdue_email_auto', 'value' => isset($invoice['overdue_email_auto']) && $invoice['overdue_email_auto'], 'label' => 'Auto Overdue Email', 'help' => 'When this Invoice becomes overdue an email will be automatically sent to the customer. Settings > Invoice for more options.'))), array('title' => 'Sent Date', 'hidden' => !(int) $invoice_id, 'field' => array('type' => 'date', 'name' => 'date_sent', 'id' => 'date_sent', 'value' => print_date($invoice['date_sent']))), array('title' => 'Paid Date', 'hidden' => !(int) $invoice_id, 'field' => array('type' => 'date', 'name' => 'date_paid', 'value' => print_date($invoice['date_paid']), 'help' => 'To mark an invoice as paid please record a full payment against this invoice. Once that is done you can adjust the date here.'))), 'extra_settings' => array('owner_table' => 'invoice', 'owner_key' => 'invoice_id', 'owner_id' => $invoice['invoice_id'], 'layout' => 'table_row', 'allow_new' => module_invoice::can_i('create', 'Invoices'), 'allow_edit' => module_invoice::can_i('edit', 'Invoices'))); $incrementing = false; if (!isset($invoice['taxes']) || !count($invoice['taxes'])) { $invoice['taxes'][] = array(); // at least have 1? } foreach ($invoice['taxes'] as $tax) { if (isset($tax['increment']) && $tax['increment']) { $incrementing = true; } } ob_start(); ?> <span class="invoice_tax_increment"> <input type="checkbox" name="tax_increment_checkbox" id="tax_increment_checkbox" value="1" <?php
$header['button'] = array('url' => module_invoice::link_open('new'), 'title' => _l('New Manual Invoice'), 'type' => 'add'); } print_heading($header); ?> <form action="" method="post"> <?php module_form::print_form_auth(); ?> <?php $search_bar = array('elements' => array('name' => array('title' => _l('Invoice Number:'), 'field' => array('type' => 'text', 'name' => 'search[generic]', 'value' => isset($search['generic']) ? $search['generic'] : '')), 'date' => array('title' => _l('Create Date:'), 'fields' => array(array('type' => 'date', 'name' => 'search[date_from]', 'value' => isset($search['date_from']) ? $search['date_from'] : ''), _l('to'), array('type' => 'date', 'name' => 'search[date_to]', 'value' => isset($search['date_to']) ? $search['date_to'] : ''))), 'status' => array('title' => _l('Status:'), 'field' => array('type' => 'select', 'name' => 'search[status]', 'value' => isset($search['status']) ? $search['status'] : '', 'options' => module_invoice::get_statuses())))); if (!isset($_REQUEST['customer_id']) && class_exists('module_group', false) && module_customer::can_i('view', 'Customer Groups')) { $search_bar['elements']['group'] = array('title' => _l('Customer Group:'), 'field' => array('type' => 'select', 'name' => 'search[customer_group_id]', 'value' => isset($search['customer_group_id']) ? $search['customer_group_id'] : '', 'options' => module_group::get_groups('customer'), 'options_array_id' => 'name')); } echo module_form::search_bar($search_bar); /** START TABLE LAYOUT **/ $colspan = 9; $colspan2 = 0; $table_manager = module_theme::new_table_manager(); $columns = array(); $columns['invoice_number'] = array('title' => 'Invoice Number', 'callback' => function ($invoice) { echo module_invoice::link_open($invoice['invoice_id'], true, $invoice); }, 'cell_class' => 'row_action'); $columns['invoice_status'] = array('title' => 'Status', 'callback' => function ($invoice) { echo htmlspecialchars($invoice['status']); });
<?php echo module_invoice::link_open($invoice['credit_note_id'], true); ?> </td> </tr> <tr> <th> <?php echo _l('Status'); ?> </th> <td> <?php echo print_select_box(module_invoice::get_statuses(), 'status', $invoice['status'], '', true, false, true); ?> </td> </tr> <tr> <th> <?php echo _l('Created Date'); ?> </th> <td> <input type="text" name="date_create" class="date_field" value="<?php echo print_date($invoice['date_create']); ?>
</td> <td> <input type="text" name="search[generic]" value="<?php echo isset($search['generic']) ? htmlspecialchars($search['generic']) : ''; ?> " size="30"> </td> <td width="30"> <?php echo _l('Status:'); ?> </td> <td> <?php echo print_select_box(module_invoice::get_statuses(), 'search[status]', isset($search['status']) ? $search['status'] : ''); ?> </td> <td class="search_action"> <?php echo create_link("Reset", "reset", module_invoice::link_open(false)); ?> <?php echo create_link("Search", "submit"); ?> </td> </tr> </table>