commit 3abe11978f2099b0b105bace6f62391950568db5
parent 8a45e1b61a2e63d75f922ec47d4c9e6d8cce9a34
Author: Felicitus <felicitus@felicitus.org>
Date: Mon, 27 Jun 2011 17:17:22 +0200
Added correction flag
Diffstat:
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/src/de/RaumZeitLabor/PartKeepr/Stock/StockEntry.php b/src/de/RaumZeitLabor/PartKeepr/Stock/StockEntry.php
@@ -12,7 +12,7 @@ class StockEntry {
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
- * @var unknown_type
+ * @var int
*/
private $id;
@@ -44,6 +44,14 @@ class StockEntry {
private $dateTime;
/**
+ * Indicates if the stock level is a correction entry.
+ *
+ * @Column(type="boolean")
+ * @var boolean
+ */
+ private $correction;
+
+ /**
* Creates a new stock entry. A stock entry tracks how many parts
* were the stockLevel is the amount of items added/removed,
* by which user and how much the user paid for it (for adding parts only!)
@@ -57,6 +65,7 @@ class StockEntry {
$this->setStockLevel($stockLevel);
$this->setUser($user);
$this->setDateTime(new \DateTime());
+ $this->setCorrection(false);
}
@@ -77,6 +86,22 @@ class StockEntry {
}
/**
+ * Sets if the stock entry is a correction record.
+ * @param $bCorrection boolean True if the record is a correction record, false otherwise
+ */
+ public function setCorrection ($bCorrection) {
+ $this->correction = $bCorrection;
+ }
+
+ /**
+ * Returns if the entry is a correction entry.
+ * @return boolean True if the entry is a correction entry, false otherwise
+ */
+ public function getCorrection () {
+ return $this->correction;
+ }
+
+ /**
* Sets the price for the item stored.
*
* Please note that the price is for a single item only, and can be null.