aa-buybackprogram 2.0.1__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/PKG-INFO +3 -3
  2. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/README.md +2 -2
  3. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/__init__.py +1 -1
  4. aa_buybackprogram-2.2.0/buybackprogram/constants.py +57 -0
  5. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/forms.py +1 -1
  6. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/helpers.py +23 -7
  7. aa_buybackprogram-2.2.0/buybackprogram/migrations/0016_alter_program_compression_price_dencity_modifier.py +18 -0
  8. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/models.py +2 -2
  9. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/calculate/invoice.html +4 -0
  10. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/views/stats.py +12 -1
  11. aa_buybackprogram-2.0.1/buybackprogram/constants.py +0 -52
  12. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/LICENSE +0 -0
  13. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/admin.py +0 -0
  14. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/app_settings.py +0 -0
  15. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/apps.py +0 -0
  16. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/auth_hooks.py +0 -0
  17. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/decorators.py +0 -0
  18. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/management/__init__.py +0 -0
  19. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/management/commands/__init__.py +0 -0
  20. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/management/commands/buybackprogram_generate_test_data.py +0 -0
  21. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/management/commands/buybackprogram_link_contracts.py +0 -0
  22. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/management/commands/buybackprogram_load_data.py +0 -0
  23. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/management/commands/buybackprogram_load_prices.py +0 -0
  24. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/management/commands/generate_dummy_data.py +0 -0
  25. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0001_initial.py +0 -0
  26. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0002_contractnotification.py +0 -0
  27. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0003_statics_performance_increase.py +0 -0
  28. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0004_auto_20220323_1331.py +0 -0
  29. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0005_program_compression_price_dencity_modifier.py +0 -0
  30. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0006_program_bonds_npc_price_and_more.py +0 -0
  31. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0007_program_expiration.py +0 -0
  32. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0008_alter_general_options_alter_program_refining_rate.py +0 -0
  33. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0009_contract_location_name.py +0 -0
  34. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0010_contract_no_tracking_alter_tracking_tracking_number.py +0 -0
  35. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0011_delete_duplicated_contracts.py +0 -0
  36. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0012_make_contract_id_unique.py +0 -0
  37. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0013_program_discord_show_item_list.py +0 -0
  38. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0014_program_price_type.py +0 -0
  39. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/0015_faq_contractnotification_header_and_more.py +0 -0
  40. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/migrations/__init__.py +0 -0
  41. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/notes.py +0 -0
  42. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/notification.py +0 -0
  43. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/providers.py +0 -0
  44. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/static/buybackprogram/css/billboards_dark.css +0 -0
  45. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/static/buybackprogram/css/billboards_light.css +0 -0
  46. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/static/buybackprogram/css/style_dark.css +0 -0
  47. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/static/buybackprogram/css/style_light.css +0 -0
  48. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/static/buybackprogram/images/help.png +0 -0
  49. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/static/buybackprogram/js/autocomplete.js +0 -0
  50. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/static/buybackprogram/js/bootstrap-autocomplete.min.js +0 -0
  51. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/swagger.json +0 -0
  52. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tasks.py +0 -0
  53. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/base.html +0 -0
  54. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/bundles/buybackprogram-css-light.html +0 -0
  55. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/contract_details.html +0 -0
  56. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/faq.html +0 -0
  57. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/index.html +0 -0
  58. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/leaderboards.html +0 -0
  59. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/location_add.html +0 -0
  60. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/page.html +0 -0
  61. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/base/menu-management.html +0 -0
  62. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/base/menu.html +0 -0
  63. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/calculate/accepted_locations.html +0 -0
  64. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/calculate/calculation_success.html +0 -0
  65. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/calculate/contract_settings.html +0 -0
  66. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/calculate/item_details.html +0 -0
  67. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/details/accepted-locations.html +0 -0
  68. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/details/contract-info.html +0 -0
  69. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/details/invoice.html +0 -0
  70. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/details/tabs/contract-items.html +0 -0
  71. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/details/tabs/original-items.html +0 -0
  72. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/details/tabs/tabs-navigation.html +0 -0
  73. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/details/warning.html +0 -0
  74. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/stats/summary.html +0 -0
  75. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/stats/tabs/finished.html +0 -0
  76. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/stats/tabs/outstanding.html +0 -0
  77. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/stats/tabs/tabs-navigation.html +0 -0
  78. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/stats/tabs/untracked.html +0 -0
  79. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/partials/stats/warning.html +0 -0
  80. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/performance.html +0 -0
  81. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/program_add.html +0 -0
  82. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/program_calculate.html +0 -0
  83. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/program_edit.html +0 -0
  84. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/program_edit_item.html +0 -0
  85. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/program_edit_marketgroup.html +0 -0
  86. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/program_special_taxes.html +0 -0
  87. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/stats.html +0 -0
  88. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templates/buybackprogram/user_settings.html +0 -0
  89. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templatetags/__init__.py +0 -0
  90. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templatetags/bs_tab_color_class.py +0 -0
  91. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templatetags/help_icons.py +0 -0
  92. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templatetags/price_formats.py +0 -0
  93. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/templatetags/program_settings.py +0 -0
  94. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/__init__.py +0 -0
  95. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/test_data_migrations.py +0 -0
  96. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/test_helpers.py +0 -0
  97. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/test_models.py +0 -0
  98. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/testdata/__init__.py +0 -0
  99. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/testdata/create_eveuniverse.py +0 -0
  100. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/testdata/eveuniverse.json +0 -0
  101. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/testdata/factories.py +0 -0
  102. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/tests/testdata/load_eveuniverse.py +0 -0
  103. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/urls.py +0 -0
  104. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/utils.py +0 -0
  105. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/views/__init__.py +0 -0
  106. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/views/calculate.py +0 -0
  107. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/views/common.py +0 -0
  108. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/views/programs.py +0 -0
  109. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/buybackprogram/views/special_taxes.py +0 -0
  110. {aa_buybackprogram-2.0.1 → aa_buybackprogram-2.2.0}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aa-buybackprogram
3
- Version: 2.0.1
3
+ Version: 2.2.0
4
4
  Summary: Buyback program plugin app for Alliance Auth.
5
5
  Author-email: Ikarus Cesaille <contact@eve-linknet.com>
6
6
  Requires-Python: >=3.8
@@ -283,9 +283,9 @@ You can use a price density modifier which will add a additional tax on items wi
283
283
 
284
284
  > :information_source: This setting is aimer more at high sec buyback programs.
285
285
 
286
- ##### Compressible price density modifier
286
+ ##### Ore volume based on compressed volume
287
287
 
288
- You can select to ignore price density calculations for items that can be compressed. This is helpful when the compressed variants do not have proper buy orders in Jita. If you set this to True then the compressible item density will be calculated based on the isk / volume of the compression variant of the sold item.
288
+ Using this setting will calculate all items that can be compressed (mainly ore and ice) based on the compressed variant volume and use this volume instead of the raw volume to calculate the hauling and price dencity costs. This setting is mainly aimed at null sec where you might get raw ore sold to you but want to compress it before shipping as raw ore volume is very high and will cause high hauling costs.
289
289
 
290
290
  ##### Price density threshold
291
291
 
@@ -258,9 +258,9 @@ You can use a price density modifier which will add a additional tax on items wi
258
258
 
259
259
  > :information_source: This setting is aimer more at high sec buyback programs.
260
260
 
261
- ##### Compressible price density modifier
261
+ ##### Ore volume based on compressed volume
262
262
 
263
- You can select to ignore price density calculations for items that can be compressed. This is helpful when the compressed variants do not have proper buy orders in Jita. If you set this to True then the compressible item density will be calculated based on the isk / volume of the compression variant of the sold item.
263
+ Using this setting will calculate all items that can be compressed (mainly ore and ice) based on the compressed variant volume and use this volume instead of the raw volume to calculate the hauling and price dencity costs. This setting is mainly aimed at null sec where you might get raw ore sold to you but want to compress it before shipping as raw ore volume is very high and will cause high hauling costs.
264
264
 
265
265
  ##### Price density threshold
266
266
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  default_app_config = "buybackprogram.apps.BuybackProgramConfig"
4
4
 
5
- __version__ = "2.0.1"
5
+ __version__ = "2.2.0"
6
6
  __title__ = "Buyback Program"
@@ -0,0 +1,57 @@
1
+ # Includes all asteroids, moon ore and ice. All items that can be compressed or refined for minerals*
2
+ ORE_EVE_GROUPS = [
3
+ 450, # Arkonor
4
+ 451, # Bistot
5
+ 452, # Crokite
6
+ 453, # Ochre
7
+ 454, # Hedbergite
8
+ 455, # Hemorphite
9
+ 456, # Jaspet
10
+ 457, # Kernite
11
+ 458, # Plagioclase
12
+ 459, # Pyroxeres
13
+ 460, # Scordite
14
+ 461, # Spodumain
15
+ 462, # Veldspar
16
+ 465, # Ice
17
+ 467, # Gneiss
18
+ 468, # Mercoxit
19
+ 469, # Omber
20
+ 1884, # Zeolites
21
+ 1911, # Raspite
22
+ 1920, # Cobaltite
23
+ 1921, # Otavite
24
+ 1922, # Carnotite
25
+ 1923, # Xenotime
26
+ 2024, # Amethystic Crystallite
27
+ 2029, # ??
28
+ 4029, # Talassonite
29
+ 4030, # Rakovene
30
+ 4031, # Bezdnacine
31
+ 4094, # ??
32
+ 4513, # Mordunium
33
+ 4514, # Ytirium
34
+ 4515, # Eifyrium
35
+ 4516, # Ducinium
36
+ 4759, # Griemeer
37
+ 4758, # Hezorime
38
+ 4755, # Kylixium
39
+ 4756, # Nocxite
40
+ 4757, # Ueganite
41
+ ]
42
+
43
+ OPE_EVE_GROUPS = [493]
44
+
45
+ BONDS_EVE_GROUPS = [1248]
46
+
47
+ BLUE_LOOT_TYPE_IDS = [
48
+ 30744,
49
+ 30745,
50
+ 30746,
51
+ 30747,
52
+ ]
53
+
54
+ RED_LOOT_TYPE_IDS = [
55
+ 48121,
56
+ 60459,
57
+ ]
@@ -101,7 +101,7 @@ class LocationForm(forms.Form):
101
101
  max_length=32,
102
102
  )
103
103
 
104
- structure_id = forms.CharField(
104
+ structure_id = forms.IntegerField(
105
105
  required=False,
106
106
  label="Structure/station ID",
107
107
  help_text="The ingame ID for the structure you wish to accept the contracts at. <strong>If left empty the program statistics page will not track if the contract is actually made at the correct structure or not.</strong>",
@@ -477,11 +477,15 @@ def get_item_values(item_type, item_prices, program):
477
477
  )
478
478
 
479
479
  if not item_type.volume <= 0:
480
- price_dencity = price / item_type.volume
480
+ price_dencity = price / item_type.packaged_volume
481
481
  else:
482
482
  price_dencity = False
483
483
  price_dencity_tax = get_price_dencity_tax(
484
- program, price, item_type.volume, quantity, is_ore(item_type.eve_group.id)
484
+ program,
485
+ price,
486
+ item_type.packaged_volume,
487
+ quantity,
488
+ is_ore(item_type.eve_group.id),
485
489
  )
486
490
  program_tax = program.tax
487
491
  item_tax = get_item_tax(program, item_type.id)
@@ -574,14 +578,16 @@ def get_item_values(item_type, item_prices, program):
574
578
  )
575
579
 
576
580
  if not item_type.volume <= 0:
577
- price_dencity = item_prices["raw_prices"]["buy"] / item_type.volume
581
+ price_dencity = (
582
+ item_prices["raw_prices"]["buy"] / item_type.packaged_volume
583
+ )
578
584
  else:
579
585
  price_dencity = False
580
586
 
581
587
  price_dencity_tax = get_price_dencity_tax(
582
588
  program,
583
589
  item_prices["raw_prices"]["buy"],
584
- item_type.volume,
590
+ item_type.packaged_volume,
585
591
  item_prices["raw_prices"]["quantity"],
586
592
  is_ore(item_type.eve_group.id),
587
593
  )
@@ -783,7 +789,11 @@ def get_item_values(item_type, item_prices, program):
783
789
  else:
784
790
  price_dencity = False
785
791
  price_dencity_tax = get_price_dencity_tax(
786
- program, price, item_type.volume, quantity, is_ore(item_type.eve_group.id)
792
+ program,
793
+ price,
794
+ item_type.packaged_volume,
795
+ quantity,
796
+ is_ore(item_type.eve_group.id),
787
797
  )
788
798
  program_tax = program.tax
789
799
  item_tax = get_item_tax(program, item_type.id)
@@ -976,6 +986,7 @@ def get_item_buy_value(buyback_data, program, donation):
976
986
  contract_net_total = False
977
987
  total_donation = False
978
988
  tota_all_items_raw = 0
989
+ total_volume = 0
979
990
 
980
991
  # Get a grand total value of all buy prices
981
992
  for item in buyback_data:
@@ -999,7 +1010,10 @@ def get_item_buy_value(buyback_data, program, donation):
999
1010
  for item in buyback_data:
1000
1011
  if has_buy_price(item["item_prices"]):
1001
1012
  # Check if compressed price is used. If yes we will use compression price density. If not we will use raw price density.
1002
- if item["item_prices"]["compression_prices"]:
1013
+ if (
1014
+ item["item_prices"]["compression_prices"]
1015
+ and program.use_compressed_value
1016
+ ) or (program.compression_price_dencity_modifier and is_ore):
1003
1017
  compressed_version = EveType.objects.filter(
1004
1018
  id=item["item_prices"]["compression_prices"]["id"]
1005
1019
  ).first()
@@ -1017,7 +1031,7 @@ def get_item_buy_value(buyback_data, program, donation):
1017
1031
  % (item["type_data"])
1018
1032
  )
1019
1033
 
1020
- item_volume = item["type_data"].volume
1034
+ item_volume = item["type_data"].packaged_volume
1021
1035
 
1022
1036
  quantity = item["item_values"]["quantity"]
1023
1037
  hauling_cost = item_volume * program.hauling_fuel_cost * quantity
@@ -1028,6 +1042,7 @@ def get_item_buy_value(buyback_data, program, donation):
1028
1042
  )
1029
1043
 
1030
1044
  total_hauling_cost += hauling_cost
1045
+ total_volume += item_volume * quantity
1031
1046
 
1032
1047
  logger.debug(
1033
1048
  "Final: Hauling cost %s m³ of %s is %s ISK"
@@ -1055,6 +1070,7 @@ def get_item_buy_value(buyback_data, program, donation):
1055
1070
  "hauling_cost": program.hauling_fuel_cost,
1056
1071
  "total_hauling_cost": total_hauling_cost,
1057
1072
  "contract_net_total": contract_net_total,
1073
+ "contract_total_volume": total_volume,
1058
1074
  }
1059
1075
 
1060
1076
  return contract_net_prices
@@ -0,0 +1,18 @@
1
+ # Generated by Django 4.2.11 on 2024-10-02 03:59
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('buybackprogram', '0015_faq_contractnotification_header_and_more'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name='program',
15
+ name='compression_price_dencity_modifier',
16
+ field=models.BooleanField(default=False, help_text='Should we use compressed volume for items that can be compressed such as ore and ice in fuel cost and price dencity calculations. If set to False the raw volume is used for volume calculations if the item does not have a compressed price variant available from the use compressed value setting.', verbose_name='Ore volume based on compressed volume'),
17
+ ),
18
+ ]
@@ -1102,9 +1102,9 @@ class Program(models.Model):
1102
1102
  )
1103
1103
 
1104
1104
  compression_price_dencity_modifier = models.BooleanField(
1105
- verbose_name="Price density modifier for compressable items",
1105
+ verbose_name="Ore volume based on compressed volume",
1106
1106
  default=False,
1107
- help_text="Should we apply price density calculations for items that can be compressed such as ore and ice. If set to False price density tax is not applied on any items that can be compressed.",
1107
+ help_text="Should we use compressed volume for items that can be compressed such as ore and ice in fuel cost and price dencity calculations. If set to False the raw volume is used for volume calculations if the item does not have a compressed price variant available from the use compressed value setting.",
1108
1108
  )
1109
1109
 
1110
1110
  price_dencity_treshold = models.IntegerField(
@@ -15,6 +15,10 @@
15
15
  <th>{% trans "Program taxes" %}</th>
16
16
  <td>{{contract_price_data.total_tax_amount|floatformat:0|intcomma}} ISK</td>
17
17
  </tr>
18
+ <tr>
19
+ <th>{% trans "Total volume" %}</th>
20
+ <td>{{contract_price_data.contract_total_volume|floatformat:0|intcomma}} m³</td>
21
+ </tr>
18
22
  {% if program.hauling_fuel_cost > 0 %}
19
23
  <tr>
20
24
  <th>{% trans "Hauling cost" %}</th>
@@ -19,6 +19,7 @@ from buybackprogram.notes import (
19
19
  note_quantity_missing_from_contract,
20
20
  note_quantity_missing_from_tracking,
21
21
  )
22
+ from buybackprogram.utils import messages_plus
22
23
 
23
24
  from ..models import (
24
25
  Contract,
@@ -157,9 +158,19 @@ def program_performance(request, program_pk):
157
158
  filename = f"program_performance_{program_pk}.json"
158
159
  file_path = os.path.join(static_path, filename)
159
160
 
160
- if os.path.exists(file_path):
161
+ try:
162
+ # Try to open the file and load the JSON data
161
163
  with open(file_path, "r") as file:
162
164
  context = json.load(file)
165
+ except FileNotFoundError:
166
+ messages_plus.error(
167
+ request,
168
+ "Error: The performance data file is missing for this program. Please generate the report first.",
169
+ )
170
+ return render(
171
+ request,
172
+ "buybackprogram/performance.html",
173
+ )
163
174
 
164
175
  return render(request, "buybackprogram/performance.html", context)
165
176
 
@@ -1,52 +0,0 @@
1
- # Includes all asteroids, moon ore and ice. All items that can be compressed or refined for minerals*
2
- ORE_EVE_GROUPS = [
3
- 450,
4
- 451,
5
- 452,
6
- 453,
7
- 454,
8
- 455,
9
- 456,
10
- 457,
11
- 458,
12
- 459,
13
- 460,
14
- 461,
15
- 462,
16
- 465,
17
- 467,
18
- 468,
19
- 469,
20
- 1884,
21
- 1911,
22
- 1920,
23
- 1921,
24
- 1922,
25
- 1923,
26
- 2024,
27
- 2029,
28
- 4029,
29
- 4030,
30
- 4031,
31
- 4094,
32
- 4513,
33
- 4514,
34
- 4515,
35
- 4516,
36
- ]
37
-
38
- OPE_EVE_GROUPS = [493]
39
-
40
- BONDS_EVE_GROUPS = [1248]
41
-
42
- BLUE_LOOT_TYPE_IDS = [
43
- 30744,
44
- 30745,
45
- 30746,
46
- 30747,
47
- ]
48
-
49
- RED_LOOT_TYPE_IDS = [
50
- 48121,
51
- 60459,
52
- ]