Skip to content
Snippets Groups Projects
Commit 8eaec0a0 authored by Vincent Texier's avatar Vincent Texier
Browse files

refs #335 Fix units name displayed for differential values in ZSUM referentials

ZSUM referentials are subsets of Relative and Quantitative referentials.
Differential values are not ZSUM values and must display the units of their parent referential.
parent 645f4cd4
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP, QLocale
from . import Quantitative
import asyncio
class QuantitativeZSum:
_NAME_STR_ = QT_TRANSLATE_NOOP('QuantitativeZSum', 'Quant Z-sum')
_REF_STR_ = QT_TRANSLATE_NOOP('QuantitativeZSum', "{0} Q0 {1}")
......@@ -22,7 +23,7 @@ class QuantitativeZSum:
@classmethod
def diff_units(cls, currency):
return QuantitativeZSum.units(currency)
return Quantitative.units(currency)
@asyncio.coroutine
def value(self):
......@@ -63,4 +64,4 @@ class QuantitativeZSum:
@asyncio.coroutine
def diff_localized(self, units=False, international_system=False):
localized = yield from Quantitative(self.amount, self.community, self.app).localized(units, international_system)
return localized
\ No newline at end of file
return localized
from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP, QObject, QLocale
import asyncio
class Quantitative():
_NAME_STR_ = QT_TRANSLATE_NOOP('Quantitative', 'Units')
_REF_STR_ = QT_TRANSLATE_NOOP('Quantitative', "{0} {1}{2}")
......
from PyQt5.QtCore import QObject, QCoreApplication, QT_TRANSLATE_NOOP, QLocale
import asyncio
class Relative():
class Relative:
_NAME_STR_ = QT_TRANSLATE_NOOP('Relative', 'UD')
_REF_STR_ = QT_TRANSLATE_NOOP('Relative', "{0} {1}UD {2}")
_UNITS_STR_ = QT_TRANSLATE_NOOP('Relative', "UD {0}")
......
......@@ -22,7 +22,7 @@ class RelativeZSum:
@classmethod
def diff_units(cls, currency):
return RelativeZSum.units(currency)
return Relative.units(currency)
@asyncio.coroutine
def value(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment