mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
пофиксил неправильный пересчет фасовок в накладной
This commit is contained in:
@@ -11,14 +11,15 @@ import (
|
||||
|
||||
// Invoice - Приходная накладная
|
||||
type Invoice struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
|
||||
RMSServerID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
DocumentNumber string `gorm:"type:varchar(100);index"`
|
||||
DateIncoming time.Time `gorm:"index"`
|
||||
SupplierID uuid.UUID `gorm:"type:uuid;index"`
|
||||
DefaultStoreID uuid.UUID `gorm:"type:uuid;index"`
|
||||
Status string `gorm:"type:varchar(50)"`
|
||||
Comment string `gorm:"type:text"`
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
|
||||
RMSServerID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
DocumentNumber string `gorm:"type:varchar(100);index"`
|
||||
IncomingDocumentNumber string `gorm:"type:varchar(100)"`
|
||||
DateIncoming time.Time `gorm:"index"`
|
||||
SupplierID uuid.UUID `gorm:"type:uuid;index"`
|
||||
DefaultStoreID uuid.UUID `gorm:"type:uuid;index"`
|
||||
Status string `gorm:"type:varchar(50)"`
|
||||
Comment string `gorm:"type:text"`
|
||||
|
||||
Items []InvoiceItem `gorm:"foreignKey:InvoiceID;constraint:OnDelete:CASCADE"`
|
||||
|
||||
@@ -42,6 +43,7 @@ type InvoiceItem struct {
|
||||
|
||||
type Repository interface {
|
||||
GetLastInvoiceDate(serverID uuid.UUID) (*time.Time, error)
|
||||
GetByPeriod(serverID uuid.UUID, from, to time.Time) ([]Invoice, error)
|
||||
SaveInvoices(invoices []Invoice) error
|
||||
CountRecent(serverID uuid.UUID, days int) (int64, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user