Commit 7987caf8 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: put destination account in the transaction line

XXX no way currently to support having no destination if the destination_section does not handle accounting
parent 2611612f
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
id = { id = {
'asset_receivable_subscriber': 'receivable', 'asset_receivable_subscriber': 'receivable',
'asset_deposit_subscriber': 'deposit', 'asset_deposit_subscriber': 'deposit',
'collection': 'payment_to_encash' 'collection': 'payment_to_encash',
'payable': 'payable'
}[use] }[use]
account, = context.getPortalObject().portal_catalog( account, = context.getPortalObject().portal_catalog(
......
...@@ -67,17 +67,17 @@ payment_transaction.newContent( ...@@ -67,17 +67,17 @@ payment_transaction.newContent(
portal_type='Accounting Transaction Line', portal_type='Accounting Transaction Line',
quantity=price, quantity=price,
source_value=getAccountForUse('asset_receivable_subscriber'), source_value=getAccountForUse('asset_receivable_subscriber'),
# XXX XXX XXX fetch from Business process instead of hardcoding? destination_value=getAccountForUse('payable')
# drop destination
destination='account_module/payable'
) )
# bank # bank
collection_account = getAccountForUse('collection')
payment_transaction.newContent( payment_transaction.newContent(
id='bank', id='bank',
portal_type='Accounting Transaction Line', portal_type='Accounting Transaction Line',
quantity=-price, quantity=-price,
source_value=getAccountForUse('collection') source_value=collection_account,
destination_value=collection_account
) )
if len(payment_transaction.checkConsistency()) != 0: if len(payment_transaction.checkConsistency()) != 0:
......
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