chore: rename FifoValuation to FIFOValuation
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 498b9f5..f45bee1 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -16,7 +16,7 @@
get_or_make_bin,
get_valuation_method,
)
-from erpnext.stock.valuation import FifoValuation
+from erpnext.stock.valuation import FIFOValuation
class NegativeStockError(frappe.ValidationError): pass
@@ -701,7 +701,7 @@
actual_qty = flt(sle.actual_qty)
outgoing_rate = flt(sle.outgoing_rate)
- fifo_queue = FifoValuation(self.wh_data.stock_queue)
+ fifo_queue = FIFOValuation(self.wh_data.stock_queue)
if actual_qty > 0:
fifo_queue.add_stock(qty=actual_qty, rate=incoming_rate)
else:
diff --git a/erpnext/stock/tests/test_valuation.py b/erpnext/stock/tests/test_valuation.py
index 065c490..85788ba 100644
--- a/erpnext/stock/tests/test_valuation.py
+++ b/erpnext/stock/tests/test_valuation.py
@@ -3,7 +3,7 @@
from hypothesis import given
from hypothesis import strategies as st
-from erpnext.stock.valuation import FifoValuation, _round_off_if_near_zero
+from erpnext.stock.valuation import FIFOValuation, _round_off_if_near_zero
qty_gen = st.floats(min_value=-1e6, max_value=1e6)
value_gen = st.floats(min_value=1, max_value=1e6)
@@ -13,7 +13,7 @@
class TestFifoValuation(unittest.TestCase):
def setUp(self):
- self.queue = FifoValuation([])
+ self.queue = FIFOValuation([])
def tearDown(self):
qty, value = self.queue.get_total_stock_and_value()
@@ -41,12 +41,12 @@
self.assertEqual(self.queue, [[2, 10]])
def test_adding_negative_stock_keeps_rate(self):
- self.queue = FifoValuation([[-5.0, 100]])
+ self.queue = FIFOValuation([[-5.0, 100]])
self.queue.add_stock(1, 10)
self.assertEqual(self.queue, [[-4, 100]])
def test_adding_negative_stock_updates_rate(self):
- self.queue = FifoValuation([[-5.0, 100]])
+ self.queue = FIFOValuation([[-5.0, 100]])
self.queue.add_stock(6, 10)
self.assertEqual(self.queue, [[1, 10]])
@@ -126,7 +126,7 @@
@given(stock_queue_generator)
def test_fifo_qty_hypothesis(self, stock_queue):
- self.queue = FifoValuation([])
+ self.queue = FIFOValuation([])
total_qty = 0
for qty, rate in stock_queue:
@@ -144,7 +144,7 @@
@given(stock_queue_generator)
def test_fifo_qty_value_nonneg_hypothesis(self, stock_queue):
- self.queue = FifoValuation([])
+ self.queue = FIFOValuation([])
total_qty = 0.0
total_value = 0.0
diff --git a/erpnext/stock/valuation.py b/erpnext/stock/valuation.py
index 48efde6..45c5083 100644
--- a/erpnext/stock/valuation.py
+++ b/erpnext/stock/valuation.py
@@ -9,7 +9,7 @@
RATE = 1
-class FifoValuation:
+class FIFOValuation:
"""Valuation method where a queue of all the incoming stock is maintained.
New stock is added at end of the queue.