partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 10c9820094ae6583de6a7a0f7f75d6bfac2dad6d
parent 27ea66aa44f44c4d7fff2dd612dd446d5936a8ac
Author: Felicitus <felicitus@felicitus.org>
Date:   Tue, 15 Dec 2015 11:40:13 +0100

Merge branch 'remove-stock-comment' of https://github.com/matthijskooijman/PartKeepr into matthijskooijman-remove-stock-comment

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js | 3++-
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartStockWindow.js | 3+--
Msrc/PartKeepr/PartBundle/Action/RemoveStockAction.php | 6+++++-
3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartDisplay.js @@ -225,10 +225,11 @@ Ext.define('PartKeepr.PartDisplay', { /** * Callback after the "delete stock" dialog is complete. */ - deletePartHandler: function (quantity) + deletePartHandler: function (quantity, unused_price, comment) { this.record.callPutAction("removeStock", { quantity: quantity, + comment: comment, }, null, true); }, /** diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartStockWindow.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartStockWindow.js @@ -178,8 +178,7 @@ Ext.define('PartKeepr.PartStockWindow', { this.setTitle(this.removePartText); this.priceField.hide(); this.priceCheckbox.hide(); - this.commentField.hide(); - this.setHeight(105); + this.setHeight(132); this.okButton.setIconCls("web-icon brick_delete"); this.show(); } diff --git a/src/PartKeepr/PartBundle/Action/RemoveStockAction.php b/src/PartKeepr/PartBundle/Action/RemoveStockAction.php @@ -65,8 +65,12 @@ class RemoveStockAction $user = $this->userService->getUser(); $stock = new StockEntry(0 - intval($quantity), $user); - $part->addStockEntry($stock); + if ($request->request->has("comment") && $request->request->get("comment") !== null) { + $stock->setComment($request->request->get("comment")); + } + + $part->addStockEntry($stock); $this->registry->getManager()->persist($stock); $this->registry->getManager()->flush();