From fb9ba155438100f295fdb563ad955151ee038ad3 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Mon, 13 Oct 2025 00:37:30 +0530 Subject: flattened out the invoice schema, was overengineered --- invoice/hooks.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'invoice/hooks.go') diff --git a/invoice/hooks.go b/invoice/hooks.go index 68d730b..07284ed 100644 --- a/invoice/hooks.go +++ b/invoice/hooks.go @@ -1,5 +1,5 @@ /* openbills - Server for web based Libre Billing Software - * Copyright (C) 2023 Vidhu Kant Sharma + * Copyright (C) 2023-2025 Vidhu Kant Sharma * * 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 @@ -39,20 +39,6 @@ func (i *Invoice) BeforeDelete(tx *gorm.DB) error { return errors.ErrNoWhereCondition } - var err error - - // delete billing address - err = db.Where("invoice_id = ?", i.ID).Delete(&InvoiceBillingAddress{}).Error - if err != nil { - return err - } - - // delete shipping address - err = db.Where("invoice_id = ?", i.ID).Delete(&InvoiceShippingAddress{}).Error - if err != nil { - return err - } - return nil } -- cgit v1.2.3