Example #1
0
 /**
  * Returns all the column names of this table
  *
  * @return array
  */
 static function &fields()
 {
     if (!self::$_fields) {
         self::$_fields = array('id' => array('name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Line Item ID'), 'description' => 'Line Item', 'required' => true), 'entity_table' => array('name' => 'entity_table', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Line Item Entity Type'), 'description' => 'table which has the transaction', 'required' => true, 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG), 'entity_id' => array('name' => 'entity_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Line Item Entity'), 'description' => 'entry in table', 'required' => true), 'contribution_id' => array('name' => 'contribution_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Line Item Contribution'), 'description' => 'FK to civicrm_contribution', 'FKClassName' => 'CRM_Contribute_DAO_Contribution'), 'price_field_id' => array('name' => 'price_field_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Line Item Price Field'), 'description' => 'FK to civicrm_price_field', 'FKClassName' => 'CRM_Price_DAO_PriceField'), 'label' => array('name' => 'label', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Line Item Label'), 'description' => 'descriptive label for item - from price_field_value.label', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'default' => 'NULL', 'html' => array('type' => 'Text')), 'qty' => array('name' => 'qty', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Line Item Quantity'), 'description' => 'How many items ordered', 'required' => true, 'precision' => array(20, 2), 'html' => array('type' => 'Text')), 'unit_price' => array('name' => 'unit_price', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Unit Price'), 'description' => 'price of each item', 'required' => true, 'precision' => array(20, 2), 'html' => array('type' => 'Text')), 'line_total' => array('name' => 'line_total', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Line Item Total'), 'description' => 'qty * unit_price', 'required' => true, 'precision' => array(20, 2)), 'participant_count' => array('name' => 'participant_count', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Line Item Participant Count'), 'description' => 'Participant count for field', 'default' => 'NULL', 'html' => array('type' => 'Text')), 'price_field_value_id' => array('name' => 'price_field_value_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Line Item Option'), 'description' => 'FK to civicrm_price_field_value', 'default' => 'NULL', 'FKClassName' => 'CRM_Price_DAO_PriceFieldValue'), 'financial_type_id' => array('name' => 'financial_type_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Financial Type'), 'description' => 'FK to Financial Type.', 'default' => 'NULL', 'FKClassName' => 'CRM_Financial_DAO_FinancialType', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('table' => 'civicrm_financial_type', 'keyColumn' => 'id', 'labelColumn' => 'name')), 'deductible_amount' => array('name' => 'deductible_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Deductible Amount'), 'description' => 'Tax-deductible portion of the amount', 'required' => true, 'precision' => array(20, 2), 'default' => '0.0', 'html' => array('type' => 'Text')), 'tax_amount' => array('name' => 'tax_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Tax Amount'), 'description' => 'tax of each item', 'precision' => array(20, 2), 'import' => true, 'where' => 'civicrm_line_item.tax_amount', 'headerPattern' => '/tax(.?am(ou)?nt)?/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true, 'html' => array('type' => 'Text')));
     }
     return self::$_fields;
 }
 /**
  * returns all the column names of this table
  *
  * @access public
  * @return array
  */
 static function &fields()
 {
     if (!self::$_fields) {
         self::$_fields = array('id' => array('name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'required' => true), 'entity_table' => array('name' => 'entity_table', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Entity Table'), 'required' => true, 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG), 'entity_id' => array('name' => 'entity_id', 'type' => CRM_Utils_Type::T_INT, 'required' => true), 'price_field_id' => array('name' => 'price_field_id', 'type' => CRM_Utils_Type::T_INT, 'required' => true, 'FKClassName' => 'CRM_Price_DAO_Field'), 'label' => array('name' => 'label', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Label'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'default' => 'UL'), 'qty' => array('name' => 'qty', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Qty'), 'required' => true), 'unit_price' => array('name' => 'unit_price', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Unit Price'), 'required' => true), 'line_total' => array('name' => 'line_total', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Line Total'), 'required' => true), 'participant_count' => array('name' => 'participant_count', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Participant Count'), 'default' => 'UL'), 'price_field_value_id' => array('name' => 'price_field_value_id', 'type' => CRM_Utils_Type::T_INT, 'default' => 'UL', 'FKClassName' => 'CRM_Price_DAO_FieldValue'));
     }
     return self::$_fields;
 }
Example #3
0
 /**
  * returns all the column names of this table
  *
  * @access public
  * @return array
  */
 function &fields()
 {
     if (!self::$_fields) {
         self::$_fields = array('id' => array('name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'required' => true), 'entity_table' => array('name' => 'entity_table', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Entity Table'), 'required' => true, 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG), 'entity_id' => array('name' => 'entity_id', 'type' => CRM_Utils_Type::T_INT, 'required' => true), 'price_field_id' => array('name' => 'price_field_id', 'type' => CRM_Utils_Type::T_INT, 'required' => true, 'FKClassName' => 'CRM_Price_DAO_Field'), 'option_group_id' => array('name' => 'option_group_id', 'type' => CRM_Utils_Type::T_INT, 'required' => true), 'label' => array('name' => 'label', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Label'), 'required' => true, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE), 'qty' => array('name' => 'qty', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Qty'), 'required' => true), 'unit_price' => array('name' => 'unit_price', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Unit Price'), 'required' => true), 'line_total' => array('name' => 'line_total', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Line Total'), 'required' => true));
     }
     return self::$_fields;
 }