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 @@
id = {
'asset_receivable_subscriber': 'receivable',
'asset_deposit_subscriber': 'deposit',
'collection': 'payment_to_encash'
'collection': 'payment_to_encash',
'payable': 'payable'
}[use]
account, = context.getPortalObject().portal_catalog(
......
......@@ -67,17 +67,17 @@ payment_transaction.newContent(
portal_type='Accounting Transaction Line',
quantity=price,
source_value=getAccountForUse('asset_receivable_subscriber'),
# XXX XXX XXX fetch from Business process instead of hardcoding?
# drop destination
destination='account_module/payable'
destination_value=getAccountForUse('payable')
)
# bank
collection_account = getAccountForUse('collection')
payment_transaction.newContent(
id='bank',
portal_type='Accounting Transaction Line',
quantity=-price,
source_value=getAccountForUse('collection')
source_value=collection_account,
destination_value=collection_account
)
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