aboutsummaryrefslogtreecommitdiff
path: root/invoice/invoice.go
diff options
context:
space:
mode:
Diffstat (limited to 'invoice/invoice.go')
-rw-r--r--invoice/invoice.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/invoice/invoice.go b/invoice/invoice.go
index 0f4a601..fa8bb08 100644
--- a/invoice/invoice.go
+++ b/invoice/invoice.go
@@ -22,6 +22,7 @@ import (
d "vidhukant.com/openbills/db"
"vidhukant.com/openbills/user"
c "vidhukant.com/openbills/customer"
+ i "vidhukant.com/openbills/item"
"time"
)
@@ -29,7 +30,7 @@ var db *gorm.DB
func init() {
db = d.DB
- db.AutoMigrate(&Invoice{}, &InvoiceBillingAddress{}, &InvoiceShippingAddress{})
+ db.AutoMigrate(&Invoice{}, &InvoiceItem{}, &InvoiceBillingAddress{}, &InvoiceShippingAddress{})
}
type InvoiceBillingAddress struct {
@@ -44,6 +45,14 @@ type InvoiceShippingAddress struct {
InvoiceID uint
}
+type InvoiceItem struct {
+ gorm.Model
+ i.Item
+ InvoiceID uint
+ BrandName string
+ Quantity string // float
+}
+
type Invoice struct {
gorm.Model
UserID uint `json:"-"`
@@ -52,7 +61,7 @@ type Invoice struct {
InvoiceNumber uint
BillingAddress InvoiceBillingAddress
ShippingAddress InvoiceShippingAddress
- Draft bool
+ IsDraft bool
// Transporter Transporter
// DueDate string