Skip to content
Snippets Groups Projects
Commit f7b23641 authored by Dominik Lechner's avatar Dominik Lechner
Browse files

Turnover and Contact Information for Organisation

parent 41c1dd5a
No related branches found
No related tags found
No related merge requests found
Showing
with 192 additions and 0 deletions
...@@ -863,6 +863,38 @@ ...@@ -863,6 +863,38 @@
<fieldName>Products</fieldName> <fieldName>Products</fieldName>
</dependency> </dependency>
</entityConsumer> </entityConsumer>
<entityField>
<name>TurnoverCurrentYear</name>
<title>Turnover Current Year</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00€</outputFormat>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnovercurrentyear/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>TurnoverLastYear</name>
<title>Turnover Last Year</title>
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00€</outputFormat>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnoverlastyear/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>TurnoverPercentDiff</name>
<title>Turnover change</title>
<colorProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnoverpercentdiff/colorProcess.js</colorProcess>
<contentType>TEXT</contentType>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnoverpercentdiff/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CountActivity</name>
<title>Number of activities</title>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/countactivity/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>LastActivity</name>
<title>Days inactive</title>
<colorProcess>%aditoprj%/entity/Organisation_entity/entityfields/lastactivity/colorProcess.js</colorProcess>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/lastactivity/valueProcess.js</valueProcess>
</entityField>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
import("system.result");
import("system.vars");
import("system.db");
var amount = db.cell("select count(ACTIVITYID) from ACTIVITY join ACTIVITYLINK on ACTIVITYLINK.ACTIVITY_ID = ACTIVITY.ACTIVITYID \n\
where ACTIVITYLINK.OBJECT_ROWID = '" + vars.get("$field.CONTACTID") + "' and ACTIVITYLINK.OBJECT_TYPE = 'Organisation'");
result.string(amount);
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(parseInt(vars.get("$field.LastActivity")) > 50)
{
result.string(neon.PRIORITY_HIGH_COLOR);
}
\ No newline at end of file
import("system.datetime");
import("system.translate");
import("system.result");
import("system.vars");
import("ActivityTask_lib");
import("Date_lib");
var entryDate = ActivityUtils.getLastActivityDate(vars.get("$field.CONTACTID"));
if (!entryDate)
entryDate = vars.get("$field.DATE_NEW");
daysPassed = DateUtils.getDayDifference(entryDate);
if (daysPassed != null)
result.string(daysPassed);
\ No newline at end of file
import("system.translate");
import("Util_lib");
import("system.datetime");
import("system.vars");
import("system.db");
import("system.result");
import("system.date");
var currentYear = datetime.toDate(vars.get("$sys.date"), "yyyy");
var salesCurrentYear = db.cell("select SUM(NET) from salesorder where SALESORDERDATE >= '" + currentYear + "-01-01 00:00:00.000' \n\
and CONTACT_ID = '" + vars.get("$field.CONTACTID") + "'");
if(salesCurrentYear == "")
salesCurrentYear = 0;
result.string(salesCurrentYear);
\ No newline at end of file
import("system.logging");
import("system.datetime");
import("system.vars");
import("system.db");
import("system.result");
import("system.date");
var lastYear = parseInt(datetime.toDate(vars.get("$sys.date"), "yyyy")) - 1;
var salesLastYear = db.cell("select SUM(NET) from salesorder where SALESORDERDATE < '" + (lastYear+1) + "-01-01 00:00:00.000' \n\
and SALESORDERDATE >= '" + lastYear + "-01-01 00:00:00.000' \n\
and CONTACT_ID = '" + vars.get("$field.CONTACTID") + "'");
if(salesLastYear == "")
salesLastYear = 0;
result.string(salesLastYear);
\ No newline at end of file
import("system.result");
import("system.logging");
import("system.vars");
import("system.neon");
var ret;
var turnoverPercentDiff = parseInt(vars.get("$field.TurnoverPercentDiff"));
if(turnoverPercentDiff > 0)
ret = neon.PRIORITY_LOW_COLOR;
else if (turnoverPercentDiff < 0)
ret = neon.PRIORITY_HIGH_COLOR;
result.string(ret);
\ No newline at end of file
import("system.logging");
import("system.result");
import("system.vars");
var ret = 0;
var turnoverCurrentYear = parseInt(vars.get("$field.TurnoverCurrentYear"));
var turnoverLastYear = parseInt(vars.get("$field.TurnoverLastYear"));
if(turnoverLastYear != 0 && turnoverCurrentYear != 0)
ret = parseInt(100 / turnoverLastYear * turnoverCurrentYear) - 100;
else if(turnoverLastYear == 0 && turnoverCurrentYear != 0)
ret = 100;
else if(turnoverLastYear != 0 && turnoverCurrentYear == 0 )
ret = -100;
else
ret = 0;
ret += "%";
result.string(ret);
\ No newline at end of file
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
<key>Data Privacy</key> <key>Data Privacy</key>
<value>Datenschutz</value> <value>Datenschutz</value>
</entry> </entry>
<entry>
<key>Number of activities</key>
<value>Anzahl Aktivitäten</value>
</entry>
<entry> <entry>
<key>Bulk mails</key> <key>Bulk mails</key>
<value>Serienmails</value> <value>Serienmails</value>
...@@ -45,6 +49,10 @@ ...@@ -45,6 +49,10 @@
<entry> <entry>
<key>Members</key> <key>Members</key>
</entry> </entry>
<entry>
<key>Turnover change</key>
<value>Entwicklung Umsatz</value>
</entry>
<entry> <entry>
<key>The following data has been anonymised: %0</key> <key>The following data has been anonymised: %0</key>
<value>Die folgenden Daten wurden anonymisiert: %0</value> <value>Die folgenden Daten wurden anonymisiert: %0</value>
...@@ -57,6 +65,10 @@ ...@@ -57,6 +65,10 @@
<key>MAX</key> <key>MAX</key>
<value>maximal</value> <value>maximal</value>
</entry> </entry>
<entry>
<key>Last activity</key>
<value>Letzte Aktivität (Tage)</value>
</entry>
<entry> <entry>
<key>Your changes have an impact on the data privacy information (DSGVO).</key> <key>Your changes have an impact on the data privacy information (DSGVO).</key>
<value>Ihre Änderungen haben Auswirkungen auf den Datenschutz (DSGVO).</value> <value>Ihre Änderungen haben Auswirkungen auf den Datenschutz (DSGVO).</value>
...@@ -1750,6 +1762,10 @@ ...@@ -1750,6 +1762,10 @@
<key>Relationship</key> <key>Relationship</key>
<value>Beziehung</value> <value>Beziehung</value>
</entry> </entry>
<entry>
<key>Change</key>
<value>Veränderung</value>
</entry>
<entry> <entry>
<key>Text Modular</key> <key>Text Modular</key>
<value>Textbaustein</value> <value>Textbaustein</value>
...@@ -5959,6 +5975,10 @@ ...@@ -5959,6 +5975,10 @@
<key>{$TICKET_EDITOR}</key> <key>{$TICKET_EDITOR}</key>
<value>Bearbeiter</value> <value>Bearbeiter</value>
</entry> </entry>
<entry>
<key>Turnover Last Year</key>
<value>Umsatz Vorjahr</value>
</entry>
<entry> <entry>
<key>Supportticket</key> <key>Supportticket</key>
</entry> </entry>
...@@ -6431,6 +6451,10 @@ ...@@ -6431,6 +6451,10 @@
<entry> <entry>
<key>dada</key> <key>dada</key>
</entry> </entry>
<entry>
<key>Turnover Current Year</key>
<value>Umsatz aktuelles Jahr</value>
</entry>
</keyValueMap> </keyValueMap>
<font name="Dialog" style="0" size="11" /> <font name="Dialog" style="0" size="11" />
</language> </language>
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<headerFooterLayout> <headerFooterLayout>
<name>layout</name> <name>layout</name>
<header>Header</header> <header>Header</header>
<footer>OrganistaionInformation</footer>
</headerFooterLayout> </headerFooterLayout>
</layout> </layout>
<children> <children>
...@@ -27,6 +28,24 @@ ...@@ -27,6 +28,24 @@
<entityField>Addresses</entityField> <entityField>Addresses</entityField>
<view>AddressList_view</view> <view>AddressList_view</view>
</neonViewReference> </neonViewReference>
<genericViewTemplate>
<name>Turnover</name>
<showDrawer v="true" />
<drawerCaption>Turnover</drawerCaption>
<entityField>#ENTITY</entityField>
<title>Turnover</title>
<devices />
<fields>
<entityFieldLink>
<name>1998bb83-a6c3-4bfb-9372-d592379591da</name>
<entityField>TurnoverCurrentYear</entityField>
</entityFieldLink>
<entityFieldLink>
<name>894a32ef-84cb-4331-a215-616b7402521d</name>
<entityField>TurnoverLastYear</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<genericViewTemplate> <genericViewTemplate>
<name>Info</name> <name>Info</name>
<showDrawer v="true" /> <showDrawer v="true" />
...@@ -50,5 +69,23 @@ ...@@ -50,5 +69,23 @@
</entityFieldLink> </entityFieldLink>
</fields> </fields>
</genericViewTemplate> </genericViewTemplate>
<scoreCardViewTemplate>
<name>OrganistaionInformation</name>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>66f460bd-164c-4c8f-a129-49a6626a3696</name>
<entityField>TurnoverPercentDiff</entityField>
</entityFieldLink>
<entityFieldLink>
<name>e1d7710b-f696-434d-b3e4-5b31f847a916</name>
<entityField>LastActivity</entityField>
</entityFieldLink>
<entityFieldLink>
<name>cc143e94-006f-4059-925a-212e91c1ece7</name>
<entityField>CountActivity</entityField>
</entityFieldLink>
</fields>
</scoreCardViewTemplate>
</children> </children>
</neonView> </neonView>
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