VEH-12: Add active flag to vehicles



Issue Information

Issue Type: Task
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: VehMan (VEH)
Resolution: Done (2013-11-10 01:55:40)
Target version: 1.0.1,
Components: Submodules , Vehicles , Documentation ,

Created: 2013-10-24 05:40:35
Time Spent Working


Description
Add an 'active' flag to vehicles so that when a vehicle has been sold it can be excluded from dropdown menus (i.e. for adding fuellogs etc)


Issue Links

Subtasks

VEH-13: Add filter object to vehicles
Toggle State Changes

Activity


Sold indicator added to database scripts in commit 6cf8cd33 on 14 Oct.

Ordering was also adjusted within the submodule.

Documentation doesn't seem to have been adjusted, therefore we need to update the docs and implement a mechanism for 'selling' the vehicle
btasker changed status from 'Open' to 'In Progress'
Mechanism is implemented but needs testing.
Mechanism doesn't return any errors or output (JSON response is empty).

The changes made to the database are invalid though, as all vehicles have been marked as sold. It looks like there's an issue with the SQL query somewhere
Might be something to do with having forgotten to add a where clause!


$sql = "UPDATE `Vehicles` SET `Sold`=1, `SoldDate`='".$this->db->stringEscape($solddate)."', `SoldReason`='".$this->db->stringEscape($request->Reason)."'";


If ever proof was needed about late night coding..........
Query updated, and now functions correctly. Response is 'true'.
btasker changed status from 'In Progress' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'