From 6270b27f5dd8ebaeef7e3a992fb459a747acb319 Mon Sep 17 00:00:00 2001 From: ruuushhh <66899387+ruuushhh@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:27:08 +0530 Subject: [PATCH] Fix stats (#121) * Fix: Stats * Fix: Stats --------- Co-authored-by: GitHub Actions --- fyle_accounting_mappings/views.py | 26 +++++++++++++------------- setup.py | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fyle_accounting_mappings/views.py b/fyle_accounting_mappings/views.py index a47c1b2..d8bf3d8 100644 --- a/fyle_accounting_mappings/views.py +++ b/fyle_accounting_mappings/views.py @@ -244,19 +244,19 @@ def get(self, request, *args, **kwargs): mapped_attributes_count = Mapping.objects.filter(**filters).count() activity_mapping = None - if source_type == 'CATEGORY': - activity_attribute_count = ExpenseAttribute.objects.filter( - attribute_type='CATEGORY', value='Activity', workspace_id=self.kwargs['workspace_id'], active=True).count() - - if app_name in ('NetSuite', 'Sage Intacct', 'Sage 300 CRE', 'Dynamics 365 Business Central'): - activity_mapping = CategoryMapping.objects.filter( - source_category__value='Activity', workspace_id=self.kwargs['workspace_id']).first() - else: - activity_mapping = Mapping.objects.filter( - source_type='CATEGORY', source___value='Activity', workspace_id=self.kwargs['workspace_id']).first() - - if activity_attribute_count and not activity_mapping: - mapped_attributes_count += activity_attribute_count + if source_type == 'CATEGORY': + activity_attribute_count = ExpenseAttribute.objects.filter( + attribute_type='CATEGORY', value='Activity', workspace_id=self.kwargs['workspace_id'], active=True).count() + + if app_name in ('NetSuite', 'INTACCT', 'Sage 300 CRE', 'Dynamics 365 Business Central'): + activity_mapping = CategoryMapping.objects.filter( + source_category__value='Activity', workspace_id=self.kwargs['workspace_id']).first() + else: + activity_mapping = Mapping.objects.filter( + source_type='CATEGORY', source___value='Activity', workspace_id=self.kwargs['workspace_id']).first() + + if activity_attribute_count and not activity_mapping: + mapped_attributes_count += activity_attribute_count return Response( data={ diff --git a/setup.py b/setup.py index da01e78..c7835ab 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name='fyle-accounting-mappings', - version='1.34.5', + version='1.34.6', author='Shwetabh Kumar', author_email='shwetabh.kumar@fyle.in', description='Django application to store the fyle accounting mappings in a generic manner',