Skip to content
Snippets Groups Projects
Commit 19dd4d9d authored by S.Listl's avatar S.Listl
Browse files

pricelist fixes

parent e0c454d3
No related branches found
No related tags found
No related merge requests found
Showing
with 57 additions and 26 deletions
......@@ -6,7 +6,16 @@ import("Sql_lib");
var cond = new SqlCondition();
if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param"))
{
var activityLinkCond = SqlCondition.begin().andPrepareVars("ACTIVITYLINK.OBJECT_ROWID", "$param.RowId_param")
var rowId = vars.get("$param.RowId_param");
var rowIdCond = null;
if (vars.get("$param.ObjectId_param") == "Person")
{
rowId = db.cell(SqlCondition.begin()
.andPrepare("CONTACT.CONTACTID", rowId)
.buildSql("select PERSON_ID from CONTACT", "1 = 2"))
rowIdCond = "# in (select CONTACTID from CONTACT where PERSON_ID = ?)";
}
var activityLinkCond = SqlCondition.begin().andPrepare("ACTIVITYLINK.OBJECT_ROWID", rowId, rowIdCond)
.andPrepareVars("ACTIVITYLINK.OBJECT_TYPE", "$param.ObjectId_param");
// TODO: more performant way than IN. Maybe a join??
......
......@@ -194,6 +194,7 @@
</entityProvider>
<entityField>
<name>FULL_ATTRIBUTE_NAME</name>
<title>Name</title>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/full_attribute_name/valueProcess.js</valueProcess>
</entityField>
......
......@@ -3,14 +3,16 @@ import("system.neon");
import("Product_lib");
import("Util_lib");
import("Entity_lib");
import("Attribute_lib");
var pid = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.PRODUCT_ID"));
if(pid != "")
{
var currency = vars.exists("$param.Currency_param") ? vars.get("$param.Currency_param") : "";
var contactid = vars.exists("$param.ContactId_param") ? vars.get("$param.ContactId_param") : "";
var pricelist = AttributeRelationUtils.getAttribute("97b449a5-d9b4-42ff-b9b0-4f8b27b8a9ec", contactid) || "";
var PriceListFilter = { currency: currency, quantity: vars.get("$field.QUANTITY"), relationId: contactid };
var PriceListFilter = { currency: currency, quantity: vars.get("$field.QUANTITY"), relationId: contactid, priceList: pricelist };
//TODO: loading from db until loading from Consumer is possible.
var ProductDetails = ProductUtils.getProductDetails(pid, PriceListFilter, ["INFO"]);
......
......@@ -35,6 +35,7 @@
<outputFormat>#,##0.00</outputFormat>
<mandatory v="true" />
<state>AUTO</state>
<valueProcess>%aditoprj%/entity/Productprice_entity/entityfields/price/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>PRODUCTPRICEID</name>
......@@ -79,6 +80,7 @@
<contentType>NUMBER</contentType>
<outputFormat>#,##0.00</outputFormat>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/Productprice_entity/entityfields/vat/valueProcess.js</valueProcess>
<onValidation>%aditoprj%/entity/Productprice_entity/entityfields/vat/onValidation.js</onValidation>
</entityField>
<entityField>
......
//import("system.vars");
//import("system.result");
//import("system.neon");
//
//if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == "")
//{
// result.string("1");
//}
//else
// result.string(vars.get("$this.value"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == "")
result.string("1");
else
result.string(vars.get("$this.value"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == "")
result.string("0");
\ No newline at end of file
......@@ -7,6 +7,7 @@ import("Entity_lib");
var priceList = {
priceList: ProcessHandlingUtils.getOnValidationValue(vars.get("$field.PRICELIST"))
, priceListId: vars.get("$field.PRODUCTPRICEID")
, fromQuantity: vars.get("$field.FROMQUANTITY")
, buySell: vars.get("$field.BUYSELL")
, currency: vars.get("$field.CURRENCY")
......
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == "")
result.string("0");
\ No newline at end of file
......@@ -12,7 +12,8 @@
<genericViewTemplate>
<name>OfferInfo</name>
<editMode v="false" />
<showDrawer v="false" />
<showDrawer v="true" />
<drawerCaption>Detail</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
......
......@@ -14,16 +14,16 @@
<entityField>#ENTITY</entityField>
<view>ActivityPreview_view</view>
</neonViewReference>
<neonViewReference>
<name>f6c6888a-f3d6-410a-b97b-30c34a9dd6a2</name>
<entityField>ModuleTrees</entityField>
<view>ModuleTree_view</view>
</neonViewReference>
<neonViewReference>
<name>a3a45cd7-587f-4bc0-9980-e6d1c89a8212</name>
<entityField>#ENTITY</entityField>
<view>ActivityDetail_view</view>
</neonViewReference>
<neonViewReference>
<name>f6c6888a-f3d6-410a-b97b-30c34a9dd6a2</name>
<entityField>ModuleTrees</entityField>
<view>ModuleTree_view</view>
</neonViewReference>
<neonViewReference>
<name>7bab8dbf-b69e-412d-a604-3a6999658e10</name>
<entityField>Documents</entityField>
......
......@@ -11,6 +11,8 @@
<children>
<genericViewTemplate>
<name>OrderDetail_template</name>
<showDrawer v="true" />
<drawerCaption>Detail</drawerCaption>
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
......
......@@ -14,14 +14,10 @@
<entityField>#ENTITY</entityField>
<view>TaskMainPreview_view</view>
</neonViewReference>
<neonViewReference>
<name>4211b2cf-3a1f-4447-ad1c-f521d2d3f258</name>
<entityField>ModuleTrees</entityField>
<view>ModuleTree_view</view>
</neonViewReference>
<genericViewTemplate>
<name>details</name>
<showDrawer v="true" />
<drawerCaption>Detail</drawerCaption>
<entityField>#ENTITY</entityField>
<title>details</title>
<fields>
......@@ -35,6 +31,11 @@
</entityFieldLink>
</fields>
</genericViewTemplate>
<neonViewReference>
<name>4211b2cf-3a1f-4447-ad1c-f521d2d3f258</name>
<entityField>ModuleTrees</entityField>
<view>ModuleTree_view</view>
</neonViewReference>
<neonViewReference>
<name>6846f680-84ef-46da-a0ea-6797044cf693</name>
<entityField>MainDocuments</entityField>
......
......@@ -2,7 +2,7 @@
<preferences xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="3.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/preferences/3.1.0">
<name>_____PREFERENCES_PROJECT</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<projectName>xRM-Basic5</projectName>
<projectName>xRM-Basic2019</projectName>
<jditoMaxContentSize v="57671680" />
<calendarCategoriesEvent>
<entry>
......
......@@ -318,12 +318,14 @@ ProductUtils.checkForIndenticalPriceLists = function(pid, priceList) {
var PriceLists = this.getProductDetails(pid).PriceLists;
for (var pricelist in PriceLists) {
//different pricelist id
//equal price list
//equal fromquantity
//equal currency
//equal pp/sp
if (priceList.priceList == PriceLists[pricelist].priceList
&& priceList.fromQuantity == PriceLists[pricelist].fromQuantity
if (priceList.priceListId != PriceLists[pricelist].priceListId
&& priceList.priceList == PriceLists[pricelist].priceList
&& parseFloat(priceList.fromQuantity) == parseFloat(PriceLists[pricelist].fromQuantity)
&& priceList.buySell == PriceLists[pricelist].buySell
&& priceList.currency == PriceLists[pricelist].currency) {
......
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