-
-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OBPIH-4837 Transactions Report in csv makes credits and debits 0 for … #3696
Conversation
} | ||
def quantity = | ||
transactionData.find { | ||
it.productCode == product.productCode && it.transactionTypeName == transactionTypeName | ||
it.productCode == product.productCode && it.transactionTypeName == transactionTypeName.split("\\|")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? Shouldn't getLocalizedString be doing that for us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, but it compares English == French
which always results in false
.
The transactionData
in line 468
stores the transactionTypeName
as English only, so that's why I made it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll send some images from debugging in a moment to show what I mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it. I am going to write a comment in the ticket to explain what I'd like to see in the long term. But for now, you have the right approach. Let's just move that logic to a convenience method on the TransactionType class if possible.
@awalkowiak Are we allowed to do something like this
Boolean compareTo(String transactionTypeName)
Boolean equals(String transactionTypeName)
or would it be better not to implement methods that are defined by common interfaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmiranda I think I'd go with something like Boolean compareTransactionType(String transactionTypeName)
because the string that might be passed not always will be the transactionTypeName
, so for clarity, I would avoid using compareTo
and equals
and strictly let others know what I want to compare.
cc @kchelstowski
645bdc3
to
bc9ff06
Compare
bc9ff06
to
8274413
Compare
…locale in Fr
Like I told to @awalkowiak I don't feel good about this solution, but couldn't figure out anything better for now.
The problem was, that
transactionData
storestransactionTypeName
always in English, for example:Transfer in
, buttransactionTypeNames
example is:Transfer in|fr:<french_translation>
, which resulted in comparing in line534
for exampleTransfer In == <its_french_translation>
, so the result was always0
.So the solution I figured out was just to split the
transationTypeName
by the delimiter (|
) and take the first element (English), so we compare it propely.Still, the translated version is needed in order to put it to the header of CSV, so I kept it