Skip to content

Commit

Permalink
Make sure document_number is not NULL when getting latest product doc… (
Browse files Browse the repository at this point in the history
#405)

Make sure document_number is not NULL when getting latest product document number
  • Loading branch information
jfreda authored Nov 6, 2023
1 parent 84438a5 commit 622e935
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/models/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ func GetLatestProductNumber(db *gorm.DB,
DocumentTypeID: dt.ID,
ProductID: p.ID,
}).
Where("document_number IS NOT NULL").
Order("document_number desc").
First(&d).
Error; err != nil {
Expand Down

0 comments on commit 622e935

Please sign in to comment.