From 87960dcc45215ae8c3632431330f8088fc97f1b0 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lemburg Date: Wed, 9 Nov 2016 15:35:37 +0100 Subject: [PATCH 1/7] Fix stats display to output values sorted by fare code and price. --- assopy/stats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assopy/stats.py b/assopy/stats.py index 568c272ba..17f353f7a 100644 --- a/assopy/stats.py +++ b/assopy/stats.py @@ -191,9 +191,9 @@ def _calc_prices(order_id, items): tcp[code]['prices'][price]['count'] += 1 # Replace prices dicts with sorted lists for code in tcp.keys(): - prices_list = [entry - for price, entry in sorted(list(tcp[code]['prices'].items()), - reverse=True)] + prices_list = [ + entry for price, entry in sorted(tcp[code]['prices'].items(), reverse=True) + ] tcp[code]['prices'] = prices_list # Create list sorted by fare code ticket_sales = [entry for code, entry in sorted(tcp.items())] From 741c967f3360610a939774f66272715629dfb7d9 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lemburg Date: Mon, 22 Jul 2019 09:23:42 +0200 Subject: [PATCH 2/7] Fix video script and ticket search apps (#1103) * Fix a couple more management commands. * Fix video_schedule_xlsx.py * Fix ticket search apps. * Fix ticket search app for EP2019. * Adjust speaker release form URL. --- p3/management/commands/video_schedule_xlsx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p3/management/commands/video_schedule_xlsx.py b/p3/management/commands/video_schedule_xlsx.py index 333f6c59c..a07d308f1 100644 --- a/p3/management/commands/video_schedule_xlsx.py +++ b/p3/management/commands/video_schedule_xlsx.py @@ -39,7 +39,7 @@ LICENSE = """ License: This video is licensed under the CC BY-NC-SA 3.0 license: https://creativecommons.org/licenses/by-nc-sa/3.0/ -Please see our speaker release agreement for details: https://ep2018.europython.eu/en/speaker-release-agreement/ +Please see our speaker release agreement for details: https://ep2019.europython.eu/events/speaker-release-agreement/ """ # Special handling of poster sessions From 9df87e7166fcfbac07e7cc7caedc7b894ba13771 Mon Sep 17 00:00:00 2001 From: umgelurgel Date: Fri, 9 Aug 2019 15:53:55 +0200 Subject: [PATCH 3/7] Add support for submitting slide urls. (#1111) --- templates/ep19/bs/talks/talk.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ep19/bs/talks/talk.html b/templates/ep19/bs/talks/talk.html index 76b5dac3f..c7b7c0314 100644 --- a/templates/ep19/bs/talks/talk.html +++ b/templates/ep19/bs/talks/talk.html @@ -47,7 +47,7 @@
{% for speaker in talk_as_dict.speakers %} Download Slides {% endif %} {% if talk_as_dict.slides_remote_url %} - View Slides + View Slides {% endif %}

{{ talk_as_dict.abstract|urlize|linebreaks }}

From fb2cb02b1d4347fb9fecdf585417943c0cebc3ff Mon Sep 17 00:00:00 2001 From: umgelurgel Date: Wed, 14 Aug 2019 11:59:19 +0200 Subject: [PATCH 4/7] Fix slides url in the template. (#1116) --- templates/ep19/bs/talks/talk.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ep19/bs/talks/talk.html b/templates/ep19/bs/talks/talk.html index c7b7c0314..76b5dac3f 100644 --- a/templates/ep19/bs/talks/talk.html +++ b/templates/ep19/bs/talks/talk.html @@ -47,7 +47,7 @@

{% for speaker in talk_as_dict.speakers %} Download Slides {% endif %} {% if talk_as_dict.slides_remote_url %} - View Slides + View Slides {% endif %}

{{ talk_as_dict.abstract|urlize|linebreaks }}

From 2bb85de5881c6178f0845ac6ca6a6084fa7d0afc Mon Sep 17 00:00:00 2001 From: Marc-Andre Lemburg Date: Mon, 19 Aug 2019 21:02:10 +0200 Subject: [PATCH 5/7] Fix invoice exports to work with EUR as well (abstract away the currency). --- conference/debug_panel.py | 22 ++++++++-------- conference/invoicing.py | 26 +++++++++++-------- templates/conference/debugpanel/index.html | 4 +-- .../debugpanel/invoices_export.html | 2 +- tests/test_invoices.py | 4 +-- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/conference/debug_panel.py b/conference/debug_panel.py index 20bea09f0..ad69e3b48 100644 --- a/conference/debug_panel.py +++ b/conference/debug_panel.py @@ -29,8 +29,8 @@ REAL_INVOICE_PREFIX, next_invoice_code_for_year, render_invoice_as_html, - export_invoices_to_2018_tax_report, - export_invoices_to_2018_tax_report_csv, + export_invoices_to_tax_report, + export_invoices_to_tax_report_csv, export_invoices_for_payment_reconciliation, extract_customer_info, ) @@ -187,9 +187,9 @@ def debug_panel_invoice_example(request): @staff_member_required -def debug_panel_invoice_export_for_tax_report_2018(request): +def debug_panel_invoice_export_for_tax_report(request): start_date, end_date = get_start_end_dates(request) - invoices_and_exported = export_invoices_to_2018_tax_report( + invoices_and_exported = export_invoices_to_tax_report( start_date, end_date ) @@ -203,13 +203,13 @@ def debug_panel_invoice_export_for_tax_report_2018(request): @staff_member_required -def debug_panel_invoice_export_for_tax_report_2018_csv(request): +def debug_panel_invoice_export_for_tax_report_csv(request): response = HttpResponse(content_type='text/csv') response['Content-Disposition'] =\ 'attachment; filename="export-invoices.csv"' start_date, end_date = get_start_end_dates(request) - export_invoices_to_2018_tax_report_csv(response, start_date, end_date) + export_invoices_to_tax_report_csv(response, start_date, end_date) return response @@ -274,7 +274,7 @@ class Meta: new_invoice.html = render_invoice_as_html(new_invoice) new_invoice.save() - return redirect('debug_panel_invoice_export_for_tax_report_2018') + return redirect('debug_panel_invoice_export_for_tax_report') else: customer = ( old_invoice.customer @@ -350,11 +350,11 @@ class FareSetup: debug_panel_invoice_force_preview, name="debug_panel_invoice_forcepreview"), url(r'^invoices_export/$', - debug_panel_invoice_export_for_tax_report_2018, - name='debug_panel_invoice_export_for_tax_report_2018'), + debug_panel_invoice_export_for_tax_report, + name='debug_panel_invoice_export_for_tax_report'), url(r'^invoices_export.csv$', - debug_panel_invoice_export_for_tax_report_2018_csv, - name='debug_panel_invoice_export_for_tax_report_2018_csv'), + debug_panel_invoice_export_for_tax_report_csv, + name='debug_panel_invoice_export_for_tax_report_csv'), url(r'^invoices_export_for_accounting.json$', debug_panel_invoice_export_for_payment_reconciliation_json, name='debug_panel_invoice_export_for_payment_reconciliation_json'), diff --git a/conference/invoicing.py b/conference/invoicing.py index 6179f95e3..18ba0086b 100644 --- a/conference/invoicing.py +++ b/conference/invoicing.py @@ -291,7 +291,7 @@ def render_invoice_as_html(invoice): return render_to_string('assopy/invoice.html', ctx) -CSV_2018_REPORT_COLUMNS = [ +CSV_REPORT_COLUMNS = [ 'ID', 'Emit Date', 'Buyer Name', @@ -299,13 +299,16 @@ def render_invoice_as_html(invoice): 'Address', 'Country', 'VAT ID', - 'Net Price in GBP', - 'VAT in GBP', - 'Gross Price in GBP', + 'Currency', + 'Net Price', + 'VAT', + 'Gross Price', ] +# For b/w compatibility +CSV_2018_REPORT_COLUMNS = CSV_REPORT_COLUMNS -def export_invoices_to_2018_tax_report(start_date, end_date=None): +def export_invoices_to_tax_report(start_date, end_date=None): if end_date is None: end_date = datetime.date.today() @@ -329,21 +332,22 @@ def export_invoices_to_2018_tax_report(start_date, end_date=None): output['Country'] = "" output['VAT ID'] = invoice.order.vat_number - output['Net Price in %s' % invoice.local_currency] =\ + output['Currency'] = invoice.local_currency + output['Net Price'] =\ invoice.net_price_in_local_currency - output['VAT in %s' % invoice.local_currency] =\ + output['VAT'] =\ invoice.vat_in_local_currency - output['Gross Price in %s' % invoice.local_currency] =\ + output['Gross Price'] =\ invoice.price_in_local_currency yield invoice, output -def export_invoices_to_2018_tax_report_csv(fp, start_date, end_date=None): - writer = csv.DictWriter(fp, CSV_2018_REPORT_COLUMNS, quoting=csv.QUOTE_ALL) +def export_invoices_to_tax_report_csv(fp, start_date, end_date=None): + writer = csv.DictWriter(fp, CSV_REPORT_COLUMNS, quoting=csv.QUOTE_ALL) writer.writeheader() - for invoice, to_export in export_invoices_to_2018_tax_report( + for invoice, to_export in export_invoices_to_tax_report( start_date, end_date ): writer.writerow(to_export) diff --git a/templates/conference/debugpanel/index.html b/templates/conference/debugpanel/index.html index 5eb039f19..62db60ae2 100644 --- a/templates/conference/debugpanel/index.html +++ b/templates/conference/debugpanel/index.html @@ -18,8 +18,8 @@

Additional links

diff --git a/templates/conference/debugpanel/invoices_export.html b/templates/conference/debugpanel/invoices_export.html index 512a6da56..dfbdaab41 100644 --- a/templates/conference/debugpanel/invoices_export.html +++ b/templates/conference/debugpanel/invoices_export.html @@ -35,7 +35,7 @@

Invoices (from {{ start_date|date:"Y-m-d" }} to {{ end_date|date:"Y-m-d" }})

- Download the CSV file + Download the CSV file Download as JSON (for payment reco)

diff --git a/tests/test_invoices.py b/tests/test_invoices.py index 67d0a2a46..ee82f9aa5 100644 --- a/tests/test_invoices.py +++ b/tests/test_invoices.py @@ -602,7 +602,7 @@ def test_export_invoice_csv(client): query_string = query_dict.urlencode() response = client.get( - reverse("debug_panel_invoice_export_for_tax_report_2018_csv") + reverse("debug_panel_invoice_export_for_tax_report_csv") + "?" + query_string ) @@ -656,7 +656,7 @@ def test_export_invoice_csv_before_period(client): query_string = query_dict.urlencode() response = client.get( - reverse("debug_panel_invoice_export_for_tax_report_2018_csv") + reverse("debug_panel_invoice_export_for_tax_report_csv") + "?" + query_string ) From a437fde7eaa4e69c3aa3c49766282ead8708674e Mon Sep 17 00:00:00 2001 From: Marc-Andre Lemburg Date: Mon, 19 Aug 2019 21:16:03 +0200 Subject: [PATCH 6/7] Fix one more reverse URL. --- tests/test_invoices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_invoices.py b/tests/test_invoices.py index ee82f9aa5..08db75673 100644 --- a/tests/test_invoices.py +++ b/tests/test_invoices.py @@ -692,7 +692,7 @@ def test_export_invoice(client): query_string = query_dict.urlencode() response = client.get( - reverse("debug_panel_invoice_export_for_tax_report_2018") + reverse("debug_panel_invoice_export_for_tax_report") + "?" + query_string ) From 45e0e1a9063efd2ecf0af7f7cbb0641824fe8dc8 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lemburg Date: Mon, 19 Aug 2019 22:17:54 +0200 Subject: [PATCH 7/7] Fix test to skip the currency column. --- tests/test_invoices.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_invoices.py b/tests/test_invoices.py index 08db75673..5e6e72213 100644 --- a/tests/test_invoices.py +++ b/tests/test_invoices.py @@ -624,6 +624,7 @@ def test_export_invoice_csv(client): next(iter_column) # ignore the address assert next(iter_column) == invoice1.order.country.name assert next(iter_column) == invoice1.order.vat_number + next(iter_column) # ignore the currency assert ( decimal.Decimal(next(iter_column)) == invoice1.net_price_in_local_currency