ajency / cashflow-issue-tracker

Issue Tracker for issues
0 stars 1 forks source link

BUG - The bill/ BP gets created even if the "lineItemAccountSubType" does not exist in accounts #830

Closed HazelColaco19 closed 4 years ago

HazelColaco19 commented 4 years ago

Describe the bug

The bill/ BP gets created even if the "lineItemAccountSubType" does not exist in accounts.

image

[Link](http://ajency-qa.kibana.toppeq.com/app/kibana#/discover?_g=()&_a=(columns:!(accountSubType,_id),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'971c7830-77db-11ea-9bff-17296d6cdc0e',key:companyId,negate:!f,params:(query:5545,type:phrase),type:phrase,value:'5,545'),query:(match:(companyId:(query:5545,type:phrase)))),('$state':(store:appState),meta:(alias:!n,disabled:!t,index:'971c7830-77db-11ea-9bff-17296d6cdc0e',key:accountSubType.keyword,negate:!f,params:(query:OtherMiscellaneousServiceCost,type:phrase),type:phrase,value:OtherMiscellaneousServiceCost),query:(match:(accountSubType.keyword:(query:OtherMiscellaneousServiceCost,type:phrase))))),index:'971c7830-77db-11ea-9bff-17296d6cdc0e',interval:auto,query:(language:lucene,query:''),sort:!(_score,desc)))

ID: ty_bill_5545_133_1

{ "_index": "outflow", "_type": "_doc", "_id": "ty_bill_5545_133_1", "_version": 4, "_score": 2, "_source": { "_class": "com.toppeq.cashflow.domain.OutFlow", "id": "ty_bill_5545_133_1", "outflowType": "Incurred", "qbParentId": 133, "accountingHeadName": "Cost of Goods Sold", "description": "admin expenses bill", "amount": 2222, "balance": 2222, "currency": "USD", "isRecurring": false, "createDate": 1591920000000, "txnDate": 1591920000000, "lastModifiedDate": 1591920000000, "source": "tally", "companyId": 5545, "paymentStatus": "Pending", "transactionType": "Bill", "qbVendorName": "John Smith", "toppeqCategory": "Supplies Materials Cogs", "qbAccountCategory": "Cost of Goods Sold", "qbAccountSubType": "Supplies Materials Cogs", "qbCategoryId": 1, "qbAmount": 2222 } }

Expected:

If the "lineItemAccountSubType" does not exist, then the bill/ bp should not be created

legred21 commented 4 years ago

Issue is fixed by checking the combination of categoryId and accountName and accountSubType instead of just account name.

HazelColaco19 commented 4 years ago

Fixed.

image