Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b956ff2
feat: add 'Purchase Price per Month' to item details
Jan 3, 2026
d29a191
feat: add 'Purchase Price per Month' to item details
Jan 3, 2026
e1030ab
Merge branch 'add-purchase-price-per-month' of https://github.com/sr-…
Jan 3, 2026
677c025
fix: handle edge case where a start date is greater than an end date.
Jan 3, 2026
40f67aa
fix: avoid div by zero when number of months of an item's age is less…
Jan 3, 2026
7e251fb
Update gitattributes
tankerkiller125 Jan 3, 2026
b3ff925
fix: location tree with no locations message
tonyaellie Jan 3, 2026
f21bea7
chore(deps): bump preact in the npm_and_yarn group across 1 directory…
dependabot[bot] Jan 7, 2026
59206b7
Update storage docs for latest library version we're using
tankerkiller125 Jan 8, 2026
fe3f225
Add MQTT to Docker (#1228)
FuzzyMistborn Jan 10, 2026
fcc7b3b
feat(label-generator): Allow hiding "Homebox" text on labels (#1150)
tturnerdev Jan 10, 2026
d8de09e
fix: Fix missing import for password strength component (#1240)
Billiam Jan 13, 2026
e5d4adf
M:M User and Group Relationship (#1174)
tankerkiller125 Jan 14, 2026
80fcb8f
Optimize RAM usage in attachment upload and thumbnail processing (#1243)
Copilot Jan 14, 2026
2f90e38
fix: #1249 invalid memory issue
tankerkiller125 Jan 16, 2026
07bc529
Convert labels to tags (#1192)
tonyaellie Jan 15, 2026
a050f27
chore: upgrade depndencies
tankerkiller125 Jan 18, 2026
f5e6686
feat: improve sidebar for collections
tonyaellie Jan 18, 2026
7dd3a33
fix: invitations not working properly
tonyaellie Jan 18, 2026
028f6ab
feat: add table controls to top of table and scroll to top on page ch…
tonyaellie Jan 18, 2026
29e796c
fix(items page): watch search query from navbar search (#1236)
duckimann Jan 18, 2026
fe077b0
Add Create Item button on location page (#1189)
mesab0ogie Jan 18, 2026
79521fe
chore: lint
tonyaellie Jan 18, 2026
403b39d
fix: parent item search doesnt update properly
tonyaellie Jan 18, 2026
d12950d
feat: do bulk actions sequentially instead of concurrently to avoid l…
tonyaellie Jan 18, 2026
6211815
chore: update nuxt
tonyaellie Jan 18, 2026
2934349
fix: ensure text stays on right side in popup on item search page
tonyaellie Jan 18, 2026
e2cfd86
chore: update lockfile
tonyaellie Jan 18, 2026
000fba2
fix: backend being reset broke collections
tonyaellie Jan 19, 2026
1c1641d
fix: broken actions
tankerkiller125 Jan 20, 2026
f47c0d0
fix: other actions
tankerkiller125 Jan 20, 2026
06ba969
Upgrade Go version from 1.24 to 1.25
tankerkiller125 Jan 20, 2026
4742750
Translated using Weblate (Slovak)
weblate Jan 22, 2026
1d8e926
feat: only don't save item with hotkey if shift is pressed
tonyaellie Jan 23, 2026
23fee7d
chore: update dependencies
tankerkiller125 Jan 24, 2026
9334471
feat: implement authentication rate limiting and security headers mid…
tankerkiller125 Jan 24, 2026
211f840
feat: security agent
tankerkiller125 Jan 25, 2026
55e3d36
fix: issue gatekeeper
tankerkiller125 Jan 26, 2026
739b75b
chore: add issue gate keeper logs
tankerkiller125 Jan 26, 2026
144af60
fix: titles for collection pages
tonyaellie Jan 26, 2026
d80f1cb
chore: update dependencies
tankerkiller125 Jan 30, 2026
ca86b8d
fix: #1283 better hostname setting/detection and fallback
tankerkiller125 Feb 1, 2026
cdc3884
feat: split build binaries (hopefully they'll work)
tankerkiller125 Feb 1, 2026
3645d1f
feat: try different split build (no GoReleaser Pro)
tankerkiller125 Feb 1, 2026
004a9a2
fix: binary names and freebsd issues
tankerkiller125 Feb 1, 2026
1ae1627
fix: revert to old version of reka-ui that does not break the combobox
tonyaellie Feb 1, 2026
18be0c4
fix: attachments not loading error
tonyaellie Feb 1, 2026
6b7455c
fix: bit of a hacky version link fix
tonyaellie Feb 1, 2026
617d087
fix: binary cd/ci job (front-end put in wrong path)
tankerkiller125 Feb 1, 2026
428ac20
Translated using Weblate (Turkish)
weblate Feb 3, 2026
8885634
Add Documentation Detailing Websocket Requirement for Reverse Proxies…
KevinFumbles Feb 5, 2026
00dbb53
Comprehensive backend cleanup with github.com/samber/lo helpers (#1301)
Copilot Feb 7, 2026
1043f5a
test: skip all the wipe tests for now until we eventually get them fixed
tankerkiller125 Feb 7, 2026
f3def82
Add a tenant get param when generating labels on the item page. (#1303)
cdjk Feb 7, 2026
f85c8c2
Migrate to Startlight Documentation (#1304)
tankerkiller125 Feb 8, 2026
8ec2c17
fix: new openapi URL for new docs
tankerkiller125 Feb 8, 2026
3d636ae
fix: docker issues
tankerkiller125 Feb 10, 2026
d159450
Update image source in README.md
tankerkiller125 Feb 11, 2026
1747b61
docs: fix sidebar links for changelog
tankerkiller125 Feb 12, 2026
bfcc890
docs: update links in `README.md` (#1314)
IceeAn Feb 11, 2026
6c511d7
feat: add new field types to template_fields schema (#1315)
tankerkiller125 Feb 12, 2026
e55821e
fix: tenant miss in export download URLs (#1313)
IceeAn Feb 12, 2026
6765993
fix: potential stored XSS issue with attachments
tankerkiller125 Feb 13, 2026
b4c40f4
fix: hardcoded frontend strings (#1311)
IceeAn Feb 12, 2026
0b577be
chore(deps): bump nanotar from 0.2.0 to 0.2.1 in /docs in the npm_and…
dependabot[bot] Feb 12, 2026
3124f5b
Update incorrect env variables in quick-start/configure/database (#1320)
KillerOfPie Feb 12, 2026
0d68d3e
fix: improve mobile image popup sizing (#1321)
IceeAn Feb 12, 2026
f9f3f84
fix: tools link
tonyaellie Feb 12, 2026
bc64399
fix: ipad scrolling
tonyaellie Feb 12, 2026
de8ca43
feat: add skip-first-labels and location-row toggle to label generato…
max2697 Feb 12, 2026
87ad71c
feat: use rem not em
tonyaellie Feb 12, 2026
2a535cb
fix: use prefs instead of use collection for attachments
tonyaellie Feb 12, 2026
2b55b07
fix: barcode table gets too thin
tonyaellie Feb 13, 2026
432dfb8
chore(deps): bump markdown-it (#1324)
dependabot[bot] Feb 13, 2026
f99e6ce
fix: #1213 add OIDC retry and backoff to help prevent race conditions
tankerkiller125 Feb 14, 2026
34965e0
feat: add 'Purchase Price per Month' to item details
Jan 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/internal/data/ent/item.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 36 additions & 4 deletions backend/internal/data/repo/repo_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ type (
WarrantyDetails string `json:"warrantyDetails"`

// Purchase
PurchaseTime types.Date `json:"purchaseTime"`
PurchaseFrom string `json:"purchaseFrom"`
PurchaseTime types.Date `json:"purchaseTime"`
PurchaseFrom string `json:"purchaseFrom"`
PurchasePricePerMonth float64 `json:"purchasePricePerMonth"`

// Sold
SoldTime types.Date `json:"soldTime"`
Expand Down Expand Up @@ -265,6 +266,26 @@ func mapFields(fields []*ent.ItemField) []ItemField {
return result
}

// countMonths calculates the number of complete months between two time.Time values.
func countMonths(start, end time.Time) int {
// Start after end? Doesn't make sense. Handle with care.
if start.After(end) {
return 0
}
yearDiff := end.Year() - start.Year()
monthDiff := int(end.Month()) - int(start.Month())
totalMonths := yearDiff*12 + monthDiff
// Adjust for cases where the end day is before the start day in the month
if end.Day() < start.Day() {
totalMonths--
}
// Double check to avoid start after end.
if totalMonths < 0 {
return 0
}
return totalMonths
}

func mapItemOut(item *ent.Item) ItemOut {
var attachments []ItemAttachment
if item.Edges.Attachments != nil {
Expand All @@ -282,6 +303,16 @@ func mapItemOut(item *ent.Item) ItemOut {
parent = &v
}

// Purchase price per month := purchase price / age in month.
// If age unknown -> purchase price per month = purchase price.
var pppm float64
months := countMonths(item.PurchaseTime, time.Now())
if item.PurchaseTime.IsZero() || months <= 0 {
pppm = item.PurchasePrice
} else {
pppm = item.PurchasePrice / float64(months)
}

return ItemOut{
Parent: parent,
AssetID: AssetID(item.AssetID),
Expand All @@ -297,8 +328,9 @@ func mapItemOut(item *ent.Item) ItemOut {
Manufacturer: item.Manufacturer,

// Purchase
PurchaseTime: types.DateFromTime(item.PurchaseTime),
PurchaseFrom: item.PurchaseFrom,
PurchaseTime: types.DateFromTime(item.PurchaseTime),
PurchaseFrom: item.PurchaseFrom,
PurchasePricePerMonth: pppm,

// Sold
SoldTime: types.DateFromTime(item.SoldTime),
Expand Down
3 changes: 2 additions & 1 deletion frontend/lib/api/types/data-contracts.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
"purchase_date": "Purchase Date",
"purchase_details": "Purchase Details",
"purchase_price": "Purchase Price",
"purchase_price_per_month": "Purchase Price per Month",
"purchased_from": "Purchased From",
"quantity": "Quantity",
"query_id": "Querying Asset ID Number: { id }",
Expand Down
5 changes: 5 additions & 0 deletions frontend/pages/item/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@
text: String(item.value?.purchasePrice) || "",
type: "currency",
},
{
name: "items.purchase_price_per_month",
text: String(item.value?.purchasePricePerMonth) || "",
type: "currency",
},
{
name: "items.purchase_date",
text: item.value?.purchaseTime || "",
Expand Down
Loading