Commit graph

52 commits

Author SHA1 Message Date
Thomas Steen Rasmussen 01687ea11a run pre-commit --all-files, it's been a while since last time 2021-07-19 15:06:10 +02:00
Thomas Steen Rasmussen fbda2b4b53 more work on backoffice economy stuff, chains and credebtors section now only shows expenses and revenues for the current camp, thanks to some ORM foo; while here add a cost and a comment field to the Product table, and fix a bug in bootstrap_devsite and a few nags to make new flake8 happy 2020-10-17 02:35:12 +02:00
Thomas Steen Rasmussen 833fc85e46 fix a few things in backoffice chain/credebtor views and templates, and update bootstrap_devsite script to create chains, credebtors, expenses and revenues 2020-10-16 17:22:41 +02:00
Thomas Steen Rasmussen 1dd13d6090 show DKK balance 2020-09-03 01:32:26 +02:00
Thomas Steen Rasmussen 442feb3e76 remember to substract them from the balance 2020-09-03 00:18:53 +02:00
Thomas Steen Rasmussen c35eac9fe8 add a PosReport field for HAX sold through webshop tickets 2020-09-03 00:16:44 +02:00
Thomas Steen Rasmussen 399b6dc16d add some aggregation and stuff on posreports in backoffice 2020-09-02 22:47:19 +02:00
Thomas Steen Rasmussen adf9dcd8d8 fix ordering of PosReports 2020-08-13 23:46:21 +02:00
Thomas Steen Rasmussen 9ecd59c40f add a comments field to PosReport 2020-08-13 18:55:41 +02:00
Thomas Steen Rasmussen ec1146a5dd fixup the PoS system a bit 2020-08-13 18:35:17 +02:00
Thomas Steen Rasmussen 64b8f0ee10 the old NullBooleanField defaulted to blank=True, BooleanField with null=True does not, TIL 2020-08-11 10:16:53 +02:00
Thomas Steen Rasmussen db20fd7b68 fix django3.1 compatibility 2020-08-11 02:35:18 +02:00
Thomas Steen Rasmussen 001ba2d955 add initial POS stuff 2020-08-11 02:22:36 +02:00
Thomas Steen Rasmussen bd53f64208 add responsible_team to most emails, while here run pre-commit run --all-files 2020-06-22 17:25:08 +02:00
Thomas Steen Rasmussen eff4bfaf1c
SpeakerAvailability, EventSession, autoscheduler, and other goodies (#497)
* fix old bug where the get_days() method would return the wrong number of days, this was not discovered because our bootstrap script has been creating 9 day camps instead of 8 day camps (this has been fixed in a different commit)

* remove stray debug print

* output camp days in local timezone (CEST usually), not UTC

* speakeravailability commit of doom, originally intended for #385 but goes a bit further than that. Adds SpeakerAvailability and EventSession models, and models for the new autoscheduler. Update bootstrap script and more. New conference_autoscheduler dependency. Work in progress, but ready for playing around!

* add conference-scheduler to requirements

* rework migrations, work at bit with postgres range fields and bounds, change how speakeravailability is saved (continuous ranges instead of 1 hour chunks), add tests for utils/range_fields.py including adding hypothesis to requirements/dev.txt, add a test which runs our bootstrap script

* catch name collision in the right place, and load missing postgres extension in the migration

* add some verbosity to see what the travis issue might be

* manually create btree_gist extension in postgres, not sure why the BtreeGistExtension() operation in program/migrations/0085... isn't working in travis?

* create extension in the right database maybe

* lets try this then

* ok so the problem is not that the btree_gist extension isn't getting loaded, the problem is that GIST indexes do not work with uuid fields in postgres 9.6, lets take another stab at getting pg10 with postgis to work with in travis

* lets try normal socket connection

* add SPEAKER_AVAILABILITY_DAYCHUNK_HOURS=3 to travis environment_settings.py

* rework migrations, change so an autoschedule can work with multiple eventtypes, change AutoSlot model to use a DateTimeRangeField so we can use the database for more efficient lookups, add 'conflicts' self m2m for EventLocation to indicate when a room conflicts with another room, add a support_autoscheduling bool to EventType, add workshops to bootstrap script, add timing output to bootstrap script

* update README a bit, move some functionality to model methods, update jquery and jquery.datatables, include datatables in base.html instead of in each page, start adding backoffice schedule management views (unfinished), yolo commit so I can show valberg something

* Switch to a more simple way of using the autoscheduler, meaning we can remove the whole autoscheduler app and all models. All autoscheduler code is now in program/autoscheduler.py and a bit in backoffice views. Add more backoffice CRUD views for schedule management. Add datatables moment.js plugin to help table sorting of dates. Add Speaker{Proposal}EventConflict model to allow speakers to inform us which events they want to attend so we dont schedule them at the same time. Add EventTag model. New models not hooked up to anything yet.

* handle cases where there is no solution without failing, also dont return anything here

* wrong block kiddo

* switch from EventInstance to EventSlot as the way we schedule events. Finish backoffice content team views (mostly). Many small changes. Prod will need data migration of EventInstances -> EventSlots when the time comes.

* keep speakeravailability stuff a bit more DRY by using the AvailabilityMatrixViewMixin everywhere, add event_duration_minutes to EventSession create/update form, reverse the order we delete/create EventSlot objects when updating an EventSession

* go through all views, fix various little bugs here and there

* add missing migration

* add django-taggit, add tags for Events, add tags in bootstrap script, make AutoScheduler use tags. Add tags in forms and templates.

* fix taggit entry in requirements

* Fix our iCal view: Add uuid field to Event, add uuid property to EventSlot which calculates a consitent UUID for an event at a start time at a location. Use this as the schedule uuid. While here fix so our iCal export is valid, a few fields were missing, the iCal file now validates 100% OK.

* fix our FRAB xml export view

* comment the EventSlot.uuid property better

* typo in comment

* language

Co-Authored-By: Benjamin Balder Bach <benjamin@overtag.dk>

* language

Co-Authored-By: Benjamin Balder Bach <benjamin@overtag.dk>

* Update src/backoffice/templates/autoschedule_debug_events.html

Co-Authored-By: Benjamin Balder Bach <benjamin@overtag.dk>

* add a field to make this form look less weird. No difference in functionality.

* remove stray print and refactor this form init a bit

* fix ScheduleView

* only show slots where all speakers are available when scheduling events manually in backoffice

* make event list sortable by video recording column

* update description on {speaker|event}proposal models reason field

* remove badge showing number of scheduled slots for each event in backoffice eventlist. it was unclear what the number meant and it doesn't really fit

* remember to consider events in the same location when deciding whether a slot is available or not

* add is_available() method to EventLocation, add clean_location() method to EventSlot, call it from EventSlot.clean(), update a bit of text in eventslotunschedule template

* fix EventSession.get_available_slots() so it doesnt return busy slots as available, and since this means we can no longer schedule stuff in the lunchbreak lower the number of talks in the bootstrap script a bit so we have a better chance of having a solvable problem

* fix the excludefilter in EventSession.get_available_slots() for real this time, also fix an icon and add link in event schedule template in backoffice

* show message when no slots are available for manual scheduling in backoffice

* add event_conflicts to SpeakerUpdateView form in backoffice

* fix link to speaker object in speakerproposal list in backoffice

* allow blank tags

* make duration validation depend on the eventtype event_duration_minutes if we have one. fix help_text and label and placeholder for all duration fields

* allow music acts up to 180 mins in the bootstrap data

* fix wrong eventtype name for recreational events in speakerproposalform

* stretch the colspan one cell more

* save event_conflicts m2m when submitting speaker and event together

* form not self, and add succes message

* move js function toggleclass() to bornhack.js and rename to toggle_sa_form_class(), function is used in several templates and was missing when submitting combined proposals

* move the no-js removal to the top of ready() function

This will allow other javascript initialization (eg. DataTable) to see the elements and initialize accordingly (eg. column width for tables)

* Fixed problem with event feedback detail view

* Fixed problem with event feedback list view

* introduce a get_tzrange_days() function and use that to get the relevant days for the matrix instead of camp.get_days(), thereby fixing some display issues when eventsessions cross dates

* show submitting user and link to proposal on backoffice event detail page, change User to Submitter in backoffice speaker list table

* show warning by the buttons when a proposal cannot be approved, and show better text on approve/reject buttons

* disable js schedule, save m2m, prefetch some stuff

* fix broken date header in table

* remove use of djangos regular slugify function, use the new utils.slugs.unique_slugify() instead

Co-authored-by: Thomas Steen Rasmussen <tykling@bornhack.org>
Co-authored-by: Benjamin Balder Bach <benjamin@overtag.dk>
Co-authored-by: Thomas Flummer <tf@flummer.net>
2020-06-03 21:18:06 +02:00
Thomas Steen Rasmussen 00af109e2f
add flake8 and isort to pre-commit config, make flake8 and isort happy (#441)
* add flake8 to pre-commit config, and fixup many things to make flake8 happy

* add isort and sort all imports, add to pre-commit and requirements
2020-02-12 13:10:41 +01:00
Víðir Valberg Guðmundsson bf2f0c7898 Blackness. 2019-06-16 14:32:24 +02:00
Víðir Valberg Guðmundsson 75c8db4577 Get rid of wrapt hack. Django 2.2 introduced setup() method on views. Yay! 2019-04-02 12:32:12 +02:00
Thomas Steen Rasmussen a11cb38471 set creditor and debtor to null=False 2019-03-30 10:45:36 +01:00
Thomas Steen Rasmussen ad256b0df4 add admin links to expense and revenue list and detail templates. Do we have a nicer way of linking to stuff in the admin? 2019-03-30 07:21:11 +01:00
Thomas Steen Rasmussen 3e79567713 add chain&credebtor views to backoffice 2019-03-30 06:54:45 +01:00
Thomas Steen Rasmussen c432899346 allow blank slugs 2019-03-28 07:16:02 +01:00
Thomas Steen Rasmussen f248a5e0ca Add Chain/Creditor/Debtor support in economy app. Make the Creditor/Debtor FK nullable for now, until we've backfilled Creditors/Debtors on all existing Expenses and Revenues. 2019-03-28 07:04:53 +01:00
Víðir Valberg Guðmundsson 313ce98f8a Missing migration from when we added the date format. 2019-03-27 09:36:42 +01:00
Víðir Valberg Guðmundsson eb07af9c39 Add a note about the format for invoice dates for expenses and revnues. Fix #292. 2019-03-18 13:06:34 +01:00
Thomas Steen Rasmussen 8c9b2d11bf fix expenseadmin 2019-02-10 16:33:05 +01:00
Thomas Steen Rasmussen c93b38a98b make invoice_date a datefield not a datetimefield 2019-01-20 16:42:50 +01:00
Thomas Steen Rasmussen d14708bee1 add invoice_date to django admin list display 2019-01-20 15:58:10 +01:00
Thomas Steen Rasmussen 51f8854a6c show user on expense and revenue list and detail views 2019-01-20 15:50:54 +01:00
Thomas Steen Rasmussen 864a7e6673 add invoice_date to revenue and expense forms and templates 2019-01-20 15:39:59 +01:00
Thomas Steen Rasmussen e8edb24233 add invoice_date field to Expense and Revenue models 2019-01-20 15:33:05 +01:00
Thomas Steen Rasmussen 090a3b1e28 show both users on reimbursements 2019-01-20 09:38:18 +01:00
Thomas Steen Rasmussen 5e95133267 update help_text on a reimbursement field, and count reimbursement total with the right user field 2018-11-20 18:36:06 +01:00
Thomas Steen Rasmussen 733731ecf9 take camp into account when showing economy stats 2018-11-20 18:14:16 +01:00
Thomas Steen Rasmussen a057bd6464
Revenue and economy revamp (#285)
* rework economy stuff, add revenue model, unfinished code!

* part 2 of economy overhaul. add views for dealing with revenue. rework expense views.
2018-11-20 17:12:32 +01:00
Thomas Steen Rasmussen 348c73323d make sure expense attachments open in a new window 2018-09-16 11:23:32 +02:00
Thomas Steen Rasmussen 794e905050 show both user and reimbursement_user for reimbursements 2018-09-13 14:09:17 +02:00
Thomas Steen Rasmussen 1cd0551d5e the amount of an expense can NOT be negative 2018-09-01 10:25:45 +02:00
Thomas Steen Rasmussen 4123c2eb91 clarify that expense amount can be negative 2018-09-01 09:56:22 +02:00
Thomas Steen Rasmussen ac54e4cb16 show unapproved expenses seperately in backoffice, crosslink expenses and reimbursements in list and detailviews on main page and in backoffice 2018-08-30 19:32:23 +02:00
Thomas Steen Rasmussen 698beaaffd refactor email functionality into seperate functions in economy.email module 2018-08-30 17:54:31 +02:00
Thomas Steen Rasmussen 435f95b70b only use base filename, not full path lol 2018-08-30 17:31:43 +02:00
Thomas Steen Rasmussen b753d05b5c include expense uuid in subject of email to economic 2018-08-30 15:22:23 +02:00
Thomas Steen Rasmussen fca7bd3721 filter on reimbursement_user not user 2018-08-30 13:24:23 +02:00
Thomas Steen Rasmussen b56b9c27b4 include the actual attachment when sending to e-conomic 2018-08-30 13:17:52 +02:00
Thomas Steen Rasmussen db73051a23 enable admin for Reimbursement model 2018-08-30 13:17:34 +02:00
Thomas Steen Rasmussen fc3a993547 do not show the expense which represents the actual reimbursement, and do not count it towards the total 2018-08-30 12:39:43 +02:00
Thomas Steen Rasmussen 93b0bff50b permit PDF as well as images for invoice uploads for expenses 2018-08-30 12:18:56 +02:00
Thomas Steen Rasmussen ed736938cc small markup fix 2018-08-30 01:42:45 +02:00
Thomas Steen Rasmussen 4d6a69d50a remove stray pk_url_kwarg 2018-08-30 01:40:39 +02:00