From fd863aadf34b9837bd77587c1d36eb49000a8de7 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 12 Oct 2025 13:38:07 +0530 Subject: moved shipping address and billing address to the customers table itself --- customer/hooks.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'customer/hooks.go') diff --git a/customer/hooks.go b/customer/hooks.go index 148004f..7f715c3 100644 --- a/customer/hooks.go +++ b/customer/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,19 +39,5 @@ func (c *Customer) BeforeDelete(tx *gorm.DB) error { return errors.ErrNoWhereCondition } - var err error - - // delete billing address - err = db.Where("customer_id = ?", c.ID).Delete(&CustomerBillingAddress{}).Error - if err != nil { - return err - } - - // delete shipping address - err = db.Where("customer_id = ?", c.ID).Delete(&CustomerShippingAddress{}).Error - if err != nil { - return err - } - return nil } -- cgit v1.2.3