Skip to content

Commit

Permalink
refactor: handling of exchange rate journals in AR/AP
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Nov 9, 2023
1 parent 696e210 commit 8c0a4f5
Showing 1 changed file with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ def get_data(self):
# Get return entries
self.get_return_entries()

# Get Exchange Rate Revaluations
self.get_exchange_rate_revaluations()

self.data = []

for ple in self.ple_entries:
Expand Down Expand Up @@ -283,9 +280,8 @@ def build_data(self):

row.invoice_grand_total = row.invoiced

if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and (
if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) or (
(abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
or (row.voucher_no in self.err_journals)
):

# non-zero oustanding, we must consider this row
Expand Down Expand Up @@ -1124,24 +1120,6 @@ def get_chart_data(self):
"type": "percentage",
}

def get_exchange_rate_revaluations(self):
je = qb.DocType("Journal Entry")
results = (
qb.from_(je)
.select(je.name)
.where(
(je.company == self.filters.company)
& (je.posting_date.lte(self.filters.report_date))
& (
(je.voucher_type == "Exchange Rate Revaluation")
| (je.voucher_type == "Exchange Gain Or Loss")
)
)
.run()
)
self.err_journals = [x[0] for x in results] if results else []


def get_customer_group_with_children(customer_groups):
if not isinstance(customer_groups, list):
customer_groups = [d.strip() for d in customer_groups.strip().split(",") if d]
Expand Down

0 comments on commit 8c0a4f5

Please sign in to comment.