146 Commits

Author SHA1 Message Date
Bernd Bestel
a2b2f26628
Delete stock_log rows for not existing products in migration 0103 (fixes #1002) 2020-10-18 15:52:52 +02:00
kriddles
f7a1634442
typo (#1062) 2020-10-18 13:57:10 +02:00
kriddles
5ae36e6ba8
Value information (#1045)
* viewjs stockoverview: add total value to stock overview

* view stockoverview.blade: add Value column

* refresh stockOverview value column

* Removed the total units info

* Properly format the total stock value number

* Added new localization strings

* Resolved merge conflict

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-10-15 19:46:27 +02:00
Bernd Bestel
e91bc0b01b
Revert "Make sure that the view products_last_purchased always returns a row per product, also for not in stock items (references #801)"
This reverts commit 0a3e85dab4917510f5145fbd3fc765c6da8db996.

Revert "Make sure that the views products_average_price and products_oldest_stock_unit_price always returns a row per product, also for not in stock items (references #801)"

This reverts commit 939b98e470a5b65786ec82bbb342edc9c8715dc5.
2020-10-12 17:31:38 +02:00
Bernd Bestel
3f1135713a
Fixed string concat (fixes #994, references #985) 2020-09-07 08:16:05 +02:00
Bernd Bestel
6adac0588a
Applied formatting rules for by #989 changed files 2020-09-06 13:31:54 +02:00
fipwmaqzufheoxq92ebc
0454c128f0
Stock-Journal: API, Summary, Done By (#989)
* Stockjournal: Add "Done by"

* Add API for Stock-Journal

* Add "Journal-Summary"

* Use ALTER TABLE

* Moved the "Jounral summary" button to the stock journal page

* Changed icon & context menu position for new stock journal summary page

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-09-06 13:18:51 +02:00
fipwmaqzufheoxq92ebc
32a4f81f62
Filtering of API-Results (#985)
* Add FilteredApiResponse

* Use FilteredApiResponse for Generic-Entity-Search

* Use FilteredApiResponse for Recipe-Fullfillment

* Use FilteredApiResponse for GetUsers

* Use FilteredApiResponse for current Tasks

* Use FilteredApiResponse for ProductStockEntries & ProductStockLocations

* Use FilteredApiResponse for current chores

* Use FilteredApiResponse for batteries-current

* Fix missing highlighting of "< X days"

* Keep to use existing views

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-09-01 19:59:40 +02:00
Bernd Bestel
ae590fa910
Also return Userfields for Userobjects (endpoint /objects/{entity}) (fixes #979) 2020-08-31 22:32:56 +02:00
Bernd Bestel
ea9ba0b2be
Typo 2020-08-31 20:21:46 +02:00
fipwmaqzufheoxq92ebc
07beee93a9
Add user-field-type "file" (#977)
* Add user-field-type "file"

* Add userfield-type "picture"

* Also limit image height on userfieldsform

* Prevent empty userfields (cause warnings in tables after deleting a file)

* Show files in dialogs

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-08-31 20:07:46 +02:00
Bernd Bestel
e93f58916e
Forgot some entries in permission_hierarchy... 2020-08-29 19:24:19 +02:00
Bernd Bestel
86300b7025
Refined permissions by existing feature structure (closes #971, references #960) 2020-08-29 18:31:28 +02:00
fipwmaqzufheoxq92ebc
b7d1b21f1d
[WIP] Implemented basic permissions (#960)
* Add permissions to Database & add "User"-classes

* Add UI & API for Permissions, protect "User"-(Api)-Controller with new permissions.

* Add some permissions.

* Add permission localization

* Add error handling.

* Error pages: only redirect on 404

* ExceptionController: return JSON-Response on api-routes

* Rename PRODUCT_ADD to PRODUCT_PURCHASE

* Move translation to new file

* Fix checkboxes stay selected on reload.

* Remove configurable User-implementation

* Remove MASTER_DATA_READ

* Disable buttons the user isn't allowed to use.

* Add default permissions for new users

* When migration to permissions, everyone starts as ADMIN

* Permission-Localization: add to transifex & LocalizationService

* Review

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-08-29 12:05:32 +02:00
Bernd Bestel
4058925f40
Handle edited stock entries in GetProductPriceHistory (fixes #913) 2020-08-25 19:09:47 +02:00
Bernd Bestel
4db373b272
Fixed parent product amount aggregation (fixes #878) 2020-08-25 18:13:26 +02:00
Bernd Bestel
0a3e85dab4
Make sure that the view products_last_purchased always returns a row per product, also for not in stock items (references #801)
Otherwise there are errors when getting product details for currently not in stock items...
2020-08-22 17:50:08 +02:00
Bernd Bestel
939b98e470
Make sure that the views products_average_price and products_oldest_stock_unit_price always returns a row per product, also for not in stock items (references #801)
Otherwise there are errors when getting product details for currently not in stock items...
2020-08-22 10:06:37 +02:00
fipwmaqzufheoxq92ebc
923e027a4b
Some bug fixes. (#959)
* Fixes #956. Return 404 for missing objects in GenericEntityApiController.php

* Fixes #936 and #943. Include Products that expire today in /stock/volatile and "Expiring soon"-sum on stockoverview

* Fixes #881. Remove items of deleted shopping lists.

* Fixes #875. Prevent infinite nested recipes.

* Review

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-08-22 09:58:25 +02:00
Michał Przybyś
f8c6e81dcb
Fix grocy/grocy#834 (#855)
* Fix grocy/grocy#834

* stock_missing_products_including_opened didn't take the opened amount in HAVING clauses

* Resolved merge conflicts

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-08-19 19:46:25 +02:00
fipwmaqzufheoxq92ebc
42dc55625a
Improve Performance (#927)
* Stock-Overview: Reduce amount of database queries and FindObjectInArray()-calls

* Speed-up stock_current by improving products_resolved and creating indices.

* Review

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-08-18 19:23:37 +02:00
Bernd Bestel
da05cbffc0
Added changelog for #801 2020-08-17 22:12:39 +02:00
kriddles
e8845fe2e8
Qu factor purchase to stock & Product Barcode Details (#801)
* Puchase add qu_factor_to_stock

* qu_factor_purchase_to_stock for stock edit

* product barcodes with QU and Stores

* remove product barcode tags

* migrations/0103 add value and factor_puchase_amount to stock_current and stock_current_location_content

* Remove unused method

* StockService#GetProductDetails: include stock_value

* productcard: include stock_value

* Add Purchase Factor to Stock Overview

* update demo data with stock qu_factor_purchase_to_stock

* recipes_pos_resolved update

* avg_price and oldest_price in product details

* add average price to product card

* hint for recipe costs not included if not in stock

* Round value and factor_purchas_amount. Include currency for stock value

* Add factor_purchase_amount to product card stock amount

* Allow editing qu_factor_purchase_to_stock for stock entries

* fix update qu_factor_purchase_to_stock for Transfers

* Add barcode to existing product update to add to product_barcodes table

* Add barcode to new product workflow update to add to product_barcodes table

* *** Price now saved as 1 QU to stock in stock tables ***

* remove column product barcode and use product_barcodes

* Allow products to be deactivated instead of deleted

* Embedded barcode and qu-conversion with page reload on change

* Save current product barcode into new product_barcodes table

* Embedded popup for product group add/edit

* barcode scanner added to product barcodes input

* Edit product qu_stock is unavailable after first purchase

* StockOverview: Filters break when columns are reordered so for now just disable colReorder

* view stockoverview.blade: display product_group column

* Review

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-08-17 21:47:33 +02:00
Shadow
86b7cfed29
Fixed (#802)
Reordered days for better readability.
2020-04-27 18:11:32 +02:00
Bernd Bestel
d72fd565ca
Changelog and little adjustments for #800 2020-04-26 17:26:32 +02:00
Shadow
6c3c2d5384
#570 Added fix for weekly chores with multiple days (#800) 2020-04-26 17:14:54 +02:00
Bernd Bestel
c6e06ab07c
Fix weekday order for next chore execution calculation for weekly chores (fixes #570) 2020-04-13 15:16:38 +02:00
Bernd Bestel
152d3b7005
Respect QU conversions when aggregating parent product stock amounts (fixes #615) 2020-04-12 18:29:44 +02:00
kriddles
2fee4b45ff
set default store for product, purchase set last store purchased if available or use product default (#672) 2020-03-27 19:27:40 +01:00
Marc Ole Bulling
9a27b8e3a5
Added amount value for locations api (#668) 2020-03-27 14:29:26 +01:00
Bernd Bestel
4f40b40fe0
Fixed migration (references #658) 2020-03-25 20:39:19 +01:00
Immae
a45317aea1
Add shopping location for price tracking (#658) 2020-03-25 19:34:56 +01:00
zebardy
1a5f3ce926
Convert services to singletons and use lazy loading to improve performance (#479)
* use singletons to reduce need to recreate the same objects

* unable to make the constructor private

* comment out debug printing to log file

* correct typo of treating self() as a var instead of a function

* utilise Localisation service as a singleton

* fix errent line that should have been commented

* remove phpinfo

* correct mistake in stock controller

* try storing app in apcu

* serialise inside the app closures

* get timings for db-changed-time

* get timings for db-changed-time

* store localisation service in apcu

* stor translations in apcu instead of localisation service (due to database connection)

* correct syntax error

* forgot to uncomment instance map

* correct indentation and variable out of scope

* more timings for app execution time

* try apc caching for views

* correct scope for Pot variable

* remove additional fopen

* correct timings for app build time

* correct timings for app object build time

* correct timings for app route build time

* get timings for routing timings

* get more in depth timings for routing loading

* fix more in depth timings for routing loading

* start investigating session auth middleware creation

* start investigating session auth middleware creation

* start investigating Login controller time

* start investigating Login controller time

* in depth look at Logincontroller timings

* comment out debug printing

* lazily obtain valus for page rendering

* correct syntax error

* correct scope of variable

* correct visibiity of methds inherited from BaseController

* missing use for Userfieldsservice

* lazy loading of open api spec

* lazy loading of users service

* lazy loading of batteries service

* lazy loading of services in controllers

* lazy loading of services in services

* correct mistake

* fix userservice

* fix userservice

* fix userfieldservice

* fix chores service

* fix calendar service

* remove Dockerfile used for development

* Remove docker compose file used for development

* Clean up app.php

* remove last diff

* Clean up base controller

* Clean up controllers

* lean up middleware

* Clean up and tuen all services into singletons

* remove debug from routes.php

* remove acpu from localisation

* Complete removal of acpu from localisation

* fixes for things broken

* More fixes following merge

* Fix for start up bug. Re factoring singleton code had brroken due to scope of clas var.

* fix bug where getUsersService is declared twice

* bug fixes following merge

* bug fixes following merge

* bug fixes following merge

* bug fixes following merge

* bug fixes following merge

* Fix all the not working things...

* Deleted off-topic files

* Deleted off-topic files

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
2020-03-01 17:47:47 +01:00
Bernd Bestel
aa787e765e
Changelog, small changes and added missing localization strings for #556 2020-02-10 18:24:15 +01:00
Bernd Bestel
6b8169a1f1
Changelog and small changes for #557) 2020-02-10 18:00:42 +01:00
kriddles
898ea26139
Recipe Overview recipePositionsResolved should only include normal recipes (#557) 2020-02-10 17:56:52 +01:00
Bernd Bestel
05aceb72ae
Squashed commit
- Only refresh contextual number/datetime info/formatting where needed (closes #513)
- Also refresh correlated stock journal entries on undo (closes #471)
- Prefill "New amount" with the current stock amount on the inventory page (closes #434)
- Ensure that the location_id of the stock and stock_log tables is never empty after migration 95 (references #421)
- Load initial values of the /stockedit form server side to improve loading performance (references #421)
- Use more or less the same input ordering as on the purchase page for the /stockedit page (references #421)
- Also display the "Compact view" button on the shopping list page when FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS is disabled (references #453)
- Ensure that the currently active sidebar menu item is visible
- Optimized sidebar menu item grouping/spacing
- Properly order the API documentation route groups and put the "by-barcode" routes into a separate group
- Updated dependencies
- Pulled translations from Transifex
- Prepared changelog for next release
2020-01-27 19:00:49 +01:00
Bernd Bestel
71a57c9dcb
Implement "Free products" (closes #426) 2020-01-26 20:01:30 +01:00
Bernd Bestel
e111d07f4e
Added the ability to directly add products to the meal plan (closes #450) 2020-01-25 11:51:00 +01:00
Bernd Bestel
fd5a72264d
Meal plan recipe and notes also fit into one table (references #477) 2020-01-23 21:57:47 +01:00
Bernd Bestel
6663551a66
A day can have multiple meal plan notes (references #477) 2020-01-23 21:01:35 +01:00
Bernd Bestel
8d7f985b59
Make it possible to add notes to meal plan (days) (closes #477) 2020-01-23 20:59:19 +01:00
Bernd Bestel
0816359867
Some refinements for #501 2020-01-21 20:45:34 +01:00
kriddles
3a36bdaf45 recipes can create products (#501) 2020-01-21 20:20:26 +01:00
kriddles
6c7420ea08 Stock Service Updates (#421)
* viewjs consume: implement location and update stock specific

* Transfer Products

* services StockService#GetProductStockEntriesByLocation: add method

* services StockService#AddProduct: check for stock and locations

* services StockService: include location_id

* services StockService#LocationExists: add method

* services StockService#UndoBooking: fix based on stockRow

* Reimplement StockServer->TransferProduct (one loop for the whole action to preserve stock_id)

* Ensure that the location_id is never NULL in the stock and stock_log table (checked by an INSERT trigger, sets the products default location if empty)

* Only consider stock amount at the given location on consume, if supplied

* Restore more/old display text for "specific stock entry"

* Don't allow transfering tare weight enabled products

* Various small changes (code style, missing OpenAPI endpoint, remove location_id null checking)

* Updated translations strings

* Added transaction_id and correlation_id to stock_log entries to group them together

* ProductCard - location to default location label change

* Also undo correlated bookings on undo

* Added API endpoints for listing and undoing transactions and use them on purchase/consume/inventory/stockoverview

* Initial Stock detail page

* Allow Undo for Tranfers

* Price step to .01

* Some localization string changes & fixes
2019-12-19 19:48:36 +01:00
Bernd Bestel
ba6bfa6a2c
Added a chore period type "yearly" (closes #407) 2019-10-04 11:24:51 +02:00
Bernd Bestel
28b23fd313
Implemented chore period intervals to have more flexible schedules (closes #312) 2019-10-04 11:14:11 +02:00
Bernd Bestel
039ed54a58
Optimized nested recipe resolving / prevent infinite nested recipes 2019-10-04 10:30:30 +02:00
Bernd Bestel
901b345714
Fixed/workaround for recipes_nestings_resolved view when recipe count > 100 (fixes #403) 2019-10-01 15:34:20 +02:00
Bernd Bestel
654d00dd67
Again corrections for #384) 2019-09-26 20:56:19 +02:00