inventory

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

View Source
const DefaultMovementPageSize = 20

DefaultMovementPageSize is used when no valid per_page query param is supplied.

View Source
const DefaultPageSize = 20

DefaultPageSize is used when no valid per_page query param is supplied.

Variables

View Source
var MovementPageSizes = []int{20, 50, 100}

MovementPageSizes are the selectable "items per page" options for the movement history list.

View Source
var PageSizes = []int{20, 50, 100}

PageSizes are the selectable "items per page" options for the inventory list.

Functions

func Correct added in v0.1.2

func Correct(data layout.AppLayoutData, original model.StockMovement, productName string, suppliers []model.Supplier, errMsg string) templ.Component

func Index

func Index(props IndexProps) templ.Component

func Movements added in v0.1.2

func Movements(props MovementsProps) templ.Component

func Procurement

func Procurement(data layout.AppLayoutData, products []model.Product, suppliers []model.Supplier, errMsg string) templ.Component

func Waste added in v0.1.4

func Waste(data layout.AppLayoutData, products []model.Product, errMsg string) templ.Component

Types

type IndexProps

type IndexProps struct {
	Data           layout.AppLayoutData
	Lines          []model.InventoryLine
	Search         string
	ActiveType     string
	ActiveCategory string
	// Categories lists the company's categories, used as the category
	// filter dropdown's options.
	Categories []model.Category
	// StockStatus is the active stock-status filter ("", "low", "out", "ok").
	StockStatus string
	Page        int
	PerPage     int
	TotalItems  int
	// CountProduct/CountDelta/CountErr drive the post-stock-count toast:
	// CountErr non-empty → error toast. Else CountProduct non-empty with
	// CountDelta empty → "no discrepancy" toast. Both non-empty → adjustment toast.
	CountProduct string
	CountDelta   string
	CountErr     string
	// StockCountMode toggles the inline "Counted Qty" column and its
	// explainer banner on/off — off by default so the plain list stays
	// uncluttered; toggled via the "Stock Count" header button.
	StockCountMode bool
}

IndexProps holds the data needed to render the inventory list page.

type MovementsProps added in v0.1.2

type MovementsProps struct {
	Data          layout.AppLayoutData
	Movements     []model.StockMovement
	ProductNames  map[uuid.UUID]string
	SupplierNames map[uuid.UUID]string
	CanCorrect    map[uuid.UUID]bool
	Reversed      map[uuid.UUID]bool
	ErrMsg        string
	Page          int
	PerPage       int
	TotalItems    int
}

MovementsProps holds the data needed to render the stock movement history page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL