Commit 6b711038 authored by Łukasz Nowak's avatar Łukasz Nowak

Switch to Sale Invoice.

This documents allow to lower balance of customer, Payment Transaction shall
not be used.
parent 581f825c
...@@ -204,31 +204,60 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin): ...@@ -204,31 +204,60 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepCreateSmallPayment(self, sequence, **kw): def stepCreateSmallInvoiceWebUser(self, sequence, **kw):
person = self.portal.ERP5Site_getAuthenticatedMemberPersonValue(sequence[ person = self.portal.ERP5Site_getAuthenticatedMemberPersonValue(sequence[
'web_user']) 'web_user'])
payment_transaction = self.portal.accounting_module.newContent( invoice = self.portal.accounting_module.newContent(
portal_type='Sale Invoice Transaction',
start_date=DateTime(),
resource='currency_module/EUR',
source_section='organisation_module/vifib_internet', source_section='organisation_module/vifib_internet',
source='organisation_module/vifib_internet',
destination_section=person.getRelativeUrl(), destination_section=person.getRelativeUrl(),
resource='currency_module/EUR', destination=person.getRelativeUrl(),
portal_type="Payment Transaction", specialise='sale_trade_condition_module/vifib_trade_condition'
start_date=DateTime(),
# XXX More info needed
) )
payment_transaction.newContent( invoice.newContent(
portal_type="Accounting Transaction Line", portal_type='Invoice Line',
resource=self.portal.portal_preferences.getPreferredRegistrationResource(),
quantity=1, quantity=1,
source='account_module/receivable', price=1
) )
payment_transaction.newContent( sequence['invoice'] = invoice
portal_type="Accounting Transaction Line",
quantity=-1, def stepPlanInvoice(self, sequence, **kw):
source='account_module/sales', sequence['invoice'].plan()
def stepConfirmInvoice(self, sequence, **kw):
sequence['invoice'].confirm()
def stepStartInvoice(self, sequence, **kw):
sequence['invoice'].start()
def stepCheckWebUserBalanceSmallAmount(self, sequence, **kw):
person = self.portal.ERP5Site_getAuthenticatedMemberPersonValue(sequence[
'web_user'])
self.assertEqual(-1.0,
self.portal.portal_simulation.getInventoryAssetPrice(
node_category='account_type/asset/receivable',
simulation_state=['started', 'stopped', 'delivered'],
section_uid=self.portal.restrictedTraverse(
'organisation_module/vifib_internet').getUid(),
mirror_section_uid=person.getUid())
) )
payment_transaction.confirm()
payment_transaction.start() create_small_registration_fee_invoice = """
# XXX More info needed LoginERP5TypeTestCase
payment_transaction.checkConsistency() CreateSmallInvoiceWebUser
Tic
PlanInvoice
Tic
ConfirmInvoice
StartInvoice
Tic
CheckWebUserBalanceSmallAmount
Logout
"""
def test_automated_person_small_not_paid_not_locking(self): def test_automated_person_small_not_paid_not_locking(self):
"""Test that a person is not automatically locked by an alarm if """Test that a person is not automatically locked by an alarm if
...@@ -245,12 +274,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin): ...@@ -245,12 +274,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
CheckPersonUnlockedState \ CheckPersonUnlockedState \
Tic \ Tic \
Logout \ Logout \
\ ' + self.create_small_registration_fee_invoice + '\
LoginERP5TypeTestCase \
CreateSmallPayment \
Tic \
Logout \
\
TriggerLockPersonAlarm \ TriggerLockPersonAlarm \
Tic \ Tic \
Logout \ Logout \
......
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