Documentation
¶
Overview ¶
templ: version: v0.3.1020
templ: version: v0.3.1020
templ: version: v0.3.1020
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Form ¶
func Form(data layout.AppLayoutData, a *model.FixedAsset, locked bool, branches []model.Branch, errMsg string) templ.Component
Form renders both the register (a == nil) and edit (a != nil) asset forms. When locked is true (any depreciation has posted for a), the fields that were used to compute past postings — purchase date/cost/salvage/useful life — render disabled: a disabled input never submits its value, so the handler naturally treats those fields as "unchanged" (dto.UpdateAssetDTO's nil-pointer semantics). The service layer independently re-checks the lock too — this is a UX convenience, not the enforcement itself.
func Index ¶
func Index(props IndexProps) templ.Component
Types ¶
type AssetRow ¶
type AssetRow struct {
Asset model.FixedAsset
PostedPeriods int
AccumulatedDepr int64
NetBookValue int64
}
AssetRow pairs a FixedAsset with its live-computed depreciation summary — never cached, see accounting.Service.AssetDepreciationSummary.
type IndexProps ¶
type IndexProps struct {
Data layout.AppLayoutData
Rows []AssetRow
Branches []model.Branch
ErrMsg string
}
IndexProps holds the data needed to render the fixed-assets list page.