Commit Graph

72 Commits

Author SHA1 Message Date
Thomas Steen Rasmussen d5fa4b98d5 fix ordering and epaypaymentadmin 2021-08-03 09:03:42 +02:00
Thomas Steen Rasmussen 7d4ad533f7 remove oooold typo 2021-08-01 18:12:58 +02:00
Thomas Steen Rasmussen 792fc2bfc0 unbreak refund order function, while here show on order list and detail pages if an order is refunded, also fix tickettype detail stats so they dont include refunded orders 2021-08-01 17:45:37 +02:00
Thomas Steen Rasmussen 517f29940a remove FK from ShopTicket to Order and replace with an FK to OrderProductRelation 2021-07-29 09:03:52 +02:00
Thomas Steen Rasmussen a494bdfd4b backoffice: add totals to the bottom of ticket type details table 2021-07-26 18:09:11 +02:00
Thomas Steen Rasmussen 02b796e90b rename to paid_order_count 2021-07-22 08:06:43 +02:00
Thomas Steen Rasmussen f61d0b85e8 use Count() to get the number of paid orders for the product 2021-07-22 08:02:28 +02:00
Thomas Steen Rasmussen 21b479e253 only count paid orders 2021-07-22 07:12:13 +02:00
Thomas Steen Rasmussen 41467447a8 always mark OPR as ticket_generated=True 2021-07-22 00:35:07 +02:00
Thomas Steen Rasmussen 0e0374b577 calculate profit in the database, skip the margin calculation for now 2021-07-22 00:07:30 +02:00
Thomas Steen Rasmussen ec816a5c11 realise there can be more than one thing on each ticket, fix 2021-07-21 23:14:48 +02:00
Thomas Steen Rasmussen 0973709ef0 fix profit margin calculation 2021-07-21 21:36:50 +02:00
Thomas Steen Rasmussen 5c410939ed add detailed ticket stats view 2021-07-21 21:29:55 +02:00
Thomas Steen Rasmussen a8c4894b8f brush the dust off of the event system, add a new eventtype ticket_stats, add a management command to post ticket stats to irc, add a backoffice view showing ticket stats 2021-07-21 18:53:53 +02:00
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 7f05372bb9 rename cash payment method to 'in person' - it could also be called izettle, but lets keep the brandname out of it :) Orders with payment method IN_PERSON can be paid at the infodesk with izettle. While here update some text on the checkout page and update icons to FA 2020-08-12 17:49:24 +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 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
Thomas Steen Rasmussen 377a77143c black everything, working on #355 2020-02-07 18:46:34 +01:00
Thomas Steen Rasmussen 0cb7b688fa sort products by category weight on shop page 2019-12-16 23:41:05 +01:00
Víðir Valberg Guðmundsson 0373816355 Add "single_ticket_per_product" boolean to ticket types so we can control ticket creation. 2019-07-30 22:51:01 +02:00
Thomas Steen Rasmussen 024f5dd093 this was probably what it was meant to be 2019-07-30 01:46:27 +02:00
Víðir Valberg Guðmundsson b7feb96c9b Adding a badge token to tickets that grant that. 2019-07-24 21:08:36 +02:00
Víðir Valberg Guðmundsson cad3b21fc4 handed_out -> ticket_generated 2019-07-18 21:20:29 +02:00
Víðir Valberg Guðmundsson b1b810f165 Rename handed_out field on ORP to ticket_generated. Rename checked_in on tickets to used. Add save token migration. 2019-07-18 21:04:49 +02:00
Thomas Steen Rasmussen effd900b62 add proforma invoice support 2019-07-09 10:38:14 +02:00
Víðir Valberg Guðmundsson e78013c87c Blackness. 2019-03-29 22:19:49 +01:00
Víðir Valberg Guðmundsson 59cde9163f Use a modelformset for the order detail view to be able to validate stock on updates of quantities and payment of the order. 2019-03-27 22:53:23 +01:00
Víðir Valberg Guðmundsson 39383e0acb Check for orders which are cancelled=False instead of those who are paid to avoid "overselling". 2019-03-27 12:57:50 +01:00
Víðir Valberg Guðmundsson 8fb9e60601 Add a safety valve for creating tickets when marking an order as paid. Fix #136 2019-03-17 16:28:01 +01:00
Víðir Valberg Guðmundsson 512be60da5 Products can not be handed out if order is not paid. Fix #284. 2019-03-17 15:31:15 +01:00
Thomas Steen Rasmussen a5e67fcb8c remove extra mark_as_cancelled method 2019-03-17 15:21:03 +01:00
Thomas Steen Rasmussen 481a7d1a95 add mass order cancel adminaction 2019-03-17 15:04:28 +01:00
Thomas Steen Rasmussen 2c1e5f12fe add textfield notes to Order for internal orga notes about the order 2018-08-27 12:44:53 +02:00
Thomas Steen Rasmussen f396708156 finish work on custom invoice address 2018-08-27 11:52:42 +02:00
Patrick Welzel 8b8191e16d add custom address field to shop.models.Order and invoice template 2018-08-22 15:41:24 +02:00
Víðir Valberg Guðmundsson ac68daf0b6 Update admin. Fix some more tests. Add stock info to template. 2018-04-24 18:06:19 +02:00
Víðir Valberg Guðmundsson c9ae322025 Added the first tests to the project. Using factory_boy for great success. 2018-04-21 23:06:41 +02:00
Víðir Valberg Guðmundsson 193c182422 Add stock_amount to product and reflect it in product detail template. (#213) 2018-04-21 17:00:39 +02:00
Víðir Valberg Guðmundsson ff758b15ff Initial work on uprading. 2018-04-03 18:44:10 +02:00
Stephan Telling df5e167376
add on_delete to all foreignkeys 2018-03-04 16:26:35 +01:00
Stephan Telling 488767b4f0 cleanup in shop/ 2018-03-04 16:00:30 +01:00
Stephan Telling 93a827bf7e mark orders as paid in bootstrap script (#189)
they are marked as payed such that tickets are generated so we can
design the backoffice$
2017-12-12 22:13:38 +01:00
Thomas Steen Rasmussen 66014811a4 remove the old Ticket model, move irc notification signal handler to the new Tickets app, various cleanup, fixes #168 2017-10-04 00:06:49 +02:00
Thomas Steen Rasmussen e0e65212bc mark orderproductrelations as handed_out=True when Ticket objects have been created 2017-10-03 23:45:22 +02:00
Thomas Steen Rasmussen 7eb8d2d6d2 copy paste error 2017-09-17 15:27:47 +02:00
Thomas Steen Rasmussen d14d67496d add danish_vat field to creditnote model and template 2017-09-17 15:00:38 +02:00