accrual: Outgoing report uses first rt-id as primary ticket number.

This makes it consistent with the reporting and our general rule
that the first link is primary.
This commit is contained in:
Brett Smith 2020-06-08 16:37:51 -04:00
parent e22e63dcca
commit 8dc6894ce7
3 changed files with 8 additions and 3 deletions

View file

@ -508,7 +508,12 @@ class OutgoingReport(BaseReport):
self.rt_wrapper = rtutil.RT(rt_client)
def _primary_rt_id(self, posts: AccrualPostings) -> rtutil.TicketAttachmentIds:
rt_ids = posts.all_meta_links('rt-id')
rt_ids: Set[str] = set()
for post in posts:
try:
rt_ids.add(post.meta.get_links('rt-id')[0])
except (IndexError, TypeError):
pass
rt_ids_count = len(rt_ids)
if rt_ids_count != 1:
raise ValueError(f"{rt_ids_count} rt-id links found")

View file

@ -5,7 +5,7 @@ from setuptools import setup
setup(
name='conservancy_beancount',
description="Plugin, library, and reports for reading Conservancy's books",
version='1.1.3',
version='1.1.4',
author='Software Freedom Conservancy',
author_email='info@sfconservancy.org',
license='GNU AGPLv3+',

View file

@ -108,7 +108,7 @@
Liabilities:Payable:Accounts -60.00 USD
2010-06-18 * "EuroGov" "European legal fees"
rt-id: "rt:520"
rt-id: "rt:520 rt:525"
invoice: "rt:520/5200"
contract: "rt:520/5220"
Liabilities:Payable:Accounts -1,000 EUR {1.100 USD}