Update API Sales
This commit is contained in:
@@ -8,6 +8,7 @@ type Customer struct {
|
||||
Address string `json:"address"`
|
||||
Phone string `json:"phone"`
|
||||
Email string `json:"email"`
|
||||
Type string `json:"type"`
|
||||
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
|
||||
@@ -3,13 +3,18 @@ package models
|
||||
import "time"
|
||||
|
||||
type Invoice struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
SalesOrderID uint `json:"sales_order_id"`
|
||||
InvoiceDate time.Time `json:"invoice_date"`
|
||||
DueDate time.Time `json:"due_date"`
|
||||
TotalAmount float64 `json:"total_amount"`
|
||||
Status string `json:"status"` // contoh: unpaid, partial, paid
|
||||
Note string `json:"note"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
SalesOrderID uint `json:"sales_order_id"`
|
||||
InvoiceNumber string `gorm:"not null;unique" json:"invoice_number"`
|
||||
InvoiceDate time.Time `json:"invoice_date"`
|
||||
DueDate time.Time `json:"due_date"`
|
||||
TotalAmount float64 `json:"total_amount"`
|
||||
Status string `json:"status"` // contoh: unpaid, partial, paid
|
||||
Note string `json:"note"`
|
||||
IsDpInvoice bool `json:"is_dp_invoice"` // Apakah ini invoice DP (Down Payment)
|
||||
Amount float64 `json:"amount"` // Jumlah DP jika ada
|
||||
ParentInvoiceID uint `json:"parent_invoice_id,omitempty"` // ID invoice induk jika ini adalah invoice lanjutan
|
||||
ParentInvoice *Invoice `gorm:"foreignKey:ParentInvoiceID" json:"parent_invoice,omitempty"`
|
||||
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
|
||||
@@ -3,12 +3,13 @@ package models
|
||||
import "time"
|
||||
|
||||
type Payment struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
InvoiceID uint `json:"invoice_id"`
|
||||
Amount float64 `json:"amount"`
|
||||
PaidAt time.Time `json:"paid_at"`
|
||||
Method string `json:"method"` // contoh: cash, bank transfer, credit card
|
||||
Note string `json:"note"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
InvoiceID uint `json:"invoice_id"`
|
||||
Amount float64 `json:"amount"`
|
||||
PaymentAt time.Time `json:"payment_at"`
|
||||
PaymentMethod string `json:"payment_method"` // contoh: cash, bank transfer, credit card
|
||||
FilePath string `json:"file_path"` // Path ke file bukti pembayaran
|
||||
Note string `json:"note"`
|
||||
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
|
||||
@@ -11,8 +11,6 @@ type SalesOrder struct {
|
||||
Note string `json:"note"`
|
||||
PaymentTerms string `json:"payment_terms"`
|
||||
DueDate time.Time `json:"due_date"`
|
||||
DPAmount float64 `json:"dp_amount"`
|
||||
DPPaid float64 `json:"dp_paid"`
|
||||
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
|
||||
Reference in New Issue
Block a user