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 ...@@ -2,6 +2,7 @@ from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP, QLocale
from . import Quantitative from . import Quantitative
import asyncio import asyncio
class QuantitativeZSum: class QuantitativeZSum:
_NAME_STR_ = QT_TRANSLATE_NOOP('QuantitativeZSum', 'Quant Z-sum') _NAME_STR_ = QT_TRANSLATE_NOOP('QuantitativeZSum', 'Quant Z-sum')
_REF_STR_ = QT_TRANSLATE_NOOP('QuantitativeZSum', "{0} Q0 {1}") _REF_STR_ = QT_TRANSLATE_NOOP('QuantitativeZSum', "{0} Q0 {1}")
...@@ -22,7 +23,7 @@ class QuantitativeZSum: ...@@ -22,7 +23,7 @@ class QuantitativeZSum:
@classmethod @classmethod
def diff_units(cls, currency): def diff_units(cls, currency):
return QuantitativeZSum.units(currency) return Quantitative.units(currency)
@asyncio.coroutine @asyncio.coroutine
def value(self): def value(self):
...@@ -63,4 +64,4 @@ class QuantitativeZSum: ...@@ -63,4 +64,4 @@ class QuantitativeZSum:
@asyncio.coroutine @asyncio.coroutine
def diff_localized(self, units=False, international_system=False): def diff_localized(self, units=False, international_system=False):
localized = yield from Quantitative(self.amount, self.community, self.app).localized(units, international_system) localized = yield from Quantitative(self.amount, self.community, self.app).localized(units, international_system)
return localized return localized
\ No newline at end of file
from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP, QObject, QLocale from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP, QObject, QLocale
import asyncio import asyncio
class Quantitative(): class Quantitative():
_NAME_STR_ = QT_TRANSLATE_NOOP('Quantitative', 'Units') _NAME_STR_ = QT_TRANSLATE_NOOP('Quantitative', 'Units')
_REF_STR_ = QT_TRANSLATE_NOOP('Quantitative', "{0} {1}{2}") _REF_STR_ = QT_TRANSLATE_NOOP('Quantitative', "{0} {1}{2}")
......
from PyQt5.QtCore import QObject, QCoreApplication, QT_TRANSLATE_NOOP, QLocale from PyQt5.QtCore import QObject, QCoreApplication, QT_TRANSLATE_NOOP, QLocale
import asyncio import asyncio
class Relative():
class Relative:
_NAME_STR_ = QT_TRANSLATE_NOOP('Relative', 'UD') _NAME_STR_ = QT_TRANSLATE_NOOP('Relative', 'UD')
_REF_STR_ = QT_TRANSLATE_NOOP('Relative', "{0} {1}UD {2}") _REF_STR_ = QT_TRANSLATE_NOOP('Relative', "{0} {1}UD {2}")
_UNITS_STR_ = QT_TRANSLATE_NOOP('Relative', "UD {0}") _UNITS_STR_ = QT_TRANSLATE_NOOP('Relative', "UD {0}")
......
...@@ -22,7 +22,7 @@ class RelativeZSum: ...@@ -22,7 +22,7 @@ class RelativeZSum:
@classmethod @classmethod
def diff_units(cls, currency): def diff_units(cls, currency):
return RelativeZSum.units(currency) return Relative.units(currency)
@asyncio.coroutine @asyncio.coroutine
def value(self): 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