Commit 065e82de authored by Aurel's avatar Aurel

open counter and counter and change variable name to be more consistent

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8557 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9038650e
......@@ -144,9 +144,11 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase
'quantity': self.quantity_200}
line_list = [inventory_dict_line_1, inventory_dict_line_2]
self.usual_cash = self.paris.surface.gros_versement.guichet_1.encaisse_des_billets_et_monnaies
self.counter = self.paris.surface.gros_versement.guichet_1.encaisse_des_billets_et_monnaies
self.tri = self.paris.surface.salle_tri.encaisse_des_billets_et_monnaies
self.createCashInventory(source=None, destination=self.usual_cash, currency=self.currency_1,
self.openCounterDate(site=self.paris)
self.openCounter(self.counter)
self.createCashInventory(source=None, destination=self.counter, currency=self.currency_1,
line_list=line_list)
......@@ -169,11 +171,11 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase
"""
self.simulation_tool = self.getSimulationTool()
# check we have 5 banknotes of 10000 in usual_cash
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
# check we have 12 coin of 200 in usual_cash
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
def stepCheckSource(self, sequence=None, sequence_list=None, **kwd):
......@@ -181,11 +183,11 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase
Check inventory in source vault (usual_cash) before a confirm
"""
# check we have 5 banknotes of 10000
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
# check we have 12 coin of 200
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
def stepCheckDestination(self, sequence=None, sequence_list=None, **kwd):
......@@ -205,7 +207,7 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase
Create a money deposit transfer document and check it
"""
# Money Deposit transfer has usual_cash (Gros versment) for source, tri for destination, and a price cooreponding to the sum of banknote of 10000 abd coin of 200 ( (2+3) * 1000 + (5+7) * 200 )
self.money_deposit_transfer = self.money_deposit_transfer_module.newContent(id='money_deposit_transfer_1', portal_type='Money Deposit Transfer', source_value=self.usual_cash, destination_value=self.tri, source_total_asset_price=52400.0)
self.money_deposit_transfer = self.money_deposit_transfer_module.newContent(id='money_deposit_transfer_1', portal_type='Money Deposit Transfer', source_value=self.counter, destination_value=self.tri, source_total_asset_price=52400.0)
# execute tic
self.stepTic()
# check we have only one money deposit transfer
......@@ -253,7 +255,7 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase
# check the banknote of the cell is banknote of 10000
self.assertEqual(cell.getResourceValue(), self.billet_10000)
# check the source vault is usual_cash
self.assertEqual(cell.getSourceValue(), self.usual_cash)
self.assertEqual(cell.getSourceValue(), self.counter)
# check the destination vault is tri
self.assertEqual(cell.getDestinationValue(), self.tri)
if cell.getId() == 'movement_0_0_0':
......@@ -405,13 +407,13 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase
Check that compution of inventory at vault usual_cash is right after confirm and before deliver
"""
# check we have 5 banknotes of 10000 currently
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 5.0)
# check we will have 0 banknote of 10000 after deliver
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
# check we have 12 coins of 200 currently
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 12.0)
# check we will have 0 coin of 200 after deliver
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCheckDestinationCreditPlanned(self, sequence=None, sequence_list=None, **kwd):
......@@ -452,11 +454,11 @@ class TestERP5BankingMoneyDepositTransfer(TestERP5BankingMixin, ERP5TypeTestCase
Check inventory at source (vault usual_cash) after deliver of the money deposit transfer
"""
# check we have 0 banknote of 10000
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.billet_10000.getRelativeUrl()), 0.0)
# check we have 0 coin of 200
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.usual_cash.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getCurrentInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
self.assertEqual(self.simulation_tool.getFutureInventory(node=self.counter.getRelativeUrl(), resource = self.piece_200.getRelativeUrl()), 0.0)
def stepCheckDestinationCredit(self, sequence=None, sequence_list=None, **kwd):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment