mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
Полноценно редактируются черновики
Добавляются фасовки как в черновике, так и в обучении Исправил внешний вид
This commit is contained in:
@@ -83,3 +83,24 @@ func (r *pgRepository) UpdateItem(itemID uuid.UUID, productID *uuid.UUID, contai
|
||||
func (r *pgRepository) Delete(id uuid.UUID) error {
|
||||
return r.db.Delete(&drafts.DraftInvoice{}, id).Error
|
||||
}
|
||||
|
||||
func (r *pgRepository) GetActive() ([]drafts.DraftInvoice, error) {
|
||||
var list []drafts.DraftInvoice
|
||||
|
||||
// Выбираем статусы, которые считаем "активными"
|
||||
activeStatuses := []string{
|
||||
drafts.StatusProcessing,
|
||||
drafts.StatusReadyToVerify,
|
||||
drafts.StatusError,
|
||||
drafts.StatusCanceled,
|
||||
}
|
||||
|
||||
err := r.db.
|
||||
Preload("Items"). // Нужны для подсчета суммы и количества
|
||||
Preload("Store"). // Нужно для названия склада
|
||||
Where("status IN ?", activeStatuses).
|
||||
Order("created_at DESC").
|
||||
Find(&list).Error
|
||||
|
||||
return list, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user