Screens / Stock in
Stock in
Record a purchase: an expense with ingredient lines that adds stock. Each line has a unit selector limited to the ingredient's family (PAN-95), defaulting to its stock unit; "5000 g → 5 kg" shows what will be added, and `unit` is sent only when it differs from the stock unit. A new stock item can be created from the form with a unit from the fixed list.
- App routes
/stock/in- Access
- stock.manage
- Screen code
lib/screens/stock/stock_in_page.dartlib/screens/stock/stock_in_controller.dartlib/screens/stock/widgets/stock_in_line_unit.dartlib/screens/stock/widgets/new_stock_item_form.dart- Source
- elmermj/panly-app @ pre-staging-test (72aaffd)
API calls (5)
| Call | Why the screen makes it | Where in the app code |
|---|---|---|
GET /v1/expense-categoriesList expense categories |
Categories for the purchase | lib/screens/stock/stock_in_controller.dart:92lib/data/stock/stock_remote.dart:77 |
GET /v1/ingredients/{ingredientId}Get ingredient |
Preselected ingredient | lib/screens/stock/stock_in_controller.dart:97lib/data/stock/stock_remote.dart:44 |
GET /v1/ingredientsList ingredients |
Ingredient picker (search, pages) | lib/screens/stock/stock_in_controller.dart:102lib/screens/stock/stock_in_controller.dart:167lib/data/stock/stock_remote.dart:39 |
POST /v1/ingredientsCreate ingredient |
Create a new ingredient inline | lib/screens/stock/stock_in_controller.dart:320lib/data/repositories/stock_repository.dart:126lib/data/catalog/catalog_remote.dart:132 |
POST /v1/expensesCreate expense (ingredient lines auto-add stock) |
Save the purchase with ingredient_lines | lib/screens/stock/stock_in_controller.dart:282lib/data/stock/stock_remote.dart:114 |
Each call links to its operation in the API reference. Code locations are file:line in panly-app at 72aaffd, listed from the screen down to the line that sends the request.