<td>
                                    </td>
                                    <?php 
        if ($show_task_dates) {
            ?>

                                    <td>
                                    </td>
                                    <?php 
        }
        ?>

                                    <td colspan="2">
                                        <?php 
        $types = module_job::get_task_types();
        $types['-1'] = _l('Default (%s)', $types[$invoice['default_task_type']]);
        module_form::generate_form_element(array('type' => 'select', 'name' => 'invoice_invoice_item[' . $invoice_item_id . '][manual_task_type]', 'id' => 'manual_task_type_' . $invoice_item_id, 'options' => $types, 'blank' => false, 'value' => $invoice_item_data['manual_task_type_real']));
        ?>

                                    </td>
                                    <td colspan="2">
                                        <input type="hidden" name="invoice_invoice_item[<?php 
        echo $invoice_item_id;
        ?>
][taxable_t]" value="1">
                                        <input type="checkbox" name="invoice_invoice_item[<?php 
        echo $invoice_item_id;
        ?>
][taxable]" id="invoice_taxable_item_<?php 
        echo $invoice_item_id;
					    <input type="button" name="i" id="insert_saved" value="<?php 
            _e('Insert');
            ?>
"
					           class="task_defaults small_button">
					    <input type="hidden" name="default_tasks_action" id="default_tasks_action" value="0">
					    <?php 
            _h('Here you can save the current tasks as defaults to be used later, or insert a previously saved set of defaults.');
        }));
    }
    //
    if (module_config::c('job_show_task_numbers', 1)) {
        $fieldset_data['elements'][] = array('title' => 'Task Numbers', 'field' => array('type' => 'select', 'options' => array(0 => _l('Automatic'), 1 => _l('Manual'), 2 => _l('Hidden')), 'name' => 'auto_task_numbers', 'value' => $job['auto_task_numbers']));
    }
    $fieldset_data['elements'][] = array('title' => 'Task Type', 'field' => array('type' => 'select', 'options' => module_job::get_task_types(), 'name' => 'default_task_type', 'value' => isset($job['default_task_type']) ? $job['default_task_type'] : 0, 'help' => 'The default is hourly rate + amount. This will show the "Hours" column along with an "Amount" column. Inputing a number of hours will auto complete the price based on the job hourly rate. <br>Quantity and Amount will allow you to input a Quantity (eg: 2) and an Amount (eg: $100) and the final price will be $200 (Quantity x Amount). The last option "Amount Only" will just have the amount column for manual input of price. Change the advanced setting "default_task_type" between 0, 1 and 2 to change the default here.'));
    $fieldset_data['elements'][] = array('title' => 'Discount Amount', 'fields' => array(function () use($job_id, &$job) {
        echo !module_security::is_page_editable() ? '<span class="currency">' . dollar($job['discount_amount'], true, $job['currency_id']) . '</span>' : currency('<input type="text" name="discount_amount" value="' . number_out($job['discount_amount']) . '" class="currency">');
        echo ' ';
    }, array('type' => 'html', 'value' => '', 'help' => 'Here you can apply a before tax discount to this job. You can name this anything, eg: DISCOUNT, CREDIT, REFUND, etc..')));
    $fieldset_data['elements'][] = array('title' => 'Discount Name', 'fields' => array(function () use($job_id, &$job) {
        echo !module_security::is_page_editable() ? htmlspecialchars(_l($job['discount_description'])) : '<input type="text" name="discount_description" value="' . htmlspecialchars(_l($job['discount_description'])) . '" style="width:80px;">';
    }));
    $fieldset_data['elements'][] = array('title' => 'Discount Type', 'field' => array('type' => 'select', 'options' => array('0' => _l('Before Tax'), 1 => _l('After Tax')), 'name' => 'discount_type', 'value' => $job['discount_type']));
    if (class_exists('module_job_discussion', false) && isset($job['job_discussion']) && module_job_discussion::is_plugin_enabled()) {
        $fieldset_data['elements'][] = array('title' => 'Job Discussion', 'field' => array('type' => 'select', 'options' => array(0 => _l('Allowed'), 1 => _l('Disabled & Hidden'), 2 => _l('Disabled & Shown')), 'name' => 'job_discussion', 'value' => isset($job['job_discussion']) ? $job['job_discussion'] : 0));
    }
    if ((int) $job_id > 0 && module_invoice::can_i('create', 'Invoices')) {
        $fieldset_data['elements'][] = array('title' => 'Job Deposit', 'fields' => array(array('type' => 'currency', 'name' => 'job_deposit', 'value' => ''), array('type' => 'submit', 'name' => 'butt_create_deposit', 'value' => 'Create Deposit Invoice', 'class' => 'exit_button small_button', 'help' => 'Enter a dollar value here to create a deposit invoice for this job. Also supports entering a percentage (eg: 20%%)')));
    }
    $fieldset_data['elements'][] = array('title' => 'Job Completed', 'fields' => array(array('type' => 'text', 'name' => 'total_percent_complete_override', 'value' => $job['total_percent_complete_manual'] ? $job['total_percent_complete'] * 100 : '', 'style' => 'width:30px;'), '%', $job['total_percent_complete_manual'] ? _l('(calculated: %s%%)', $job['total_percent_complete_calculated'] * 100) : '', array('type' => 'html', 'value' => '', 'help' => 'Enter a manual job "percent completed" here and this will be used instead of the automatically calculated value.')));
                            <?php 
    }
    ?>

                    </td>

                    <tr>
                        <th>
                            <?php 
    _e('Task Type');
    ?>

                        </th>
                        <td>
                            <?php 
    echo print_select_box(module_job::get_task_types(), 'default_task_type', isset($job['default_task_type']) ? $job['default_task_type'] : 0, '', false);
    ?>

                            <?php 
    _h('The default is hourly rate + amount. This will show the "Hours" column along with an "Amount" column. Inputing a number of hours will auto complete the price based on the job hourly rate. <br>Quantity and Amount will allow you to input a Quantity (eg: 2) and an Amount (eg: $100) and the final price will be $200 (Quantity x Amount). The last option "Amount Only" will just have the amount column for manual input of price. Change the advanced setting "default_task_type" between 0, 1 and 2 to change the default here.');
    ?>


                        </td>
                    </tr>
		            <tr>
		                <th>
		                    <?php 
    _e('Discount Amount');
    ?>
Exemple #4
0
 public static function get_task_types()
 {
     return module_job::get_task_types();
 }