aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/invoice/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'invoice/service.go')
-rw-r--r--invoice/service.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/invoice/service.go b/invoice/service.go
index 55b1319..20cf767 100644
--- a/invoice/service.go
+++ b/invoice/service.go
@@ -1,5 +1,5 @@
/* openbills - Server for web based Libre Billing Software
- * Copyright (C) 2023 Vidhu Kant Sharma <vidhukant@vidhukant.com>
+ * Copyright (C) 2023-2025 Vidhu Kant Sharma <vidhukant@vidhukant.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ func getNewInvoiceNumber() (uint, error) {
}
func getInvoice(invoice *Invoice, id uint) error {
- res := db.Preload("BillingAddress").Preload("ShippingAddress").Preload("Items").Preload("CustomFields").Find(&invoice, id)
+ res := db.Preload("Items").Preload("CustomFields").Find(&invoice, id)
// TODO: handle potential errors
if res.Error != nil {
@@ -61,6 +61,8 @@ func getInvoice(invoice *Invoice, id uint) error {
return nil
}
+// TODO: rather than returning all invoices, always require a filter, maybe
+// so we're actually searching invoices
func getInvoices(invoices *[]Invoice, isDraft bool) error {
res := db.Where("is_draft = ?", isDraft).Find(&invoices)