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

use load entity for sp key figures (open sp, sent offers)

parent 57468dd1
No related branches found
No related tags found
No related merge requests found
Showing with 50 additions and 40 deletions
......@@ -881,6 +881,20 @@
<iconId>VAADIN:CURLY_BRACKETS</iconId>
<stateProcess>%aditoprj%/entity/Offer_entity/entityfields/openadminview/stateProcess.js</stateProcess>
</entityActionField>
<entityProvider>
<name>SentOffers</name>
<children>
<entityParameter>
<name>OfferStatus_param</name>
<valueProcess>%aditoprj%/entity/Offer_entity/entityfields/sentoffers/children/offerstatus_param/valueProcess.js</valueProcess>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>OfferStatus_param</name>
<expose v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.result");
import("KeywordRegistry_basic");
result.string($KeywordRegistry.offerStatus$sent());
\ No newline at end of file
......@@ -11,5 +11,8 @@ else {
cond.andPrepareVars("OFFER.OBJECT_ROWID", "$param.ObjectRowId_param");
cond.andPrepareVars("OFFER.OBJECT_TYPE", "$param.ObjectType_param");
}
cond.andPrepareVars("OFFER.STATUS", "$param.OfferStatus_param")
//TODO: use a preparedCondition when available #1030812 #1034026
result.string(db.translateCondition(cond.build("1 = 1")));
\ No newline at end of file
import("system.datetime");
import("system.db");
import("system.result");
import("system.vars");
import("Date_lib");
import("Sql_lib");
import("system.SQLTYPES")
import("system.entities");
var opensp = db.cell("select count(STATE) from SALESPROJECT \n\
join AB_KEYWORD_ENTRY on KEYID = STATE and CONTAINER = 'SalesprojectState' and TITLE = 'Open' \n\
group by KEYID, AB_KEYWORD_ENTRY.TITLE");
var conf = entities.createConfigForLoadingRows()
.entity("Salesproject_entity")
.provider("OpenSalesprojects");
var opensp = entities.getRowCount(conf);
result.string(opensp);
\ No newline at end of file
import("system.datetime");
import("system.db");
import("system.result");
import("system.vars");
import("Date_lib");
import("Sql_lib");
import("system.SQLTYPES")
import("system.entities");
var sentoffer = db.cell("select count(STATUS) from OFFER join AB_KEYWORD_ENTRY \n\
on KEYID = STATUS and CONTAINER = 'OfferStatus' and TITLE = 'Sent' group by KEYID, AB_KEYWORD_ENTRY.TITLE");
result.string(sentoffer);
\ No newline at end of file
var conf = entities.createConfigForLoadingRows()
.entity("Offer_entity")
.provider("SentOffers");
var opensp = entities.getRowCount(conf);
result.string(opensp);
\ No newline at end of file
......@@ -475,7 +475,7 @@
</children>
</entityConsumer>
<entityProvider>
<name>openSalesprojects</name>
<name>OpenSalesprojects</name>
<dependencies>
<entityDependency>
<name>631f55f9-fb0f-4205-bdb8-6e3476268ab4</name>
......
import("system.result");
import("KeywordRegistry_basic");
result.string($KeywordRegistry.salesprojectState$open());
\ No newline at end of file
import("system.result");
//The Id for the salesproject state keyword OPEN
result.string("483bcaeb-1e5b-4772-b54e-7d7d8aa65712");
\ No newline at end of file
import("system.result");
import("KeywordRegistry_basic");
result.string($KeywordRegistry.salesprojectState$open());
\ No newline at end of file
......@@ -3,18 +3,8 @@ import("system.result");
import("system.vars");
import("Sql_lib");
if(vars.exists("$param.State_param") && vars.get("$param.State_param") && vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param"))
{
result.string(db.translateCondition(
SqlCondition.begin()
.andPrepareVars("SALESPROJECT.CONTACT_ID", "$param.ContactId_param")
.andPrepareVars("SALESPROJECT.STATE", "$param.State_param")
.build("1 = 2")));
}
else
{
result.string(db.translateCondition(
SqlCondition.begin()
.andPrepareVars("SALESPROJECT.CONTACT_ID", "$param.ContactId_param")
.build("1 = 1")));
}
\ No newline at end of file
result.string(db.translateCondition(
SqlCondition.begin()
.andPrepareVars("SALESPROJECT.CONTACT_ID", "$param.ContactId_param")
.andPrepareVars("SALESPROJECT.STATE", "$param.State_param")
.build("1 = 1")));
\ No newline at end of file
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