Skripta, ki prevede XML poročilo trgovalnih poslov v platformi InteractiveBrokers v XML format primeren za uvoz v obrazce Doh-KDVP, D-IFI, Doh-Div in Doh-Obr v eDavkih Finančne uprave.
MIT License
173
stars
57
forks
source link
Fixed a bug with comparison of transactionIDs #101
transactionIDs were compared lexicographically, as strings, instead of by their numerical value.
Explanation:
The usual case is that the transactionIDs of the witholding tax and the dividend are close - meaning that they have the same number of digits. For example the symbolMSF:
Hence the original code worked most of the time, because lexicograpical comparison is the same as numerical when the numbers have the same number of digits.
But this is not an invariant. Some transactions may be far away (measured in how many transactions transpired between them). For example the symbol APC:
This merge should fix https://github.com/jamsix/ib-edavki/issues/100. It also adds a few missing companies and
conid
s.Bug
transactionID
s were compared lexicographically, as strings, instead of by their numerical value.Explanation:
The usual case is that the transactionIDs of the witholding tax and the dividend are close - meaning that they have the same number of digits. For example the
symbol
MSF:Hence the original code worked most of the time, because lexicograpical comparison is the same as numerical when the numbers have the same number of digits.
But this is not an invariant. Some transactions may be far away (measured in how many transactions transpired between them). For example the symbol APC:
Where the lexicographic comparison
returns
False
.This merge fixes this by casting the strings to integers before the comparison.