Ejemplo n.º 1
0
/**
 * [erp_get_currencies_dropdown description]
 *
 * @param  string  [description]
 *
 * @return string
 */
function erp_get_currencies_dropdown($selected = '')
{
    $options = '';
    $currencies = erp_get_currencies();
    foreach ($currencies as $key => $value) {
        $select = $key == $selected ? ' selected="selected"' : '';
        $options .= sprintf("<option value='%s'%s>%s</option>\n", esc_attr($key), $select, $value);
    }
    return $options;
}
Ejemplo n.º 2
0
 /**
  * Get sections fields
  *
  * @return array
  */
 public function get_settings()
 {
     $fields = array(array('title' => __('Accounting Settings', 'erp-accounting'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'), array('title' => __('Home Currency', 'erp-accounting'), 'id' => 'base_currency', 'desc' => __('The base currency of the system.', 'erp-accounting'), 'type' => 'select', 'options' => erp_get_currencies()), array('title' => __('Date Format', 'erp-accounting'), 'id' => 'date_format', 'desc' => __('Format of date to show accross accounting system.', 'erp-accounting'), '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('type' => 'sectionend', 'id' => 'script_styling_options'));
     // End general settings
     return apply_filters('erp_ac_settings_general', $fields);
 }
Ejemplo n.º 3
0
    <li class="erp-form-field row-street-1">
        <?php 
erp_html_form_input(array('label' => __('Street', 'erp-accounting'), 'name' => 'street_1', 'id' => 'street_1', 'required' => false, 'type' => 'text', 'placeholder' => __('Street', 'erp-accounting'), 'class' => 'regular-text', 'value' => isset($item->street_1) ? $item->street_1 : ''));
?>
    </li>
    <li class="erp-form-field row-city">
        <?php 
erp_html_form_input(array('label' => __('City', 'erp-accounting'), 'name' => 'city', 'id' => 'city', 'required' => false, 'type' => 'text', 'placeholder' => __('City/Town', 'erp-accounting'), 'class' => 'regular-text', 'value' => isset($item->city) ? $item->city : ''));
?>
    </li>
    <li class="erp-form-field row-state">
        <?php 
erp_html_form_input(array('label' => __('State', 'erp-accounting'), 'name' => 'state', 'id' => 'state', 'required' => false, 'type' => 'text', 'placeholder' => __('State/Province', 'erp-accounting'), 'class' => 'regular-text', 'value' => isset($item->state) ? $item->state : ''));
?>
    </li>
    <li class="erp-form-field row-postal-code">
        <?php 
erp_html_form_input(array('label' => __('Post Code', 'erp-accounting'), 'name' => 'postal_code', 'id' => 'postal_code', 'required' => false, 'type' => 'text', 'placeholder' => __('Postal Code', 'erp-accounting'), 'class' => 'regular-text', 'value' => isset($item->postal_code) ? $item->postal_code : ''));
?>
    </li>
    <li class="erp-form-field row-country">
        <?php 
erp_html_form_input(array('label' => __('Country', 'erp-accounting'), 'name' => 'country', 'id' => 'country', 'required' => false, 'type' => 'text', 'placeholder' => __('Country', 'erp-accounting'), 'class' => 'regular-text', 'value' => isset($item->country) ? $item->country : ''));
?>
    </li>
    <li class="erp-form-field row-currency">
        <?php 
erp_html_form_input(array('label' => __('User Currency', 'erp-accounting'), 'name' => 'currency', 'id' => 'currency', 'required' => false, 'type' => 'select', 'options' => erp_get_currencies(), 'value' => isset($item->currency) ? $item->currency : ''));
?>
    </li>
</ul>
Ejemplo n.º 4
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 
    }