Changeset - 8dc6894ce7e8
[Not reviewed]
0 3 0
Brett Smith - 4 years ago 2020-06-08 20:38:42
brettcsmith@brettcsmith.org
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.
3 files changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/accrual.py
Show inline comments
...
 
@@ -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")
setup.py
Show inline comments
...
 
@@ -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+',
tests/books/accruals.beancount
Show inline comments
...
 
@@ -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}
0 comments (0 inline, 0 general)