Skip to content
Snippets Groups Projects
Commit 67ce445c authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

Currency formatting

parent f10caaed
No related branches found
No related tags found
No related merge requests found
Showing
with 234 additions and 196 deletions
......@@ -97,9 +97,9 @@
<name>VAT</name>
<title>Total VAT</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<inputFormat>#,##0.00</inputFormat>
<state>READONLY</state>
<displayValueProcess>%aditoprj%/entity/Offer_entity/entityfields/vat/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>IMAGE</name>
......@@ -162,19 +162,19 @@
<name>NET</name>
<title>Total net</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<inputFormat>#,##0.00</inputFormat>
<state>READONLY</state>
<displayValueProcess>%aditoprj%/entity/Offer_entity/entityfields/net/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>TotalGross</name>
<documentation>%aditoprj%/entity/Offer_entity/entityfields/totalgross/documentation.adoc</documentation>
<title>Total gross</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<inputFormat>#,##0.00</inputFormat>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/totalgross/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Offer_entity/entityfields/totalgross/displayValueProcess.js</displayValueProcess>
</entityField>
<entityParameter>
<name>SalesprojectId_param</name>
......
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$this.value"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$this.value"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$this.value"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
......@@ -87,8 +87,8 @@
<name>VAT</name>
<title>Total VAT</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<state>READONLY</state>
<displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/vat/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>IMAGE</name>
......@@ -154,18 +154,18 @@
<name>NET</name>
<title>Total net</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<state>READONLY</state>
<valueProcess></valueProcess>
<displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/net/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>TotalGross</name>
<documentation>%aditoprj%/entity/Order_entity/entityfields/totalgross/documentation.adoc</documentation>
<title>Total gross</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Order_entity/entityfields/totalgross/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/totalgross/displayValueProcess.js</displayValueProcess>
</entityField>
<entityParameter>
<name>SalesprojectId_param</name>
......
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$this.value"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$this.value"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(NumberUtils.formatWithCurrency(vars.get("$this.value"), translate.text("#,##0.00"), vars.get("$field.CURRENCY")));
\ No newline at end of file
......@@ -104,7 +104,6 @@
<title>Volume</title>
<description></description>
<contentType>NUMBER</contentType>
<outputFormat>#0</outputFormat>
<inputFormat>#0</inputFormat>
<searchable v="true" />
<displayValueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/volume/displayValueProcess.js</displayValueProcess>
......
import("Util_lib");
import("system.vars");
import("system.translate");
import("system.result");
result.string(parseInt(vars.get("$field.VOLUME")) + " " + translate.text("${EURO_SIGN}"))
\ No newline at end of file
result.string(NumberUtils.formatWithCurrency(vars.get("$this.value"), translate.text("#0"), translate.text("${EURO_SIGN}")));
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>OfferPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<headerFooterLayout>
<name>layout</name>
<header>Header</header>
</headerFooterLayout>
</layout>
<children>
<cardViewTemplate>
<name>Header</name>
<iconField>IMAGE</iconField>
<titleField>OfferCode_VersNr_fieldgroup</titleField>
<descriptionField>CONTACT_ID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
<genericViewTemplate>
<name>Details</name>
<editMode v="false" />
<showDrawer v="true" />
<drawerCaption>Details</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>8d780ff6-9ca0-4067-b2b1-6e092c62253e</name>
<entityField>STATUS</entityField>
</entityFieldLink>
<entityFieldLink>
<name>df5f1901-d397-42cf-8187-c1435bd1bd88</name>
<entityField>OFFERDATE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>49e446b5-015e-45ad-9417-c5c50f9756f1</name>
<entityField>LANGUAGE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>ce062531-603e-4c33-8a6b-935d2f07f516</name>
<entityField>ChosenAddress</entityField>
</entityFieldLink>
<entityFieldLink>
<name>447f5c6e-3653-49dd-ba8b-18c21a9bd6f9</name>
<entityField>ADDRESS</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Prices</name>
<showDrawer v="true" />
<drawerCaption>Prices</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>d7ca2b66-5e7a-4951-a89b-fbeab0f4f798</name>
<entityField>NET</entityField>
</entityFieldLink>
<entityFieldLink>
<name>c50dec3f-5468-4196-be88-a413ae3947de</name>
<entityField>VAT</entityField>
</entityFieldLink>
<entityFieldLink>
<name>43972a26-67f7-4fb5-9107-111731d326af</name>
<entityField>TotalGross</entityField>
</entityFieldLink>
<entityFieldLink>
<name>5e41444b-b092-4406-beb0-bfe05e4db35a</name>
<entityField>CURRENCY</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Info</name>
<showDrawer v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>037889c4-136c-4e9e-b8e2-ff4f13af13c1</name>
<entityField>PROBABILITY</entityField>
</entityFieldLink>
<entityFieldLink>
<name>3317b73e-68e8-41a8-a678-89c7c7c8513e</name>
<entityField>SALESPROJECT_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>59daee43-0e79-49d8-a36a-5ce4c491def9</name>
<entityField>PAYMENTTERMS</entityField>
</entityFieldLink>
<entityFieldLink>
<name>a3a9ee30-bdd2-4907-b215-d4b4adcc0f1d</name>
<entityField>DELIVERYTERMS</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<neonViewReference>
<name>b5e6c1b7-8a34-45a5-b4b6-9f61bda485fd</name>
<entityField>MainDocuments</entityField>
<view>DocumentList_view</view>
</neonViewReference>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>OfferPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<headerFooterLayout>
<name>layout</name>
<header>Header</header>
</headerFooterLayout>
</layout>
<children>
<cardViewTemplate>
<name>Header</name>
<iconField>IMAGE</iconField>
<titleField>OfferCode_VersNr_fieldgroup</titleField>
<descriptionField>CONTACT_ID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
<genericViewTemplate>
<name>Details</name>
<editMode v="false" />
<showDrawer v="true" />
<drawerCaption>Details</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>8d780ff6-9ca0-4067-b2b1-6e092c62253e</name>
<entityField>STATUS</entityField>
</entityFieldLink>
<entityFieldLink>
<name>df5f1901-d397-42cf-8187-c1435bd1bd88</name>
<entityField>OFFERDATE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>49e446b5-015e-45ad-9417-c5c50f9756f1</name>
<entityField>LANGUAGE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>ce062531-603e-4c33-8a6b-935d2f07f516</name>
<entityField>ChosenAddress</entityField>
</entityFieldLink>
<entityFieldLink>
<name>447f5c6e-3653-49dd-ba8b-18c21a9bd6f9</name>
<entityField>ADDRESS</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Prices</name>
<showDrawer v="true" />
<drawerCaption>Prices</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>d7ca2b66-5e7a-4951-a89b-fbeab0f4f798</name>
<entityField>NET</entityField>
</entityFieldLink>
<entityFieldLink>
<name>c50dec3f-5468-4196-be88-a413ae3947de</name>
<entityField>VAT</entityField>
</entityFieldLink>
<entityFieldLink>
<name>43972a26-67f7-4fb5-9107-111731d326af</name>
<entityField>TotalGross</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Info</name>
<showDrawer v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>037889c4-136c-4e9e-b8e2-ff4f13af13c1</name>
<entityField>PROBABILITY</entityField>
</entityFieldLink>
<entityFieldLink>
<name>3317b73e-68e8-41a8-a678-89c7c7c8513e</name>
<entityField>SALESPROJECT_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>59daee43-0e79-49d8-a36a-5ce4c491def9</name>
<entityField>PAYMENTTERMS</entityField>
</entityFieldLink>
<entityFieldLink>
<name>a3a9ee30-bdd2-4907-b215-d4b4adcc0f1d</name>
<entityField>DELIVERYTERMS</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<neonViewReference>
<name>b5e6c1b7-8a34-45a5-b4b6-9f61bda485fd</name>
<entityField>MainDocuments</entityField>
<view>DocumentList_view</view>
</neonViewReference>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>OrderPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<headerFooterLayout>
<name>layout</name>
<header>Header</header>
</headerFooterLayout>
</layout>
<children>
<cardViewTemplate>
<name>Header</name>
<iconField>IMAGE</iconField>
<titleField>OrderCode_VersNr_fieldgroup</titleField>
<descriptionField>CONTACT_ID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
<genericViewTemplate>
<name>Details</name>
<editMode v="false" />
<showDrawer v="true" />
<drawerCaption>Details</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>d7bb0f49-34db-4485-9908-598e83f3e73b</name>
<entityField>ORDERDATE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>8d780ff6-9ca0-4067-b2b1-6e092c62253e</name>
<entityField>STATUS</entityField>
</entityFieldLink>
<entityFieldLink>
<name>49e446b5-015e-45ad-9417-c5c50f9756f1</name>
<entityField>LANGUAGE</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Prices</name>
<showDrawer v="true" />
<drawerCaption>Prices</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>d7ca2b66-5e7a-4951-a89b-fbeab0f4f798</name>
<entityField>NET</entityField>
</entityFieldLink>
<entityFieldLink>
<name>c50dec3f-5468-4196-be88-a413ae3947de</name>
<entityField>VAT</entityField>
</entityFieldLink>
<entityFieldLink>
<name>43972a26-67f7-4fb5-9107-111731d326af</name>
<entityField>TotalGross</entityField>
</entityFieldLink>
<entityFieldLink>
<name>5e41444b-b092-4406-beb0-bfe05e4db35a</name>
<entityField>CURRENCY</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Info</name>
<showDrawer v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>3317b73e-68e8-41a8-a678-89c7c7c8513e</name>
<entityField>SALESPROJECT_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>ca9602d9-03fe-450b-9349-949bf206b4bf</name>
<entityField>OFFER_ID</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<neonViewReference>
<name>2e68ece3-d98d-49c4-92f9-3e3675ba5cb2</name>
<entityField>MainDocuments</entityField>
<view>DocumentList_view</view>
</neonViewReference>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>OrderPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<headerFooterLayout>
<name>layout</name>
<header>Header</header>
</headerFooterLayout>
</layout>
<children>
<cardViewTemplate>
<name>Header</name>
<iconField>IMAGE</iconField>
<titleField>OrderCode_VersNr_fieldgroup</titleField>
<descriptionField>CONTACT_ID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
<genericViewTemplate>
<name>Details</name>
<editMode v="false" />
<showDrawer v="true" />
<drawerCaption>Details</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>d7bb0f49-34db-4485-9908-598e83f3e73b</name>
<entityField>ORDERDATE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>8d780ff6-9ca0-4067-b2b1-6e092c62253e</name>
<entityField>STATUS</entityField>
</entityFieldLink>
<entityFieldLink>
<name>49e446b5-015e-45ad-9417-c5c50f9756f1</name>
<entityField>LANGUAGE</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Prices</name>
<showDrawer v="true" />
<drawerCaption>Prices</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>d7ca2b66-5e7a-4951-a89b-fbeab0f4f798</name>
<entityField>NET</entityField>
</entityFieldLink>
<entityFieldLink>
<name>c50dec3f-5468-4196-be88-a413ae3947de</name>
<entityField>VAT</entityField>
</entityFieldLink>
<entityFieldLink>
<name>43972a26-67f7-4fb5-9107-111731d326af</name>
<entityField>TotalGross</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate>
<name>Info</name>
<showDrawer v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>3317b73e-68e8-41a8-a678-89c7c7c8513e</name>
<entityField>SALESPROJECT_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>ca9602d9-03fe-450b-9349-949bf206b4bf</name>
<entityField>OFFER_ID</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<neonViewReference>
<name>2e68ece3-d98d-49c4-92f9-3e3675ba5cb2</name>
<entityField>MainDocuments</entityField>
<view>DocumentList_view</view>
</neonViewReference>
</children>
</neonView>
......@@ -104,6 +104,16 @@ NumberUtils.validateIsBetweenFloat = function(pTitle, pValue, pMin, pMax, pIgnor
return false;
}
/**
* format Numbers with currency
*/
NumberUtils.formatWithCurrency = function(pNumber, pPattern, pCurrency)
{
if (pNumber && pPattern)
return text.formatDouble(pNumber, pPattern + " " + pCurrency);
return "0 " + pCurrency;
}
/**
* Class containing static utility functions for use with arrays
* Do not create an instance of this!
......
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