From 66d4c89679dcc7efc27fc118e4bace3b73045f0b Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 19 Feb 2014 17:03:59 +1100 Subject: [PATCH] Added update to allow for payment pricing greater than 999.99 --- booking.install | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/booking.install b/booking.install index 3be5cb4..0af62b4 100644 --- a/booking.install +++ b/booking.install @@ -250,12 +250,12 @@ function booking_update_7206() { /** * Add field to support welfare required flag -* -*function booking_update_7207() { -* $spec = array('type' => 'int', 'length' => '11', 'default' => 0, 'not null' => FALSE); -* db_add_field( 'booking_person', 'booking_welfare_required', $spec); -*} */ +function booking_update_7207() { + $spec = array('type' => 'int', 'length' => '11', 'default' => 0, 'not null' => FALSE); + db_add_field( 'booking_person', 'booking_welfare_required', $spec); +} + /** * Update definition for welfare required flag @@ -273,6 +273,19 @@ function booking_update_7209() { db_add_field( 'booking_studygroup_mapping', 'booking_is_reserveleader', $spec); } +/** +* Update database to allow payments up to $10000 +*/ +function booking_update_7210() { + $spec = array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'); + db_change_field('booking_person', 'booking_amount_paid', 'booking_amount_paid', $spec); + db_change_field('booking_person', 'booking_total_pay_reqd', 'booking_total_pay_reqd', $spec); + db_change_field('booking_price', 'booking_price', 'booking_price', $spec); + db_change_field('booking_payment', 'booking_mc_gross', 'booking_mc_gross', $spec); + db_change_field('booking_payment', 'booking_mc_fee', 'booking_mc_fee', $spec); + return "Updated maximum payment successfully."; +} + /** * Implementation of hook_install(). */ @@ -429,8 +442,8 @@ function booking_schema() { //payment info 'booking_payment_id' => array('type' => 'int', 'length' => '11', 'default' => 0, 'not null' => FALSE), //'booking_payment_method' => array('type' => 'varchar', 'length' => '100', 'not null' => TRUE), - 'booking_total_pay_reqd' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '5', 'scale' => '2'), - 'booking_amount_paid' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '5', 'scale' => '2'), + 'booking_total_pay_reqd' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'), + 'booking_amount_paid' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'), 'booking_deposit_timestamp' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11'), ), 'primary key' => array('nid'), @@ -452,7 +465,7 @@ function booking_schema() { 'fields' => array( 'pid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), 'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), - 'booking_price' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '5', 'scale' => '2'), + 'booking_price' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'), 'booking_late_price' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '5', 'scale' => '2'), 'booking_price_descrip' => array('type' => 'varchar', 'length' => '100', 'not null' => TRUE), 'booking_buttonid' => array('type' => 'varchar', 'length' => '50', 'not null' => FALSE), @@ -468,9 +481,9 @@ function booking_schema() { 'payid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), 'booking_person_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), 'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), - 'booking_mc_gross' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '5', 'scale' => '2'), + 'booking_mc_gross' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'), 'booking_mc_currency' => array('type' => 'varchar', 'length' => '10', 'not null' => FALSE), - 'booking_mc_fee' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '5', 'scale' => '2'), + 'booking_mc_fee' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'), 'booking_quantity' => array('type' => 'int', 'length' => 11, 'not null' => FALSE, 'default' => 0), 'booking_invoice' => array('type' => 'varchar', 'length' => '150', 'not null' => FALSE), 'booking_payer_id' => array('type' => 'varchar', 'length' => '150', 'not null' => FALSE),