diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-13 00:37:30 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-13 00:37:30 +0530 |
commit | fb9ba155438100f295fdb563ad955151ee038ad3 (patch) | |
tree | 558c27ce3910a2aa2e7d18803b7548f6e7f6a032 /invoice/hooks.go | |
parent | 327a32f563394f92313e4a751515d69d90f4e7f5 (diff) |
flattened out the invoice schema, was overengineered
Diffstat (limited to 'invoice/hooks.go')
-rw-r--r-- | invoice/hooks.go | 16 |
1 files changed, 1 insertions, 15 deletions
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 <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 @@ -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 } |