brisk-bills 0.7.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +55 -0
- data/TODO.txt +36 -67
- data/app/controllers/admin/activities_controller.rb +4 -3
- data/app/controllers/admin/activities_with_prices_controller.rb +28 -14
- data/app/controllers/admin/client_accounting_controller.rb +11 -8
- data/app/controllers/admin/client_representatives_controller.rb +34 -5
- data/app/controllers/admin/clients_controller.rb +1 -1
- data/app/controllers/admin/draft_invoices_controller.rb +92 -0
- data/app/controllers/admin/{employee_client_labor_rate_controller.rb → employee_client_labor_rates_controller.rb} +1 -1
- data/app/controllers/admin/employees_controller.rb +3 -4
- data/app/controllers/admin/invoices_controller.rb +111 -53
- data/app/controllers/admin/payments_controller.rb +168 -41
- data/app/controllers/authentication_controller.rb +3 -3
- data/app/helpers/admin/activities_helper.rb +16 -13
- data/app/helpers/admin/activities_helper/labor_helper.rb +4 -4
- data/app/helpers/admin/activities_helper/proposal_helper.rb +1 -1
- data/app/helpers/admin/activities_helper/slimtimer_helper.rb +1 -1
- data/app/helpers/admin/activities_with_prices_helper.rb +2 -2
- data/app/helpers/admin/activity_type_controller_helper.rb +6 -0
- data/app/helpers/admin/activity_type_field_helper.rb +9 -9
- data/app/helpers/admin/adjustments_helper.rb +9 -1
- data/app/helpers/admin/client_accounting_helper.rb +2 -2
- data/app/helpers/admin/client_financial_transactions_helper.rb +1 -1
- data/app/helpers/admin/client_representatives_helper.rb +16 -12
- data/app/helpers/admin/clients_helper.rb +2 -0
- data/app/helpers/admin/draft_invoices_helper.rb +24 -0
- data/app/helpers/admin/{employee_client_labor_rate_helper.rb → employee_client_labor_rates_helper.rb} +8 -8
- data/app/helpers/admin/employees_helper.rb +6 -0
- data/app/helpers/admin/has_credential_column_helper.rb +8 -8
- data/app/helpers/admin/invoices_helper.rb +71 -16
- data/app/helpers/admin/is_active_column_helper.rb +2 -2
- data/app/helpers/admin/labors_helper.rb +12 -1
- data/app/helpers/admin/labors_helper/slimtimer_helper.rb +1 -1
- data/app/helpers/admin/materials_helper.rb +11 -0
- data/app/helpers/admin/payments_helper.rb +204 -29
- data/app/helpers/admin/proposals_helper.rb +10 -0
- data/app/helpers/admin/settings_helper.rb +1 -1
- data/app/helpers/admin_layout_helper.rb +3 -6
- data/app/helpers/authentication_helper.rb +7 -10
- data/app/helpers/money_model_helper.rb +1 -2
- data/app/models/activity.rb +17 -7
- data/app/models/client.rb +35 -8
- data/app/{model_views → models}/client_financial_transaction.rb +0 -0
- data/app/models/client_representative.rb +6 -14
- data/app/models/credential.rb +1 -1
- data/app/models/employee.rb +9 -11
- data/app/models/invoice.rb +13 -9
- data/app/models/invoice_payment.rb +1 -1
- data/app/models/notifier.rb +2 -2
- data/app/models/payment.rb +51 -7
- data/app/models/setting.rb +3 -1
- data/app/views/active_scaffold_overrides/add_existing.js.rjs +25 -0
- data/app/views/admin/activities/_adjustment_column.html.erb +10 -0
- data/app/views/admin/activities/{_form.rhtml → _form.html.erb} +0 -0
- data/app/views/admin/activities/{_form_attribute.rhtml → _form_attribute.html.erb} +0 -0
- data/app/views/admin/activities/{_labor_column.rhtml → _labor_column.html.erb} +0 -0
- data/app/views/admin/activities/{_material_column.rhtml → _material_column.html.erb} +0 -0
- data/app/views/admin/activities/{_proposal_column.rhtml → _proposal_column.html.erb} +0 -0
- data/app/views/admin/activities_with_prices/{move_to_invoice.rhtml → move_to_invoice.html.erb} +2 -2
- data/app/views/admin/activities_with_prices/move_to_invoice.js.rjs +5 -0
- data/app/views/admin/draft_invoices/batch_create.html.erb +73 -0
- data/app/views/admin/draft_invoices/batch_create.js.rjs +5 -0
- data/app/views/admin/invoices/confirm_publish_modal.html.erb +48 -0
- data/app/views/admin/payments/commit_payment_warning.html.erb +8 -0
- data/app/views/admin/payments/observation_error.js.rjs +28 -0
- data/app/views/admin/payments/on_assignment_observation.js.rjs +28 -0
- data/app/views/authentication/{email.rjs → email.js.rjs} +0 -0
- data/app/views/authentication/{login.rhtml → login.html.erb} +21 -26
- data/app/views/authentication/{login.rjs → login.js.rjs} +0 -0
- data/app/views/authentication/{reset_password_via_token.rhtml → reset_password_via_token.html.erb} +0 -0
- data/app/views/authentication/{reset_password_via_token.rjs → reset_password_via_token.js.rjs} +0 -0
- data/app/views/authentication/{sign_in_error.rjs → sign_in_error.js.rjs} +0 -0
- data/app/views/layouts/{_navigation_tree.rhtml → _navigation_tree.html.erb} +0 -0
- data/app/views/layouts/{admin.rhtml → admin.html.erb} +0 -0
- data/app/views/layouts/{public.rhtml → public.html.erb} +0 -0
- data/app/views/notifier/{_email_footer.html.rhtml → _email_footer.html.erb} +0 -0
- data/app/views/notifier/{_email_footer.plain.rhtml → _email_footer.plain.erb} +0 -0
- data/app/views/notifier/{_email_header.html.rhtml → _email_header.html.erb} +0 -0
- data/app/views/notifier/invoice_available.html.erb +5 -0
- data/app/views/notifier/{invoice_available.plain.rhtml → invoice_available.plain.erb} +1 -1
- data/app/views/notifier/{reset_password_requested.html.rhtml → reset_password_requested.html.erb} +2 -2
- data/app/views/notifier/{reset_password_requested.plain.rhtml → reset_password_requested.plain.erb} +1 -1
- data/config/environment.rb +6 -5
- data/config/locale/en.rb +9 -0
- data/db/migrate/001_create_employees.rb +1 -1
- data/db/migrate/002_create_employee_slimtimers.rb +1 -1
- data/db/migrate/003_create_slimtimer_tasks.rb +1 -1
- data/db/migrate/004_create_slimtimer_time_entries.rb +1 -1
- data/db/migrate/005_create_clients.rb +1 -1
- data/db/migrate/006_create_client_representatives.rb +1 -1
- data/db/migrate/008_create_activities.rb +1 -1
- data/db/migrate/009_create_activity_labors.rb +1 -1
- data/db/migrate/010_create_employee_client_labor_rates.rb +1 -1
- data/db/migrate/011_create_activity_adjustments.rb +1 -1
- data/db/migrate/012_create_activity_materials.rb +1 -1
- data/db/migrate/013_create_activity_proposals.rb +1 -1
- data/db/migrate/014_create_invoices.rb +1 -1
- data/db/migrate/015_create_payments.rb +1 -1
- data/db/migrate/016_create_payment_methods.rb +1 -1
- data/db/migrate/017_create_invoice_payments.rb +1 -1
- data/db/migrate/018_create_activity_types.rb +2 -2
- data/db/migrate/019_create_settings.rb +1 -1
- data/db/migrate/023_create_credentials_migrate_representatives.rb +2 -2
- data/db/migrate/028_money_to_cents.rb +2 -2
- data/db/schema.rb +10 -10
- data/lib/brisk-bills.rb +2 -2
- data/lib/brisk-bills/initializer.rb +2 -2
- data/lib/generators/instance/templates/instance_environment.rb +1 -1
- data/lib/libpptable.rb +48 -0
- data/lib/tasks/create_last_months_invoices.rake +1 -14
- data/lib/tasks/first_time_setup.rake +2 -2
- data/lib/tasks/package.rake +2 -1
- data/lib/tasks/payment_assignment_consistency_check.rake +110 -0
- data/lib/utilities.rb +4 -4
- data/public/images/page-new.gif +0 -0
- data/public/javascripts/active_scaffold/default/active_scaffold.js +532 -430
- data/public/javascripts/active_scaffold/default/dhtml_history.js +1 -1
- data/public/javascripts/active_scaffold/default/form_enhancements.js +7 -4
- data/public/stylesheets/active_scaffold/default/stylesheet-ie.css +5 -5
- data/public/stylesheets/active_scaffold/default/stylesheet.css +54 -18
- data/public/stylesheets/admin/global.css +1 -1
- data/public/stylesheets/admin/pages.css +29 -0
- data/test/unit/activity/adjustment_test.rb +1 -1
- data/test/unit/activity/labor_test.rb +1 -1
- data/test/unit/activity/material_test.rb +1 -1
- data/test/unit/activity/proposal_test.rb +1 -1
- data/test/unit/activity_test.rb +1 -1
- data/test/unit/activity_type_test.rb +1 -1
- data/test/unit/client_eventlog_test.rb +1 -1
- data/test/unit/client_financial_transaction_test.rb +1 -1
- data/test/unit/client_representative_test.rb +1 -1
- data/test/unit/client_test.rb +37 -6
- data/test/unit/credential_test.rb +1 -1
- data/test/unit/employee/slimtimer_test.rb +1 -1
- data/test/unit/employee_client_labor_rate_test.rb +1 -1
- data/test/unit/employee_test.rb +1 -1
- data/test/unit/helpers/admin/draft_invoices_helper_test.rb +4 -0
- data/test/unit/invoice_payment_test.rb +90 -50
- data/test/unit/invoice_test.rb +48 -8
- data/test/unit/notifier_test.rb +1 -1
- data/test/unit/payment_method_test.rb +1 -1
- data/test/unit/payment_test.rb +7 -7
- data/test/unit/setting_test.rb +1 -1
- data/test/unit/slimtimer_task_test.rb +1 -1
- data/test/unit/slimtimer_time_entry_test.rb +1 -1
- data/vendor/plugins/active_scaffold/CHANGELOG +3 -1
- data/vendor/plugins/active_scaffold/README +18 -5
- data/vendor/plugins/active_scaffold/environment.rb +1 -1
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/active_scaffold.js +532 -430
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/dhtml_history.js +1 -1
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/form_enhancements.js +7 -4
- data/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet-ie.css +5 -5
- data/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet.css +54 -18
- data/vendor/plugins/active_scaffold/frontends/default/views/_add_existing_form.html.erb +3 -7
- data/vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb +10 -7
- data/vendor/plugins/active_scaffold/frontends/default/views/_field_search.html.erb +7 -12
- data/vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb +3 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association.html.erb +15 -20
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association_footer.html.erb +8 -10
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb +5 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_hidden_attribute.html.erb +2 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform.html.erb +19 -21
- data/vendor/plugins/active_scaffold/frontends/default/views/{_form_association_header.html.erb → _horizontal_subform_header.html.erb} +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform_record.html.erb +31 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb +4 -18
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_actions.html.erb +18 -5
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_calculations.html.erb +2 -9
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_column_headings.html.erb +4 -4
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb +6 -6
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_inline_adapter.html.erb +2 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_messages.html.erb +20 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_pagination.html.erb +11 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_pagination_links.html.erb +3 -5
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb +2 -26
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_record_columns.html.erb +9 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb +3 -12
- data/vendor/plugins/active_scaffold/frontends/default/views/_render_fields.js.rjs +11 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_search.html.erb +17 -11
- data/vendor/plugins/active_scaffold/frontends/default/views/_show.html.erb +3 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/_show_columns.html.erb +8 -7
- data/vendor/plugins/active_scaffold/frontends/default/views/_update_actions.html.erb +3 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/_update_form.html.erb +9 -6
- data/vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform.html.erb +7 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform_record.html.erb +38 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/add_existing.js.rjs +2 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/delete.html.erb +1 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/destroy.js.rjs +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/edit_associated.js.rjs +20 -15
- data/vendor/plugins/active_scaffold/frontends/default/views/list.html.erb +12 -8
- data/vendor/plugins/active_scaffold/frontends/default/views/list.js.rjs +1 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/mark.js.rjs +6 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/on_create.js.rjs +12 -8
- data/vendor/plugins/active_scaffold/frontends/default/views/on_update.js.rjs +13 -6
- data/vendor/plugins/active_scaffold/frontends/default/views/render_field.js.rjs +1 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/search.html.erb +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/update.html.erb +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/update_column.js.rjs +4 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/update_row.js.rjs +2 -0
- data/vendor/plugins/active_scaffold/init.rb +2 -2
- data/vendor/plugins/active_scaffold/install.rb +1 -2
- data/vendor/plugins/active_scaffold/install_assets.rb +1 -1
- data/vendor/plugins/active_scaffold/lib/active_record_permissions.rb +53 -42
- data/vendor/plugins/active_scaffold/lib/active_scaffold.rb +96 -23
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/common_search.rb +18 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb +152 -102
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/create.rb +81 -49
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/delete.rb +44 -17
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/field_search.rb +60 -46
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb +42 -37
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/mark.rb +72 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/nested.rb +94 -92
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/search.rb +54 -40
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/show.rb +30 -10
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb +62 -47
- data/vendor/plugins/active_scaffold/lib/active_scaffold/attribute_params.rb +187 -185
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/base.rb +28 -3
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb +43 -3
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/create.rb +8 -15
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/delete.rb +3 -4
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/field_search.rb +19 -17
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb +2 -9
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb +46 -9
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb +17 -7
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb +36 -16
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/show.rb +5 -12
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb +8 -6
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/update.rb +12 -8
- data/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb +2 -2
- data/vendor/plugins/active_scaffold/lib/active_scaffold/constraints.rb +173 -178
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_columns.rb +101 -97
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_link.rb +29 -19
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/column.rb +74 -34
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/columns.rb +74 -74
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/set.rb +57 -62
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb +73 -3
- data/vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb +304 -234
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/association_helpers.rb +40 -40
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/controller_helpers.rb +39 -24
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/country_helpers.rb +32 -28
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb +157 -86
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/id_helpers.rb +7 -7
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/list_column_helpers.rb +278 -85
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/pagination_helpers.rb +38 -12
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/search_column_helpers.rb +74 -35
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/show_column_helpers.rb +53 -46
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/view_helpers.rb +51 -17
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/de.yml +69 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/en.yml +72 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/es.yml +23 -13
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/fr.yml +68 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/hu.yml +24 -14
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/ja.yml +69 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/ru.yml +72 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/marked_model.rb +38 -0
- data/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/lib/as_cds_bridge.rb +47 -13
- data/vendor/plugins/active_scaffold/lib/bridges/dependent_protect/bridge.rb +10 -0
- data/vendor/plugins/active_scaffold/lib/bridges/dependent_protect/lib/dependent_protect_bridge.rb +11 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/as_file_column_bridge.rb +3 -6
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/form_ui.rb +10 -2
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/bridge.rb +13 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/form_ui.rb +20 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/list_ui.rb +16 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/paperclip_bridge.rb +32 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/paperclip_bridge_helpers.rb +18 -0
- data/vendor/plugins/active_scaffold/lib/bridges/record_select/bridge.rb +5 -0
- data/vendor/plugins/active_scaffold/lib/bridges/record_select/lib/record_select_bridge.rb +79 -0
- data/vendor/plugins/active_scaffold/lib/bridges/semantic_attributes/bridge.rb +5 -0
- data/vendor/plugins/active_scaffold/lib/bridges/semantic_attributes/lib/semantic_attributes_bridge.rb +20 -0
- data/vendor/plugins/active_scaffold/lib/bridges/tiny_mce/bridge.rb +5 -0
- data/vendor/plugins/active_scaffold/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb +57 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/bridge.rb +9 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/lib/form_ui.rb +14 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/lib/unobtrusive_date_picker_bridge.rb +15 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/lib/view_helpers.rb +16 -0
- data/vendor/plugins/active_scaffold/lib/bridges/validation_reflection/bridge.rb +9 -0
- data/vendor/plugins/active_scaffold/lib/bridges/validation_reflection/lib/validation_reflection_bridge.rb +19 -0
- data/vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb +20 -8
- data/vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb +2 -2
- data/vendor/plugins/active_scaffold/lib/extensions/paginator_extensions.rb +26 -0
- data/vendor/plugins/active_scaffold/lib/extensions/resources.rb +6 -5
- data/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb +26 -20
- data/vendor/plugins/active_scaffold/lib/extensions/unsaved_associated.rb +1 -1
- data/vendor/plugins/active_scaffold/lib/paginator.rb +1 -1
- data/vendor/plugins/active_scaffold/lib/responds_to_parent.rb +1 -1
- data/vendor/plugins/active_scaffold/shoulda_macros/macros.rb +136 -0
- data/vendor/plugins/active_scaffold/test/bridges/active_scaffold_dependent_protect_test.rb +34 -0
- data/vendor/plugins/active_scaffold/test/bridges/bridge_test.rb +43 -0
- data/vendor/plugins/active_scaffold/test/bridges/company.rb +81 -0
- data/vendor/plugins/active_scaffold/test/bridges/paperclip_test.rb +68 -0
- data/vendor/plugins/active_scaffold/test/bridges/tiny_mce_test.rb +27 -0
- data/vendor/plugins/active_scaffold/test/bridges/unobtrusive_date_picker_test.rb +49 -0
- data/vendor/plugins/active_scaffold/test/bridges/validation_reflection_test.rb +57 -0
- data/vendor/plugins/active_scaffold/test/config/base_test.rb +15 -0
- data/vendor/plugins/active_scaffold/test/config/core_test.rb +58 -0
- data/vendor/plugins/active_scaffold/test/config/create_test.rb +9 -6
- data/vendor/plugins/active_scaffold/test/config/delete_test.rb +33 -0
- data/vendor/plugins/active_scaffold/test/config/field_search_test.rb +47 -0
- data/vendor/plugins/active_scaffold/test/config/list_test.rb +66 -11
- data/vendor/plugins/active_scaffold/test/config/nested_test.rb +62 -0
- data/vendor/plugins/active_scaffold/test/config/search_test.rb +60 -0
- data/vendor/plugins/active_scaffold/test/config/show_test.rb +43 -0
- data/vendor/plugins/active_scaffold/test/config/subform_test.rb +17 -0
- data/vendor/plugins/active_scaffold/test/config/update_test.rb +27 -4
- data/vendor/plugins/active_scaffold/test/data_structures/action_columns_test.rb +2 -8
- data/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb +11 -11
- data/vendor/plugins/active_scaffold/test/data_structures/action_links_test.rb +5 -5
- data/vendor/plugins/active_scaffold/test/data_structures/association_column_test.rb +4 -3
- data/vendor/plugins/active_scaffold/test/data_structures/column_test.rb +29 -5
- data/vendor/plugins/active_scaffold/test/data_structures/sorting_test.rb +31 -1
- data/vendor/plugins/active_scaffold/test/data_structures/standard_column_test.rb +3 -13
- data/vendor/plugins/active_scaffold/test/data_structures/virtual_column_test.rb +0 -11
- data/vendor/plugins/active_scaffold/test/extensions/{array.rb → array_test.rb} +0 -0
- data/vendor/plugins/active_scaffold/test/helpers/form_column_helpers_test.rb +31 -0
- data/vendor/plugins/active_scaffold/test/helpers/list_column_helpers_test.rb +42 -0
- data/vendor/plugins/active_scaffold/test/helpers/pagination_helpers_test.rb +59 -0
- data/vendor/plugins/active_scaffold/test/misc/active_record_permissions_test.rb +154 -0
- data/vendor/plugins/active_scaffold/test/misc/attribute_params_test.rb +146 -0
- data/vendor/plugins/active_scaffold/test/misc/configurable_test.rb +2 -2
- data/vendor/plugins/active_scaffold/test/misc/constraints_test.rb +26 -8
- data/vendor/plugins/active_scaffold/test/misc/finder_test.rb +41 -19
- data/vendor/plugins/active_scaffold/test/misc/lang_test.rb +5 -6
- data/vendor/plugins/active_scaffold/test/mock_app/app/controllers/application_controller.rb +10 -0
- data/vendor/plugins/active_scaffold/test/mock_app/app/helpers/application_helper.rb +3 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/boot.rb +110 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environment.rb +43 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environments/development.rb +17 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environments/production.rb +28 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environments/test.rb +28 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/backtrace_silencers.rb +7 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/inflections.rb +10 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/mime_types.rb +5 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/new_rails_defaults.rb +19 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/session_store.rb +15 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/locales/en.yml +5 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/routes.rb +43 -0
- data/vendor/plugins/active_scaffold/test/mock_app/db/test.sqlite3 +1 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/blank.html +33 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/DO_NOT_EDIT +2 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/add.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/arrow_down.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/arrow_up.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/close.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/cross.png +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/indicator-small.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/indicator.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/magnifier.png +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/DO_NOT_EDIT +2 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/active_scaffold.js +532 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/dhtml_history.js +867 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/form_enhancements.js +117 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/rico_corner.js +370 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/stylesheets/active_scaffold/DO_NOT_EDIT +2 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/stylesheets/active_scaffold/default/stylesheet-ie.css +35 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/stylesheets/active_scaffold/default/stylesheet.css +845 -0
- data/vendor/plugins/active_scaffold/test/model_stub.rb +17 -1
- data/vendor/plugins/active_scaffold/test/test_helper.rb +31 -5
- data/vendor/plugins/active_scaffold/uninstall.rb +2 -1
- data/vendor/plugins/active_scaffold_form_observation/init.rb +1 -1
- data/vendor/plugins/active_scaffold_form_observation/lib/active_scaffold_form_observation.rb +1 -2
- data/vendor/plugins/active_scaffold_full_refresh/init.rb +2 -0
- data/vendor/plugins/active_scaffold_full_refresh/lib/active_scaffold_full_refresh.rb +29 -0
- data/vendor/plugins/acts_as_money/{tasks → lib/tasks}/money_tasks.rake +0 -0
- metadata +668 -563
- data/app/model_views/client_accounting.rb +0 -5
- data/app/model_views/invoices_with_total.rb +0 -41
- data/app/views/admin/activities/_adjustment_column.rhtml +0 -23
- data/app/views/admin/activities_with_prices/move_to_invoice.rjs +0 -9
- data/app/views/notifier/invoice_available.html.rhtml +0 -5
- data/public/javascripts/prototype.js-1.6.0.3 +0 -4320
- data/test/functional/admin/activities_controller_test.rb +0 -8
- data/test/functional/admin/adjustments_controller_test.rb +0 -8
- data/test/functional/admin/client_accounting_controller_test.rb +0 -8
- data/test/functional/admin/client_financial_transactions_controller_test.rb +0 -8
- data/test/functional/admin/client_representatives_controller_test.rb +0 -8
- data/test/functional/admin/clients_controller_test.rb +0 -8
- data/test/functional/admin/employee_client_labor_rate_controller_test.rb +0 -8
- data/test/functional/admin/employees/slimtimer_controller_test.rb +0 -8
- data/test/functional/admin/employees_controller_test.rb +0 -8
- data/test/functional/admin/invoices_controller_test.rb +0 -8
- data/test/functional/admin/labors_controller_test.rb +0 -8
- data/test/functional/admin/materials_controller_test.rb +0 -8
- data/test/functional/admin/payments_controller_test.rb +0 -8
- data/test/functional/admin/proposals_controller_test.rb +0 -8
- data/test/functional/admin/settings_controller_test.rb +0 -8
- data/test/functional/authentication_controller_test.rb +0 -8
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association_record.html.erb +0 -27
- data/vendor/plugins/active_scaffold/frontends/default/views/_live_search.html.erb +0 -25
- data/vendor/plugins/active_scaffold/frontends/default/views/form_messages_on_create.js.rjs +0 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/form_messages_on_update.js.rjs +0 -2
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/live_search.rb +0 -46
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb +0 -52
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/en.rb +0 -66
- data/vendor/plugins/active_scaffold/lib/extensions/name_option_for_datetime.rb +0 -12
- data/vendor/plugins/active_scaffold/test/misc/active_record_permissions.rb +0 -154
data/CHANGELOG
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
== Change Log
|
2
2
|
|
3
|
+
=== Release 0.8.0
|
4
|
+
- Upgraded codebase to rails 2.3.8
|
5
|
+
- *Greatly* Improved options in the payment to invoice mapping.
|
6
|
+
- GUI Bugfixes!
|
7
|
+
- Revised the invoice approval and sending interfaces
|
8
|
+
- Added new columns to list views
|
9
|
+
|
3
10
|
=== Release 0.7.0 (May 03, 2010)
|
4
11
|
- Much improved invoice to payment mapping control.
|
5
12
|
- Ability to unpublish more than one invoice, and to edit/delete older, already-published invoices
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source :rubygems
|
2
|
+
|
3
|
+
gem 'i18n', '0.4.2'
|
4
|
+
gem 'rails', '2.3.16'
|
5
|
+
gem 'rake', '0.8.7'
|
6
|
+
gem 'pdf-writer', :git => 'git://github.com/metaskills/pdf-writer.git', :require => ['pdf/writer', 'pdf/simpletable']
|
7
|
+
gem 'slimtimer4r', '0.2.4'
|
8
|
+
gem 'money', '2.2.0'
|
9
|
+
gem 'test-unit', '1.2.3'
|
10
|
+
gem 'mysql2', '~> 0.2.7'
|
11
|
+
gem 'extensions', '0.6.0'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://github.com/metaskills/pdf-writer.git
|
3
|
+
revision: 7f5bc6c9ce69c26574bbfde36ebdb9ecf06709d0
|
4
|
+
specs:
|
5
|
+
pdf-writer (1.2.3)
|
6
|
+
color (>= 1.4.0)
|
7
|
+
transaction-simple (~> 1.3)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actionmailer (2.3.16)
|
13
|
+
actionpack (= 2.3.16)
|
14
|
+
actionpack (2.3.16)
|
15
|
+
activesupport (= 2.3.16)
|
16
|
+
rack (~> 1.1.0)
|
17
|
+
activerecord (2.3.16)
|
18
|
+
activesupport (= 2.3.16)
|
19
|
+
activeresource (2.3.16)
|
20
|
+
activesupport (= 2.3.16)
|
21
|
+
activesupport (2.3.16)
|
22
|
+
color (1.4.1)
|
23
|
+
extensions (0.6.0)
|
24
|
+
hoe (3.5.0)
|
25
|
+
rake (>= 0.8, < 11.0)
|
26
|
+
i18n (0.4.2)
|
27
|
+
money (2.2.0)
|
28
|
+
mysql2 (0.2.18)
|
29
|
+
rack (1.1.6)
|
30
|
+
rails (2.3.16)
|
31
|
+
actionmailer (= 2.3.16)
|
32
|
+
actionpack (= 2.3.16)
|
33
|
+
activerecord (= 2.3.16)
|
34
|
+
activeresource (= 2.3.16)
|
35
|
+
activesupport (= 2.3.16)
|
36
|
+
rake (>= 0.8.3)
|
37
|
+
rake (0.8.7)
|
38
|
+
slimtimer4r (0.2.4)
|
39
|
+
test-unit (1.2.3)
|
40
|
+
hoe (>= 1.5.1)
|
41
|
+
transaction-simple (1.4.0.2)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
ruby
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
extensions (= 0.6.0)
|
48
|
+
i18n (= 0.4.2)
|
49
|
+
money (= 2.2.0)
|
50
|
+
mysql2 (~> 0.2.7)
|
51
|
+
pdf-writer!
|
52
|
+
rails (= 2.3.16)
|
53
|
+
rake (= 0.8.7)
|
54
|
+
slimtimer4r (= 0.2.4)
|
55
|
+
test-unit (= 1.2.3)
|
data/TODO.txt
CHANGED
@@ -1,71 +1,61 @@
|
|
1
|
-
|
1
|
+
activities_with_prices:
|
2
2
|
|
3
|
-
|
4
|
-
* I don't know if we should/need-to adjust the invoice pdfs out here just yet ....
|
5
|
-
* Might as well put this in migration 29 while we're publishing anyways
|
6
|
-
|
7
|
-
* (Install the rails-debugger on your laptop)
|
8
|
-
|
9
|
-
Now for the final Controller Adjustments:
|
10
|
-
* Invoice_id should be settable on the labor/materials/proposals/etc controllers. (though not the activities controller..not yet at least)
|
11
|
-
* Invoice create/update Activity assignments will likely need to be adjusted...
|
12
|
-
* Be sure to adjust any invoice_create tasks as well...
|
13
|
-
|
14
|
-
* Keep in mind - we may need/want to update InvoicePayments and not just delete/create them (say an allocaed amount changes from $4.00 -> $3.00 on the same invoice/payment
|
15
|
-
* let's start by adding a detail that shows what payments are currently allocated..
|
16
|
-
* We don't need to get sart about allocating, unless there's 0 allocated payments whcih are currently assigned...
|
17
|
-
* Show a warning if someone tries to commit a payment w/o allocating the full amount...
|
18
|
-
* Don't forget to Add the right show-action fields too (in the payments controller)
|
19
|
-
* There's should be a way in the invoices to show which payments were applied to the invoice... (perhaps on the edit detail - just a listing?)
|
20
|
-
* Maybe this should be editable.... perhaps only if is_published?
|
21
|
-
* THen we can add an edit...
|
22
|
-
* Remove that restriction on unpublishing old invoices...
|
23
|
-
* And then we need to add a complemntary field in the invoices view? Nah - but show which payments are currently assigned as a read-only...
|
3
|
+
- Release gem as 'final'
|
24
4
|
|
25
|
-
|
5
|
+
--- Put a beta version on mario? ...
|
6
|
+
|
7
|
+
* Use polymorphic relationship for sub activities
|
8
|
+
* I really don't like the way we're uing dont_validate_type_associations. ..
|
9
|
+
* See if we can get rid of the association_hacks while we're at it ...
|
26
10
|
|
27
|
-
*
|
11
|
+
* Translate the time into the local zone for the user, probably each user/client should have a zone associtation in their account.
|
12
|
+
* Its already stored in UTC everywhere...
|
13
|
+
* We need to factor this into invoices too, I think
|
28
14
|
|
29
|
-
*
|
15
|
+
* Rails 3.x?
|
30
16
|
|
31
|
-
*
|
32
|
-
|
17
|
+
* Plugin interface...
|
18
|
+
* We should DRY the interfaces for inheritance on the activities and invoices controllers (See "TODO: Put in a plugin-helper?")
|
19
|
+
* I think the mountable apps is our good solution. Alongside a generator
|
20
|
+
|
21
|
+
* Ideally we have that DraftInvoices/ "Batch Create" link to the left of Create..
|
33
22
|
|
34
|
-
*
|
23
|
+
* Assign version numbers to the invoice based on the number of times an invoice is published...
|
24
|
+
* I don't know if we should/need-to adjust the invoice pdfs out here just yet ....
|
35
25
|
|
36
|
-
*
|
26
|
+
* Slimtimer-less time entry
|
27
|
+
* http://dhtmlx.com/docs/products/dhtmlxScheduler/index.shtml
|
37
28
|
|
38
|
-
*
|
29
|
+
* reocurring payments module with rake task
|
30
|
+
* DDC / GI / Ashbritt / Manny Kadre bills
|
31
|
+
|
32
|
+
* Start using 0.9 on mario...
|
33
|
+
|
34
|
+
* We may want to go through the controllers and modify the searches a bit:
|
35
|
+
config.columns[:clients].search_sql
|
36
|
+
config.search.columns = config.list.columns
|
39
37
|
|
40
|
-
* Start using 0.8-pre on mario...
|
41
38
|
|
42
39
|
* Publish !!!!!
|
43
40
|
---------------
|
41
|
+
* Things might be a little awkward with out activity assignment if people are going back and editing old stuff... we should really have an activity selector...
|
42
|
+
|
44
43
|
* all delete confirms should go through the modal box
|
45
44
|
|
46
|
-
* Probably - we should prompt on invoice update, when appropriate, whether to email the client.
|
47
|
-
* Probably too, publish should be a row-action and not a form control
|
48
45
|
* Probably - when prompted to delete an invoice, we should give the option to also remove the activities (or preserve them and leave them unsassigned)
|
49
46
|
|
50
|
-
* Translate the time into the local zone for the user, probably each user/client should have a zone associtation in their account.
|
51
|
-
* Its already stored in UTC everywhere...
|
52
|
-
* We need to factor this into invoices too, I think
|
53
|
-
|
54
47
|
* Public interface
|
55
48
|
|
56
|
-
*
|
57
|
-
|
58
|
-
* Publish !!!!!
|
49
|
+
* Publish 1.0 !!!!!
|
59
50
|
---------------
|
60
|
-
* CC payments handling built-in- not a plugin
|
61
51
|
|
62
|
-
*
|
52
|
+
* Eventlogs as an unedutable nested list might be nice... Hell, employee eventlogs too....
|
53
|
+
|
54
|
+
* CC payments handling built-in- not a plugin
|
63
55
|
|
64
56
|
* Revise the site-settings interfaces...
|
65
57
|
|
66
|
-
*
|
67
|
-
|
68
|
-
* Publish 0.9 !!!!!
|
58
|
+
* Publish 1.1 !!!!!
|
69
59
|
---------------
|
70
60
|
---------------
|
71
61
|
LONGER-TERM Features: (Needs re-prioritization...)
|
@@ -81,19 +71,9 @@ LONGER-TERM Features: (Needs re-prioritization...)
|
|
81
71
|
|
82
72
|
* Drop the VIEW hacks and de-normalize the payments/invoices tables. Just 'cache' the irksome values in here
|
83
73
|
|
84
|
-
* Better searches by using the search sql fields...
|
85
|
-
|
86
|
-
* See what we decide to do long-term with our model_view hack, maybe we can run tests on both models, as well as their view_models. Just one by one... I think thats smart...
|
87
|
-
|
88
74
|
Feature: Make the Search actually work the way we'd expect. Perhaps even make something mroe useful still that would let us filter records...
|
89
75
|
|
90
76
|
BUG: We should probably write a plugin that better displays delete errors in the flash[:error] , invoices is a good place for that
|
91
|
-
* BTW - why does it show delete as an option here when we clearly can't delete some of these
|
92
|
-
* Also- it'd be nice to show a pretty record error in the invoices update, if you try to update the activities on a published invoice
|
93
|
-
* Create two invoices - both unpublished, try to delete the oldest one
|
94
|
-
|
95
|
-
* Use polymorphic relationship for sub activities
|
96
|
-
* I really don't like the way we're uing dont_validate_type_associations. ..
|
97
77
|
|
98
78
|
* The ability to create an activity from the activities & invoices/activities list would be sweet
|
99
79
|
* With a little pop-up that asks for the activity type?
|
@@ -104,8 +84,6 @@ BUG: We should probably write a plugin that better displays delete errors in the
|
|
104
84
|
* This gets a little complicated though - we have to decide if we're going to generate these warnings based on the date of the invoice, or the current situation
|
105
85
|
|
106
86
|
* The invoice issued_on date I think is rounding off to the end of the day on assignment. It should really be time sensitive.
|
107
|
-
|
108
|
-
* Better unit tests for Activity::* model. (too , make sure negative values work on whatever..)
|
109
87
|
|
110
88
|
Plugins for
|
111
89
|
* Reimbursable scanning
|
@@ -114,9 +92,7 @@ Plugins for
|
|
114
92
|
|
115
93
|
* An employee_rate_changed_last changed plugin would be super-useful at some point...
|
116
94
|
|
117
|
-
|
118
|
-
* Todo list.. maybe just a block? Call it an outstanding issues/projects
|
119
|
-
* Client Notes? Probably just a google docs link
|
95
|
+
|
120
96
|
-------------------
|
121
97
|
dd if=/dev/urandom bs=200 count=1 | tr -cd 'A-Za-z0-9!@#$%^&*()_+'; echo
|
122
98
|
|
@@ -125,10 +101,3 @@ GRANT ALL PRIVILEGES ON briskbills_development.* TO briskbills@localhost IDENTIF
|
|
125
101
|
|
126
102
|
CREATE DATABASE `cusis_test`;
|
127
103
|
GRANT ALL PRIVILEGES ON cusis_test.* TO cusis@localhost IDENTIFIED BY 'cut1ckle';
|
128
|
-
-------------------
|
129
|
-
required gems:
|
130
|
-
* extensions
|
131
|
-
* pdf-writer
|
132
|
-
* slimtimer4r
|
133
|
-
* money
|
134
|
-
|
@@ -2,6 +2,7 @@ class Admin::ActivitiesController < ApplicationController
|
|
2
2
|
include AdminLayoutHelper
|
3
3
|
include ExtensibleObjectHelper
|
4
4
|
|
5
|
+
# TODO: Put in a helper?
|
5
6
|
def self.activities_scaffold_config(&block)
|
6
7
|
@activities_scaffold_configs ||= []
|
7
8
|
@activities_scaffold_configs << block.to_proc
|
@@ -13,6 +14,7 @@ class Admin::ActivitiesController < ApplicationController
|
|
13
14
|
|
14
15
|
active_scaffold(:activity){|c| configs.each{|ac| ac.call c if ac.respond_to? :call} }
|
15
16
|
end
|
17
|
+
# /TODO: Put in a helper?
|
16
18
|
|
17
19
|
activities_scaffold_config do |config|
|
18
20
|
config.label = "Activity Quick-Review"
|
@@ -31,15 +33,14 @@ class Admin::ActivitiesController < ApplicationController
|
|
31
33
|
|
32
34
|
config.list.columns = [:activity, :occurred_on]
|
33
35
|
|
34
|
-
config.create.columns = config.update.columns = [:occurred_on]
|
35
|
-
|
36
|
+
config.create.columns = config.update.columns = [:occurred_on]
|
36
37
|
config.full_list_refresh_on = [:update, :create, :destroy]
|
37
38
|
|
38
39
|
# This allows us to use the for_activity_type parameter to selectively constriain fields to the appropriate record types.
|
39
40
|
config.columns.instance_eval do
|
40
41
|
|
41
42
|
# Column selective inclusion, based on activity_type:
|
42
|
-
alias :add_without_activities :add
|
43
|
+
alias :add_without_activities :add unless self.respond_to? :add_without_activities
|
43
44
|
|
44
45
|
def extend_activity_column(col)
|
45
46
|
def col.for_activity_type?(type); (for_activities.length == 0 or for_activities.include? type) ? true : false; end
|
@@ -6,25 +6,34 @@ class Admin::ActivitiesWithPricesController < Admin::ActivitiesController
|
|
6
6
|
config.label = "Invoice Activity"
|
7
7
|
|
8
8
|
config.columns << [:cost, :tax]
|
9
|
-
config.list.columns = [:activity, :
|
9
|
+
config.list.columns = [:activity, :tax, :cost, :occurred_on]
|
10
10
|
|
11
|
-
config.action_links.add
|
12
|
-
|
11
|
+
config.action_links.add(
|
12
|
+
:move_to_invoice,
|
13
|
+
:type => :member,
|
14
|
+
:label => 'Move...',
|
15
|
+
:crud_type => :update,
|
16
|
+
:action => 'move_to_invoice'
|
17
|
+
)
|
18
|
+
|
13
19
|
config.columns[:cost].sort_by :sql => 'cost_in_cents'
|
14
|
-
config.columns[:tax].sort_by
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
config.columns[:tax].sort_by :sql => 'tax_in_cents'
|
21
|
+
end
|
22
|
+
|
23
|
+
# This adjusts the order of the link so that move appears to the left:
|
24
|
+
def action_links_order
|
25
|
+
links = active_scaffold_config.action_links
|
26
|
+
links.sort_by{ |l| ( l.action == "move_to_invoice" ) ? -1 : 1 }
|
20
27
|
end
|
21
28
|
|
29
|
+
# TODO: Put in a plugin-helper?
|
22
30
|
# We need to be sure the view is looking in the right place, this little hack should do it:
|
23
31
|
def self.active_scaffold_paths
|
24
32
|
super_view_path = BRISKBILLS_ROOT+'/app/views/admin/activities'
|
25
33
|
@active_scaffold_overrides << super_view_path unless @active_scaffold_overrides.include? super_view_path
|
26
34
|
super
|
27
35
|
end
|
36
|
+
# /TODO
|
28
37
|
|
29
38
|
# This is a little hackish - but it fixes would-be problems with the observation code
|
30
39
|
@active_scaffold_observations = superclass.active_scaffold_observations
|
@@ -46,19 +55,24 @@ class Admin::ActivitiesWithPricesController < Admin::ActivitiesController
|
|
46
55
|
|
47
56
|
if params.has_key? :move_to_invoice_id
|
48
57
|
begin
|
49
|
-
invoice_dest =
|
50
|
-
|
58
|
+
invoice_dest = (params[:move_to_invoice_id].empty?) ?
|
59
|
+
nil :
|
60
|
+
Invoice.find(params[:move_to_invoice_id].to_i)
|
61
|
+
|
62
|
+
activity.move_to_invoice! invoice_dest
|
51
63
|
|
52
64
|
do_list
|
53
65
|
|
54
|
-
flash[:warning] =
|
66
|
+
flash[:warning] = (invoice_dest) ?
|
67
|
+
('%s successfully moved to "%s"' % [activity.label,invoice_dest.long_name]) :
|
68
|
+
('The %s was removed from this invoice.' % activity.label)
|
55
69
|
rescue
|
56
70
|
@errors_during_move << $!
|
57
71
|
end
|
58
72
|
|
59
|
-
render :action => 'move_to_invoice.
|
73
|
+
render :action => 'move_to_invoice.js'
|
60
74
|
else
|
61
|
-
render :action => 'move_to_invoice.
|
75
|
+
render :action => 'move_to_invoice.html', :layout => false
|
62
76
|
end
|
63
77
|
end
|
64
78
|
|
@@ -2,7 +2,7 @@ class Admin::ClientAccountingController < ApplicationController
|
|
2
2
|
include AdminLayoutHelper
|
3
3
|
include ExtensibleObjectHelper
|
4
4
|
|
5
|
-
active_scaffold :
|
5
|
+
active_scaffold :client do |config|
|
6
6
|
config.label = "Accounts Ledger"
|
7
7
|
|
8
8
|
config.create.link = nil
|
@@ -27,13 +27,12 @@ class Admin::ClientAccountingController < ApplicationController
|
|
27
27
|
config.create.columns = [:company_name, :address1, :address2, :city, :state, :zip, :phone_number, :fax_number ]
|
28
28
|
config.update.columns = [:company_name, :address1, :address2, :city, :state, :zip, :phone_number, :fax_number, :is_active]
|
29
29
|
|
30
|
-
config.nested.add_link "Invoices",
|
31
|
-
config.nested.add_link "Payments",
|
32
|
-
config.nested.add_link "Labor Rates",
|
33
|
-
config.nested.add_link "Transactions",
|
34
|
-
|
35
|
-
config.full_list_refresh_on = [:update, :destroy]
|
30
|
+
config.nested.add_link "Invoices", :invoices
|
31
|
+
config.nested.add_link "Payments", :payments
|
32
|
+
config.nested.add_link "Labor Rates", :employee_client_labor_rates
|
33
|
+
config.nested.add_link "Transactions", :client_financial_transactions
|
36
34
|
|
35
|
+
config.full_list_refresh_on = [:update, :destroy]
|
37
36
|
end
|
38
37
|
|
39
38
|
def self.active_scaffold_controller_for(klass)
|
@@ -44,6 +43,10 @@ class Admin::ClientAccountingController < ApplicationController
|
|
44
43
|
def conditions_for_collection
|
45
44
|
['is_active = ?', true]
|
46
45
|
end
|
47
|
-
|
46
|
+
|
47
|
+
def custom_finder_options
|
48
|
+
{:from => 'clients_with_balances AS clients'}
|
49
|
+
end
|
50
|
+
|
48
51
|
handle_extensions
|
49
52
|
end
|
@@ -8,23 +8,52 @@ class Admin::ClientRepresentativesController < ApplicationController
|
|
8
8
|
config.columns = [:clients, :first_name, :last_name, :title, :cell_phone, :password, :login_enabled, :accepts_tos_version, :email_address, :notes, :created_at, :updated_at]
|
9
9
|
|
10
10
|
config.columns[:clients].form_ui = :select
|
11
|
-
columns[:clients].sort_by :sql => 'clients.company_name'
|
11
|
+
config.columns[:clients].sort_by :sql => 'clients.company_name'
|
12
|
+
config.columns[:clients].search_sql = 'clients.company_name'
|
12
13
|
|
13
14
|
config.columns[:email_address].includes = [:credential]
|
14
15
|
config.columns[:email_address].sort_by :sql => "credentials.email_address"
|
16
|
+
config.columns[:email_address].search_sql = 'credentials.email_address'
|
17
|
+
|
15
18
|
|
16
19
|
config.columns[:title].label = 'Job Title'
|
17
20
|
|
18
|
-
|
21
|
+
# If someone tries a 'delete' when we're nested inside the clients controller,
|
22
|
+
# This ensures the habtm relationship is deleted, and not the record
|
23
|
+
config.nested.shallow_delete = true
|
24
|
+
|
25
|
+
config.search.columns = config.list.columns = [:clients, :last_name, :first_name, :email_address]
|
19
26
|
|
20
27
|
config.create.columns = config.update.columns = [:first_name, :last_name, :email_address, :password, :login_enabled, :title, :cell_phone, :clients, :notes]
|
21
28
|
|
22
29
|
config.list.sorting = [{:clients => :asc},{:last_name => :asc},{:first_name => :asc}]
|
23
30
|
end
|
24
31
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
32
|
+
# We override this method b/c at some point in the new active_scaffold code, there was a bug
|
33
|
+
# that stopped this from being smart enough to recognize the :uniq on the client_representatives
|
34
|
+
# association. in he new_existing action
|
35
|
+
def merge_conditions(*conditions)
|
36
|
+
|
37
|
+
if (
|
38
|
+
params[:action].to_sym == :new_existing &&
|
39
|
+
params.has_key?(:parent_model) &&
|
40
|
+
params.has_key?(:eid)
|
41
|
+
)
|
42
|
+
parent_klass = params[:parent_model].constantize
|
43
|
+
|
44
|
+
# I'm not sure if table_name is the right method to use exactly - but it works here...
|
45
|
+
parent_id = session["as:#{params[:eid]}"][:constraints][parent_klass.table_name.to_sym].to_i if parent_klass
|
46
|
+
|
47
|
+
parent_record = parent_klass.find parent_id if parent_id
|
48
|
+
|
49
|
+
existing_association_ids = parent_record.send('%s_ids' % params[:parent_column].singularize) if parent_record
|
50
|
+
|
51
|
+
(existing_association_ids.try(:length) > 0) ?
|
52
|
+
['`client_representatives`.id NOT IN (?)', existing_association_ids] :
|
53
|
+
nil
|
54
|
+
else
|
55
|
+
super(*conditions)
|
56
|
+
end
|
28
57
|
end
|
29
58
|
|
30
59
|
handle_extensions
|
@@ -17,7 +17,7 @@ class Admin::ClientsController < ApplicationController
|
|
17
17
|
config.create.columns = [:company_name, :address1, :address2, :city, :state, :zip, :phone_number, :fax_number ]
|
18
18
|
config.update.columns = [:company_name, :address1, :address2, :city, :state, :zip, :phone_number, :fax_number, :is_active]
|
19
19
|
|
20
|
-
config.nested.add_link "Representatives",
|
20
|
+
config.nested.add_link "Representatives", :client_representatives
|
21
21
|
|
22
22
|
config.full_list_refresh_on = [:update, :destroy]
|
23
23
|
end
|