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/customer.go | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'customer/customer.go') diff --git a/customer/customer.go b/customer/customer.go index 521c531..0d107d7 100644 --- a/customer/customer.go +++ b/customer/customer.go @@ -1,5 +1,5 @@ /* openbills - Server for web based Libre Billing Software - * Copyright (C) 2023-2024 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 @@ -20,36 +20,33 @@ package customer import ( "gorm.io/gorm" d "vidhukant.com/openbills/db" - u "vidhukant.com/openbills/util" ) var db *gorm.DB func init() { db = d.DB - db.AutoMigrate(&Customer{}, &CustomerBillingAddress{}, &CustomerShippingAddress{}) + db.AutoMigrate(&Customer{}) } -type CustomerBillingAddress struct { +type Customer struct { gorm.Model - u.Address - CustomerID uint -} + FirmName string + Gstin string + ContactName string + Phone string + Email string + Website string -type CustomerShippingAddress struct { - gorm.Model - u.Address - CustomerID uint -} + BillingAddressText string + BillingAddressCity string + BillingAddressState string + BillingAddressPostalCode string + BillingAddressCountry string -type Customer struct { - gorm.Model - FirmName string - Gstin string - ContactName string - Phone string - Email string - Website string - BillingAddress CustomerBillingAddress - ShippingAddress CustomerShippingAddress + ShippingAddressText string + ShippingAddressCity string + ShippingAddressState string + ShippingAddressPostalCode string + ShippingAddressCountry string } -- cgit v1.2.3