Commit Graph
37 Commits
Author SHA1 Message Date
Eric Davis 5200eacd36 [#4604] Store caching timestamps in the database as UTC 2010-10-13 12:50:20 -07:00
Eric Davis f9bd3c0e53 [#4604] Force clearing any lockfiles when submitted from the web 2010-10-13 12:41:50 -07:00
Eric Davis fb3b0a41ae [#4604] Add a method and rake task to clear and update all TimeEntry cost caches 2010-10-06 17:35:28 -07:00
Eric Davis 16a7a3146f [#4604] Timestamp the last caching run 2010-10-06 17:27:31 -07:00
Eric Davis 33cf4d5c5c [#4604] Add test for Rate#update_all_time_entries_with_missing_cost 2010-10-06 17:18:58 -07:00
Eric Davis 41b1a3cd54 [#4604] Move method to model 2010-10-06 17:10:37 -07:00
Eric Davis c97979bd06 [#4604] Clear and recalculate the #cost on Rate#destroy 2010-10-06 13:15:17 -07:00
Eric Davis f7b03b825f [#4604] Clear and recalculate the #cost on Rate#save 2010-10-06 13:05:57 -07:00
Eric Davis e541270461 [#4289] Ported the billing plugin's timesheet hooks. 2010-07-23 10:16:41 -07:00
Eric Davis 7f7b400f15 [#3180 #3266] Compatibility fix for the Groups feature. 2009-11-02 18:30:17 -08:00
Eric Davis 452edfeeaa Refactored core Redmine patches so the plugin can be run in development. 2009-04-21 21:44:58 -07:00
Eric Davis 7930144e8c Require amount to be a number. 2009-01-20 16:35:00 -08:00
Eric Davis 0d90144c0e Fixed a bug where Rates on a project were being selected by the default
rate finder.  #1921
2009-01-20 15:57:24 -08:00
Eric Davis 6141554976 Added some boolean tests to see if a Rate is a default rate. #1921 2009-01-20 15:37:53 -08:00
Eric Davis 8c5e58de04 Changed the API so Rate#for will return a Rate object and Rate#amount_for
will return the rate amount.

  #1921
2009-01-20 15:26:01 -08:00
Eric Davis 5e774eb378 Fixed a bug where default rate wasn't getting used. #1918 2009-01-20 14:55:00 -08:00
Eric Davis 1cd24e451b Sorting the Project column by project name now
* Including projects in Rate.history_for_user
* Moved the valid sort options to a constant on the RatesController
* Changed the ValidSortOptions to use the Project name for project_id
* Updated admin view to use RatesController::ValidSortOptions instead of a
  duplicated string.

  #1915
2009-01-20 10:46:16 -08:00
Eric Davis f870a6019e Hacked some column sorting onto RatesController
* Added SortHelper to RatesController
* Init and updating the sorting (pre 0.8 sort_update)
* RatesController#index will only render the layout on non-xhr requests
* Changed Rate.history_for_user to take an order clause
* Added rate_sort_header_tag and rate_sort_link to the SortHelper in order
  to get the correct parameters for sorting Rates
* Added rate_sort_header_tags to the Rate lists

  #1915
2009-01-19 14:43:54 -08:00
Eric Davis b993a5ae2f Refactored the date checks into a separate methods. #1920 2009-01-16 17:03:24 -08:00
Eric Davis 2950051383 Checking date input for Rate#for. #1920 2009-01-16 16:59:49 -08:00
Eric Davis 7bca02b511 Instead of returning nil, which could get confused with No Rate, passing
incorrect objects to Rate#for will now throw a Rate::InvalidParameterException
back to the caller.

Normally you don't need to be this strict but this is a public API that will
be consumed by several third parties so we need to be very clear what happened.

  #1920
2009-01-16 16:53:00 -08:00
Eric Davis 94e8aad493 Rate#for should handle invalid projects. #1920 2009-01-16 16:43:26 -08:00
Eric Davis 08b267741b Rate#for should handle invalid users. #1920 2009-01-16 16:40:50 -08:00
Eric Davis da891cc607 Refactored Rate#for_user_project_and_date to allow nil projects. #1920 2009-01-16 16:34:38 -08:00
Eric Davis 3451286011 Typo, don't need two rates. Rate.rate_for... #1920 2009-01-16 16:21:18 -08:00
Eric Davis 06f8258b38 Extracted an ugly finder method from Rate#for to a private method. #1920 2009-01-16 16:16:39 -08:00
Eric Davis 69d922a029 Refactored Rate#for to only get one record. #1920 2009-01-16 16:08:13 -08:00
Eric Davis 6a211c3e5e Rate#for will now return the most current rate for the user matching the parameters. #1920 2009-01-16 16:06:12 -08:00
Eric Davis b59c87b1f6 Implementing Rate#for's internal logic. #1920 2009-01-16 16:03:15 -08:00
Eric Davis 0d9c7e50de Added specs for the Rate#for parameter. #1920 2009-01-16 15:54:14 -08:00
Eric Davis 0e8bd2153c Prevent Rates from being destroyed if they are locked. #1919 2009-01-16 15:33:42 -08:00
Eric Davis 3ffb31fafc Require that a Rate be unlocked before saving it. #1919 2009-01-16 15:28:34 -08:00
Eric Davis 9b0332bf78 Added a Rate#locked? check. #1919 2009-01-16 15:23:30 -08:00
Eric Davis 33d1f84878 Added a named scope to make history lookups easier, Rate.history_for_user(user). #1915 2009-01-16 15:09:46 -08:00
Eric Davis 48d394704a Added data validation for Rates. #1917 2009-01-16 14:14:21 -08:00
Eric Davis 3f39bdaa6b Added associations to Rate. #1917 2009-01-16 14:00:11 -08:00
Eric Davis a3c12fed19 Added basic rate model and it's database schema 2009-01-16 13:56:04 -08:00