From 1805449b5005be0c738e695cee08aa610c44aaf1 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Thu, 20 Jul 2017 22:29:33 +0000 Subject: [PATCH] Changes Personal to Stand Time and many other things: * Updates populate * Makes Stand Time a special transaction_type_id * Adds new definitions to database_functions --- Connections/database_functions.php | 10 +++++++++- sql/populate.sql | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Connections/database_functions.php b/Connections/database_functions.php index d6b4f3b..f4dc73f 100644 --- a/Connections/database_functions.php +++ b/Connections/database_functions.php @@ -40,6 +40,12 @@ define("MEMBERSHIP_DAYS",2); // Define how long a patron remains a member if they purchase a membership. define("PURCHASED_MEMBERSHIP_DAYS",365); +/********* +STAND TIME +**********/ +// Determines the behaviour of Stand Time (transaction_type_id) +define("STAND_TIME_HOURLY_RATE",10); + /******************************** SWEAT EQUITY / VOLUNTEER BENEFITS *********************************/ @@ -65,6 +71,8 @@ define("VOLUNTEER_HOUR_VALUE",8); define("VOLUNTEER_DISCOUNT",25); define("SPECIAL_VOLUNTEER_HOURS_QUALIFICATION",100); define("SPECIAL_VOLUNTEER_DISCOUNT",50); + +// Determines the behaviour of Bicycles (transaction_type_id) for volunteer to earn-a-bike purchases define("EARN_A_BIKE_LIMIT",1); // Map transaction_type_id for transaction to the type of benefits desired @@ -172,7 +180,7 @@ define("ACCOUNTING_GROUP", "Sales"); define("DEFAULT_TRANSACTION_TYPE", "Sale - Used Parts"); // shop_user_role -define("DEFAULT_SHOP_USER", "Personal"); +define("DEFAULT_SHOP_USER", "Stand Time"); /* Change Fund - A specific amount of money for the purpose of making change. The amount on hand should remain the same at all times; diff --git a/sql/populate.sql b/sql/populate.sql index d88879b..42c0835 100644 --- a/sql/populate.sql +++ b/sql/populate.sql @@ -32,6 +32,9 @@ INSERT INTO shop_types (shop_type_id, list_order) VALUES -- -- default select value for shop user may be set in Connections/database_functions.php, -- a shop_type_id with the same name needs to exist in order for this to work. +-- +-- Stand Time is a special type of user_role_id (assuming all 0's) where hours are figured out automatically in the +-- special Stand Time transaction_type_id. ALTER TABLE shop_user_roles ADD other_volunteer tinyint(1) NOT NULL DEFAULT '0'; DELETE FROM shop_user_roles; @@ -39,7 +42,7 @@ INSERT INTO shop_user_roles ( shop_user_role_id, hours_rank, volunteer, sales, paid, other_volunteer ) VALUES ("Coordinator",0,1,1,0,0), - ("Personal",0,0,0,0,0), + ("Stand Time",0,0,0,0,0), ("Volunteer",0,1,0,0,0), ("Greeter",0,1,1,0,0), ("Staff",0,0,1,1,0), @@ -161,6 +164,10 @@ INSERT INTO contacts ( -- Bicycles (transaction_type_id) is a special transaction type that can have limits applied to how many bicycles can be -- earned with volunteer hour benefits (transforming volunteer hours into cash). -- +-- STAND TIME +-- Stand Time (transaction_type_id) is a special transaction type to automatically figures out the amount that needs to be paid based +-- on the configured hourly rate. +-- -- DONATIONS are best complimented with anonymous, see below. -- -- "show_payment" shows cash, credit, and check payment types if selected.