Skip to content

Commit

Permalink
Fix stats (#121)
Browse files Browse the repository at this point in the history
* Fix: Stats

* Fix: Stats

---------

Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
ruuushhh and GitHub Actions authored Sep 23, 2024
1 parent 402cf72 commit 6270b27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions fyle_accounting_mappings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='fyle-accounting-mappings',
version='1.34.5',
version='1.34.6',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Django application to store the fyle accounting mappings in a generic manner',
Expand Down

0 comments on commit 6270b27

Please sign in to comment.