Skip to content
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

Currency #217

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Written in 2015-2016 by Sam Hamilton - samhamilton
Written in 2015 by Leonardo Carvalho - CarvalhoLeonardo
Written in 2015 by Swapnil M Mane - swapnilmmane
Written in 2015 by Anton Akhiar - akhiar
Writter in 2015-2016 by Jens Hardings - jenshp
Writter in 2015-2023 by Jens Hardings - jenshp
Written in 2016 by Mark Haney - mphaney
Written in 2018 by Nirendra Singh Panwar - nirendra10695
Written in 2018 by Zhang Wei - zhangwei1979
Expand Down Expand Up @@ -86,7 +86,7 @@ Written in 2015 by Jimmy Shen - shendepu
Written in 2015 by Sam Hamilton - samhamilton
Written in 2015 by Leonardo Carvalho - CarvalhoLeonardo
Written in 2015 by Anton Akhiar - akhiar
Writter in 2015-2016 by Jens Hardings - jenshp
Writter in 2015-2023 by Jens Hardings - jenshp
Written in 2016 by Mark Haney - mphaney
Written in 2018 by Nirendra Singh Panwar - nirendra10695
Written in 2018 by Zhang Wei - zhangwei1979
Expand Down
12 changes: 10 additions & 2 deletions template/screen-macro/DefaultScreenMacros.csv.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,18 @@ on the same screen to increase reusability of those screens -->
<#assign fieldValue = ec.getResource().expand(.node["@text"], "")>
</#if>
<#if .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
</#if>
<#elseif .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
<#else>
<#assign fieldValue = sri.getFieldValueString(.node)>
</#if>
Expand Down
12 changes: 10 additions & 2 deletions template/screen-macro/DefaultScreenMacros.html.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -1941,10 +1941,18 @@ a => A, d => D, y => Y
<#assign fieldValue = ec.getResource().expand(.node["@text"], "")>
</#if>
<#if .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
</#if>
<#elseif .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
<#else>
<#assign fieldValue = sri.getFieldValueString(.node)>
</#if>
Expand Down
13 changes: 11 additions & 2 deletions template/screen-macro/DefaultScreenMacros.qvt.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -1755,9 +1755,18 @@ a => A, d => D, y => Y
<#if textMap?has_content><#assign fieldValue = ec.getResource().expand(.node["@text"], "", textMap)>
<#else><#assign fieldValue = ec.getResource().expand(.node["@text"], "")></#if>
<#if .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))></#if>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
</#if>
<#elseif .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
<#else>
<#assign fieldValue = sri.getFieldValueString(.node)>
</#if>
Expand Down
12 changes: 10 additions & 2 deletions template/screen-macro/DefaultScreenMacros.text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,18 @@ along with this software (see the LICENSE.md file). If not, see
<#assign fieldValue = ec.getResource().expand(.node["@text"], "")>
</#if>
<#if .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
</#if>
<#elseif .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
<#else>
<#assign fieldValue = sri.getFieldValueString(.node)>
</#if>
Expand Down
13 changes: 11 additions & 2 deletions template/screen-macro/DefaultScreenMacros.vuet.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -1667,9 +1667,18 @@ a => A, d => D, y => Y
<#if textMap?has_content><#assign fieldValue = ec.getResource().expand(.node["@text"], "", textMap)>
<#else><#assign fieldValue = ec.getResource().expand(.node["@text"], "")></#if>
<#if .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))></#if>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(fieldValue, ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
</#if>
<#elseif .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.getL10n().formatCurrencyNoSymbol(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.getL10n().formatCurrency(sri.getFieldValue(dispFieldNode, ""), ec.getResource().expression(.node["@currency-unit-field"], ""))>
</#if>
<#else>
<#assign fieldValue = sri.getFieldValueString(.node)>
</#if>
Expand Down
12 changes: 10 additions & 2 deletions template/screen-macro/DefaultScreenMacros.xml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,18 @@ along with this software (see the LICENSE.md file). If not, see
<#if .node["@text"]?has_content>
<#assign fieldValue = ec.resource.expand(.node["@text"], "")>
<#if .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.l10n.formatCurrency(fieldValue, ec.resource.expression(.node["@currency-unit-field"], ""), 2)>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.l10n.formatCurrencyNoSymbol(fieldValue, ec.resource.expression(.node["@currency-unit-field"], ""), 2)>
<#else>
<#assign fieldValue = ec.l10n.formatCurrency(fieldValue, ec.resource.expression(.node["@currency-unit-field"], ""), 2)>
</#if>
</#if>
<#elseif .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.l10n.formatCurrency(sri.getFieldValue(.node?parent?parent, ""), ec.resource.expression(.node["@currency-unit-field"], ""), 2)>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.l10n.formatCurrencyNoSymbol(sri.getFieldValue(.node?parent?parent, ""), ec.resource.expression(.node["@currency-unit-field"], ""), 2)>
<#else>
<#assign fieldValue = ec.l10n.formatCurrency(sri.getFieldValue(.node?parent?parent, ""), ec.resource.expression(.node["@currency-unit-field"], ""), 2)>
</#if>
<#else>
<#assign fieldValue = sri.getFieldValueString(.node)>
</#if>
Expand Down
12 changes: 10 additions & 2 deletions template/screen-macro/DefaultScreenMacros.xsl-fo.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,18 @@ along with this software (see the LICENSE.md file). If not, see
<#if .node["@text"]?has_content>
<#assign fieldValue = ec.resource.expand(.node["@text"], "")>
<#if .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.l10n.formatCurrency(fieldValue, ec.resource.expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.l10n.formatCurrencyNoSymbol(fieldValue, ec.resource.expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.l10n.formatCurrency(fieldValue, ec.resource.expression(.node["@currency-unit-field"], ""))>
</#if>
</#if>
<#elseif .node["@currency-unit-field"]?has_content>
<#assign fieldValue = ec.l10n.formatCurrency(sri.getFieldValue(.node?parent?parent, ""), ec.resource.expression(.node["@currency-unit-field"], ""))>
<#if .node["@currency-hide-symbol"]! == "true">
<#assign fieldValue = ec.l10n.formatCurrencyNoSymbol(sri.getFieldValue(.node?parent?parent, ""), ec.resource.expression(.node["@currency-unit-field"], ""))>
<#else>
<#assign fieldValue = ec.l10n.formatCurrency(sri.getFieldValue(.node?parent?parent, ""), ec.resource.expression(.node["@currency-unit-field"], ""))>
</#if>
<#else>
<#assign fieldValue = sri.getFieldValueString(.node)>
</#if>
Expand Down