asset

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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 Detail

func Detail(data layout.AppLayoutData, row AssetRow, branches []model.Branch, errMsg string) templ.Component

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.

Jump to

Keyboard shortcuts

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