diff --git a/backend/internal/db/mongo/restock_misc.go b/backend/internal/db/mongo/restock_misc.go index c1d7932..d24eed4 100644 --- a/backend/internal/db/mongo/restock_misc.go +++ b/backend/internal/db/mongo/restock_misc.go @@ -51,7 +51,18 @@ func (b *Backend) GetAllRestocks(ctx context.Context, page uint64, size uint64) ctx, cancel := b.TimeoutContext(ctx) defer cancel() - filter := bson.M{} + filter := bson.M{ + "$or": []bson.M{ + { + "deleted_at": bson.M{ + "$exists": false, + }, + }, + { + "deleted_at": nil, + }, + }, + } // Get "size" restocks from "page" using aggregation var restocks []*models.Restock @@ -72,7 +83,18 @@ func (b *Backend) CountAllRestocks(ctx context.Context) (uint64, error) { ctx, cancel := b.TimeoutContext(ctx) defer cancel() - filter := bson.M{} + filter := bson.M{ + "$or": []bson.M{ + { + "deleted_at": bson.M{ + "$exists": false, + }, + }, + { + "deleted_at": nil, + }, + }, + } count, err := b.db.Collection(RestocksCollection).CountDocuments(ctx, filter) if err != nil { diff --git a/frontend/src/routes/panel/products/reappro/+page.svelte b/frontend/src/routes/panel/products/reappro/+page.svelte index a94a1ad..be309a4 100644 --- a/frontend/src/routes/panel/products/reappro/+page.svelte +++ b/frontend/src/routes/panel/products/reappro/+page.svelte @@ -1,5 +1,6 @@
+ Actions +
+{restok.created_at}
+{restock.created_at}
{restok.type}
+{restock.type}
{restok.created_by_name}
+{restock.created_by_name}
- {formatPrice(restok.total_cost_ttc)} + {formatPrice(restock.total_cost_ttc)}
++ + Nom + + | ++ + Prix coûtant HT + + | ++ + Prix coûtant TTC + + | ++ + Nombre de lots + + | ++ + Nbr produits par lots + + | ++ + Prix d'un lot HT + + | ++ + TVA + + | ++ + Prix d'un lot TTC + + | +
---|---|---|---|---|---|---|---|
+
+
+
+
+ {item.item_name} + |
+
+
+
+
+
+ {formatPrice(item.bundle_cost_ht * item.amount_of_bundle)} + |
+
+
+
+
+
+ + {formatPrice(item.bundle_cost_ttc * item.amount_of_bundle)} + + |
+
+
+
+
+
+ {item.amount_of_bundle} + |
+
+
+
+
+
+ {item.amount_per_bundle} + |
+
+
+
+
+
+ {formatPrice(item.bundle_cost_ht)} + |
+
+
+
+
+
+ {item.tva / 100}% + |
+
+
+
+
+
+ {formatPrice(item.bundle_cost_ttc)} + |
+