<?php

/**
 * inoERP
 *
 * @copyright   2014 Nishit R. Das
 * @license     https://www.mozilla.org/MPL/2.0/
 * @link        http://inoideas.org
 * @source code https://github.com/inoerp/inoERP
 */

/**
 * 
 *
 */
class ec_control extends dbObject {

 public static $table_name = "ec_control";
 public static $primary_column = "";
 public static $key_column = 'site_name';
 public static $module = "extension";
 public static $system_info = [
  'name' => 'eCommerce Control',
  'number' => '4204',
  'description' => 'eCommerce Control',
  'version' => '0.1.1',
  'db_version' => '1001',
  'mod_version' => '1.1.1',
  'primary_entity_cb' => '',
  'module_name' => 'ec',
  'weight' => 21
 ];
 public $field_a = [
  'default_home_page',
  'site_name',
  'price_round',
  'tax_code_id',
  'shipping_org_id',
  'bu_org_id',
  'sales_document_type',
  'order_source_type',
  'payment_term_id',
  'exchange_rate_type',
  'line_type',
  'email_template',
  'send_email_cb',
  'email_cc',
  'last_update_by',
  'last_update_date',
 ];
 public $requiredField = [
  'shipping_org_id',
  'bu_org_id',
  'sales_document_type',
 ];
 public $pageTitle = "eCommerce Controls "; //page Title
 public $default_home_page;
 public $site_name;
 public $price_round;
 public $tax_code_id;
 public $shipping_org_id;
 public $bu_org_id;
 public $sales_document_type;
 public $line_type;
 public $order_source_type;
 public $payment_term_id;
 public $exchange_rate_type;
 public $email_template;
 public $send_email_cb;
 public $email_cc;
 public $last_update_by;
 public $last_update_date;

 public function findAll_singleRecord_db() {
  $sql = " SELECT * FROM  ";
  $sql .= self::$table_name;
  switch (DB_TYPE) {
   case 'ORACLE' :
    $sql .= ' AND ' . ino_perPageSql(1);
    break;

   default:
    $sql .= ino_perPageSql(1);
    break;
  }
  $result = $this->findBySql($sql);
  return !empty($result) ? array_pop($result) : $this;
 }

 Public function save_onWebForm() {
  $this->save_singeRecord_db();
 }

}

//end of path class
?>