wingblaze / ggms

Generic Golf Management System
0 stars 2 forks source link

Membership Slot to User? #13

Open vpsantow opened 8 years ago

vpsantow commented 8 years ago

Objective: Register new user and have him/her directly post Club Share Issue: "The user's account currently does not have a membership slot yet."

Steps done:

  1. User registered
  2. Registered new user as "owner".
  3. Approved user by Finance
  4. Approved user by Management

Can't find a way to assign new user a membership slot

wingblaze commented 8 years ago

When creating the account, there is an option to assign the membership slot at the end. This is the primary way for the user to be able to assign slots to an account. Please try this first.

A secondary way needs to be implemented so that membership slots can be assigned outside of account creation.

wingblaze commented 8 years ago

The secondary way is now implemented.

To be able to assign an unused membership slot to an account without a membership slot, do the following:

  1. View all accounts
  2. Select account that does not have a membership slot
  3. Find section that talks about the account not having any membership slot
  4. Select from the dropdown menu the membership slot you wish to assign to the account.
  5. Click 'Assign' to assign that slot to the account.

Note that there are now two ways to assign a slot: (1) during account creation and (2) after account creation, while viewing an account's details.

vpsantow commented 8 years ago

Secondary way is is shown as intended. Though secondary way and "Register a new account" have no membership slots in the drop down, even if DB contains the data. This was my same problem prior to your recent update.

image

DB

image

wingblaze commented 8 years ago

The specific sql query performed to acquire the membership slots is shown below:

Line ~162, AccountController

'slots' => MembershipSlot::whereNotIn('id', MembershipControl::select('membership_slot_id')->distinct()->get())->orderBy('id')->get()

Breaking it down, it says that the 'slots' variable for that page should be the entries in MembershipSlot whose id is not found in the list.

The list is composed of the distinct or unique membership_slot_ids found in the MembershipControl table.

If there are no entries in the drop down, it must mean that all membership slots have already been assigned: i.e. The membership_controls table has entries using all of the available slot IDs already. The query returns empty because it could not find a membership_slot_id which was not found in the list because the list had all the slots already.

Please review membership_controls to see if entries in that table already have all the possible values of membership_slot_id. If so, then either remove a membership_controls entry or add a new membership_slot