Example #1
0
 /**
  * Get settings array
  *
  * @return array
  */
 public function get_settings()
 {
     $fields = array(array('title' => __('General Options', 'erp'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'), array('title' => __('Company Start Date', 'wp-erp'), 'id' => 'gen_com_start', 'type' => 'text', 'desc' => __('The date the company officially started.', 'wp-erp'), 'class' => 'erp-date-field', 'tooltip' => true), array('title' => __('Financial Year Starts', 'wp-erp'), 'id' => 'gen_financial_month', 'type' => 'select', 'options' => erp_months_dropdown(), 'desc' => __('Financial and tax calculation starts from this month of every year.', 'wp-erp'), 'tooltip' => false), array('title' => __('Date Format', 'wp-erp'), 'id' => 'date_format', 'desc' => __('Format of date to show accross the system.', 'wp-erp'), 'tooltip' => true, 'type' => 'select', 'options' => ['m-d-Y' => 'mm-dd-yyyy', 'd-m-Y' => 'dd-mm-yyyy', 'm/d/Y' => 'mm/dd/yyyy', 'd/m/Y' => 'dd/mm/yyyy', 'Y-m-d' => 'yyyy-mm-dd']), array('title' => __('Enable Debug Mode', 'wp-erp'), 'id' => 'erp_debug_mode', 'type' => 'select', 'options' => [1 => __('On', 'wp-erp'), 0 => __('Off', 'wp-erp')], 'desc' => __('Switching testing or producting mode', 'wp-erp'), 'tooltip' => true, 'default' => 0), array('type' => 'sectionend', 'id' => 'script_styling_options'));
     // End general settings
     return apply_filters('erp_settings_general', $fields);
 }
Example #2
0
    public function setup_step_basic()
    {
        $general = get_option('erp_settings_general', array());
        $accounting = get_option('erp_settings_accounting', array());
        $financial_month = isset($general['gen_financial_month']) ? $general['gen_financial_month'] : '1';
        $company_started = isset($general['gen_com_start']) ? $general['gen_com_start'] : '';
        ?>
        <h1><?php 
        _e('Basic Settings', 'wp-erp');
        ?>
</h1>

        <form method="post">

            <table class="form-table">
                <tr>
                    <th scope="row"><label for="gen_financial_month"><?php 
        _e('Financial Year Starts', 'wp-erp');
        ?>
</label></th>
                    <td>
                        <?php 
        erp_html_form_input(['name' => 'gen_financial_month', 'id' => 'gen_financial_month', 'type' => 'select', 'value' => $financial_month, 'options' => erp_months_dropdown(), 'help' => __('Financial and tax calculation starts from this month of every year.', 'wp-erp')]);
        ?>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><label for="gen_com_start"><?php 
        _e('Company Start Date', 'wp-erp');
        ?>
</label></th>
                    <td>
                        <?php 
        erp_html_form_input(['name' => 'gen_com_start', 'type' => 'text', 'value' => $company_started, 'help' => __('The date the company officially started.', 'wp-erp'), 'class' => 'erp-date-field', 'placeholder' => 'YYYY-MM-DD']);
        ?>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><label for="base_currency"><?php 
        _e('Currency', 'wp-erp');
        ?>
</label></th>
                    <td>
                        <?php 
        erp_html_form_input(['name' => 'base_currency', 'type' => 'select', 'value' => 'USD', 'options' => erp_get_currencies(), 'desc' => __('Format of date to show accross the system.', 'wp-erp')]);
        ?>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><label for="date_format"><?php 
        _e('Date Format', 'wp-erp');
        ?>
</label></th>
                    <td>
                        <?php 
        erp_html_form_input(['name' => 'date_format', 'type' => 'select', 'value' => 'd-m-Y', 'options' => ['m-d-Y' => 'mm-dd-yyyy', 'd-m-Y' => 'dd-mm-yyyy', 'm/d/Y' => 'mm/dd/yyyy', 'd/m/Y' => 'dd/mm/yyyy', 'Y-m-d' => 'yyyy-mm-dd'], 'help' => __('Format of date to show accross the system.', 'wp-erp')]);
        ?>
                    </td>
                </tr>
            </table>

            <?php 
        $this->next_step_buttons();
        ?>
        </form>
        <?php 
    }