You are here

function pminvoice_update_7102 in Drupal PM (Project Management) 7

Change price field types to fixed precision database columns.

File

pminvoice/pminvoice.install, line 230
Installation functions for PM Invoice.

Code

function pminvoice_update_7102() {

  // Table: pminvoice.
  db_change_field('pminvoice', 'amount', 'amount', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
  db_change_field('pminvoice', 'tax1', 'tax1', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
  db_change_field('pminvoice', 'tax2', 'tax2', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
  db_change_field('pminvoice', 'total', 'total', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
  db_change_field('pminvoice', 'totalcustomercurr', 'totalcustomercurr', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));

  // Table: pminvoice_items.
  db_change_field('pminvoice_items', 'amount', 'amount', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
  db_change_field('pminvoice_items', 'tax1', 'tax1', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
  db_change_field('pminvoice_items', 'tax2', 'tax2', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
  db_change_field('pminvoice_items', 'total', 'total', array(
    'type' => 'numeric',
    'precision' => 19,
    'scale' => 4,
  ));
}