From a960d5143f59bd493c8650c118285e109f273dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Andrade?= Date: Mon, 9 Mar 2020 13:18:36 +0200 Subject: [PATCH] Add stock transactions to item page --- langs/en/labels.json | 6 +++++- pages/item.php | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/langs/en/labels.json b/langs/en/labels.json index 1dca287..ea663b3 100644 --- a/langs/en/labels.json +++ b/langs/en/labels.json @@ -18,5 +18,9 @@ "Notes": "Notes", "Comments": "Comments", "Cost": "Cost", - "Price": "Price" + "Price": "Price", + "date": "Date", + "amount": "Stock amount", + "description": "Description", + "changed by": "Changed by" } diff --git a/pages/item.php b/pages/item.php index 47be2fa..eabb20e 100644 --- a/pages/item.php +++ b/pages/item.php @@ -169,5 +169,44 @@ $item = $database->get( } ?> + +
+ +
+ + + + + + + + + + + select('stock', [ + 'timestamp', + 'stock', + 'text1', + 'userid' + ], [ + 'itemid' => $item['itemid'] + ] + ); + foreach ($stockentries as $stockentry) { + $user = new User($stockentry['userid']) + ?> + + + + + + + + +
get('date'); ?> get('amount'); ?> get('description'); ?> get('changed by'); ?>
getName() . " (" . $user->getUsername() . ")"; ?>
+
- \ No newline at end of file +