Skip to content
Snippets Groups Projects
Commit 10a456af authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Martin Groppe
Browse files

Sales 1085045 advertising fixes

parent 81aa6d7b
No related branches found
No related tags found
No related merge requests found
Showing
with 86 additions and 62 deletions
......@@ -19,6 +19,6 @@ if (vars.exists("$param.ExcludedProducts_param") && vars.get("$param.ExcludedPro
if(vars.exists("$param.AdvertisingProducts_param") && vars.get("$param.AdvertisingProducts_param"))
{
productCond.andIfSet("PRODUCT.ADVERTISING", "Y", SqlBuilder.EQUAL());
productCond.andIfSet("PRODUCT.ADVERTISING", "1", SqlBuilder.EQUAL());
}
result.string(productCond.toString());
......@@ -10321,6 +10321,18 @@
<entry>
<key>TIFF Image</key>
</entry>
<entry>
<key>${FREE}</key>
</entry>
<entry>
<key>Target Amount in %0</key>
</entry>
<entry>
<key>Price in %0</key>
</entry>
<entry>
<key>Actual Amount in %0</key>
</entry>
<entry>
<key>OpenDocument Chart</key>
</entry>
......
......@@ -698,7 +698,7 @@
</entry>
<entry>
<key>Advertising item</key>
<value>Werbemittelposition</value>
<value>Werbemittelposten</value>
</entry>
<entry>
<key>Distribution list</key>
......@@ -808,6 +808,10 @@
<key>${CONDITION}</key>
<value>Bedingung</value>
</entry>
<entry>
<key>${FREE}</key>
<value>Kostenlos</value>
</entry>
<entry>
<key>License</key>
<value>Lizenz</value>
......@@ -1140,6 +1144,18 @@
<key>Target amount</key>
<value>Soll Betrag</value>
</entry>
<entry>
<key>Actual Amount in %0</key>
<value>Ist Betrag in %0</value>
</entry>
<entry>
<key>Target Amount in %0</key>
<value>Soll Betrag in %0</value>
</entry>
<entry>
<key>Price in %0</key>
<value>Preis in %0</value>
</entry>
<entry>
<key>Priority</key>
<value>Priorität</value>
......@@ -1433,7 +1449,7 @@
</entry>
<entry>
<key>Advertising items</key>
<value>Werbemittelpositionen</value>
<value>Werbemittelposten</value>
</entry>
<entry>
<key>SqlBuilder must contain a select clause!</key>
......
......@@ -35,6 +35,10 @@
<key>${CHECK SALESPROJECT \"%0\"}</key>
<value>check status sales project \"%0\</value>
</entry>
<entry>
<key>${FREE}</key>
<value>Free</value>
</entry>
<entry>
<key>Male</key>
</entry>
......@@ -9444,6 +9448,15 @@
<entry>
<key>Tar Archive</key>
</entry>
<entry>
<key>Target Amount in %0</key>
</entry>
<entry>
<key>Price in %0</key>
</entry>
<entry>
<key>Actual Amount in %0</key>
</entry>
<entry>
<key>TIFF Image</key>
</entry>
......
......@@ -35,6 +35,10 @@
<name>c4569e50-223e-4b99-8253-e8fa72ef45a0</name>
<entityField>RESPONSIBLE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>20c3373a-41e5-4680-b9bb-8b8012ca0d18</name>
<entityField>advertising_id</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
<neonViewReference>
......
......@@ -13,6 +13,7 @@
<genericViewTemplate>
<name>generic</name>
<showDrawer v="true" />
<drawerCaption>Advertising material</drawerCaption>
<fields>
<entityFieldLink>
<name>d44add6c-2c60-485b-8bbc-9ebe494f9e23</name>
......
......@@ -11,7 +11,12 @@
<children>
<tableViewTemplate>
<name>Table</name>
<maxDBRow v="100" />
<columns>
<neonTableColumn>
<name>8c3e1048-7f7a-4210-a849-198f5b569c04</name>
<entityField>#ICON</entityField>
</neonTableColumn>
<neonTableColumn>
<name>b8971987-29bb-48dc-b9fc-075a63ef0b4e</name>
<entityField>STATUS</entityField>
......@@ -26,7 +31,7 @@
</neonTableColumn>
<neonTableColumn>
<name>6f0e0a32-5fcf-4194-b314-0013f65ec2d6</name>
<entityField>ROW_ID</entityField>
<entityField>OBJECT_ROWID</entityField>
</neonTableColumn>
<neonTableColumn>
<name>fa9fa2a6-4240-49dc-a516-cbbd6abd29a6</name>
......
......@@ -35,11 +35,11 @@
</entityFieldLink>
<entityFieldLink>
<name>1c812246-f844-4827-bbb9-001642fa4a5d</name>
<entityField>FREE</entityField>
<entityField>free</entityField>
</entityFieldLink>
<entityFieldLink>
<name>f7ecb1cf-5365-45fa-9c45-fd5cbfed0e60</name>
<entityField>ACTUALAMOUNT</entityField>
<entityField>actualAmount</entityField>
</entityFieldLink>
<entityFieldLink>
<name>733e1d22-af01-4a21-8626-d7280feabab9</name>
......
......@@ -31,17 +31,13 @@
<name>c2b808bf-8b0e-4670-8828-b6896bbe872c</name>
<entityField>PRICE</entityField>
</neonTableColumn>
<neonTableColumn>
<name>2bf92b34-9519-496e-8511-bfa23f22db67</name>
<entityField>FREE</entityField>
</neonTableColumn>
<neonTableColumn>
<name>a78fbed8-ebdc-4f56-9563-0dae4e2ad26e</name>
<entityField>TARGETAMOUNT</entityField>
</neonTableColumn>
<neonTableColumn>
<name>8ad44ae5-47e8-4437-a6f5-88d1c9fbe61f</name>
<entityField>ACTUALAMOUNT</entityField>
<entityField>actualAmount</entityField>
</neonTableColumn>
<neonTableColumn>
<name>e53a6f55-c4d4-49df-8785-55fa8ee8a657</name>
......
......@@ -10,14 +10,15 @@
<children>
<genericViewTemplate>
<name>Generic</name>
<showDrawer v="true" />
<fields>
<entityFieldLink>
<name>d89630d6-d28e-4506-b31b-56a03cbcf4f2</name>
<entityField>ITEMPOSITION</entityField>
</entityFieldLink>
<entityFieldLink>
<name>dbd78774-ce7c-45e2-8035-2e353eae2857</name>
<entityField>ContactId</entityField>
<name>6f40b9eb-aa08-4026-bca0-eda59b612d97</name>
<entityField>contactId</entityField>
</entityFieldLink>
<entityFieldLink>
<name>697c7664-460d-4a08-b91f-3a83f23fbd24</name>
......@@ -31,17 +32,13 @@
<name>aa3453f1-7828-47e8-bc5f-e142b1c950ad</name>
<entityField>PRICE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>6d86c1c9-8ac3-40dc-ab18-e4ed7e9e166c</name>
<entityField>FREE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>603bc968-ae45-4337-a622-173fa3b47012</name>
<entityField>TARGETAMOUNT</entityField>
</entityFieldLink>
<entityFieldLink>
<name>8d096f27-2ece-41a1-8988-662d9e4cd125</name>
<entityField>ACTUALAMOUNT</entityField>
<entityField>actualAmount</entityField>
</entityFieldLink>
<entityFieldLink>
<name>da8ef39a-31e6-49fe-bd24-52eb0d1f7d37</name>
......
......@@ -19,5 +19,10 @@
<entityField>#ENTITY</entityField>
<view>AdvertisingPreview_view</view>
</neonViewReference>
<neonViewReference>
<name>8fb7b6f1-ce58-438d-89f2-643523f21e6d</name>
<entityField>LogHistories</entityField>
<view>LogHistoryFilter_view</view>
</neonViewReference>
</children>
</neonView>
......@@ -25,7 +25,7 @@
<fields>
<entityFieldLink>
<name>8cd0f253-85c7-494e-8eb1-cd5deb4fac30</name>
<entityField>ROW_ID</entityField>
<entityField>OBJECT_ROWID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>805029e1-0980-4cc0-bc31-db2edb934da1</name>
......
import("system.util");
import("Contact_lib");
import("system.logging");
import("system.translate");
import("Entity_lib");
import("Product_lib");
......@@ -11,6 +11,7 @@ import("KeywordRegistry_basic");
import("Util_lib");
import("Employee_lib");
import("Sql_lib");
import("system.entities");
/*
* Functions for working with Advertisings
......@@ -37,13 +38,14 @@ AdvertisingUtils.insertAdvertising = function(pRowId, pContext, pContactIds)
var contactId = (pContactIds.length == 1) ? pContactIds : "";
var advObj = {
"ROW_ID" : pRowId,
"OBJECT_TYPE" : pContext,
"OBJECT_ROWID" : pRowId,
"OBJECT_TYPE" : pContext,
"CONTACT_ID" : contactId,
"RESPONSIBLE_ID" : EmployeeUtils.getCurrentContactId(),
"CURRENCY" : $KeywordRegistry.currency$eur(),
"STATUS" : $KeywordRegistry.advertisingStatus$Open(),
"DATE_NEW": vars.get("$sys.date")
"RESPONSIBLE_ID" : EmployeeUtils.getCurrentContactId(),
"CURRENCY" : $KeywordRegistry.currency$eur(),
"STATUS" : $KeywordRegistry.advertisingStatus$Open(),
"DATE_NEW": vars.get("$sys.date"),
"USER_NEW": vars.get("$sys.user")
}
new SqlBuilder().insertFields(advObj, "ADVERTISING", "ADVERTISINGID", "ADVERTISINGID");
......@@ -58,17 +60,12 @@ AdvertisingUtils.insertAdvertising = function(pRowId, pContext, pContactIds)
*/
AdvertisingUtils.hasAdvertising = function(pRowId)
{
var sql = new SqlBuilder()
.select("ADVERTISING.ADVERTISINGID")
var count = newSelect("count(ADVERTISING.ADVERTISINGID)")
.from("ADVERTISING")
.where();
.where("ADVERTISING.OBJECT_ROWID", pRowId)
.cell();
if(pRowId)
{
sql.andIfSet("ADVERTISING.ROW_ID", pRowId);
}
return Utils.toBoolean(sql.cell());
return Utils.toBoolean(count);
}
/*
......@@ -120,9 +117,8 @@ AdvertisingUtils.isDigitalAdvertisingProduct = function (pProductId)
return Utils.toBoolean(newSelect("PRODUCT.DIGITAL")
.from("PRODUCT")
.where("PRODUCT.PRODUCTID", pProductId)
.and("PRODUCT.ADVERTISING", "Y")
.cell()
);
.and("PRODUCT.ADVERTISING", "1")
.cell());
}
/*
......@@ -143,27 +139,6 @@ AdvertisingUtils.getAdvertisingFilterExtensionCondition = function()
return cond;
}
/*
* gets the Title for a Pricefield with the current currency
*
* @param {String} pTitle current <b>translated</b> Title which should be extended
* @param {String} pCurrency - currency e.g 'EUR' / 'USD'
*
* @return {String} concatinated Title e.g 'Price in EUR'
*/
AdvertisingUtils.getPriceTitleWithCurrency = function(pTitle, pCurrency)
{
var ret = pTitle;
if(pCurrency)
{
ret += " ";
ret += translate.text("in") + " " + pCurrency;
}
return ret;
}
/*
* gets Advertising relevant details for the passed productId
*
......@@ -207,9 +182,9 @@ AdvertisingUtils.getProductObject = function(pProductId, pAdvertisingId, pQuanti
.and("DESCRIPTIONTRANSLATION.OBJECT_TYPE", "Product")
.toString();
productDetails = ProductUtils.getProductDetails(productId, PriceListFilter,
[["info", "(" + productInfoSubSql + ")"]
]);
productDetails = ProductUtils.getProductDetails(productId
, PriceListFilter
, [["info", "(" + productInfoSubSql + ")"]]);
}
return productDetails;
}
\ 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