From 1aaf0fde8fc1358000147cf8def519ae22a5e2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Schr=C3=B6ger?= <m.schroeger@adito.de> Date: Thu, 22 Nov 2018 14:10:52 +0100 Subject: [PATCH] Offer_entity, Product_entity: added onDBDelete processes Stock example data --- entity/Offer_entity/Offer_entity.aod | 1 + entity/Offer_entity/onDBDelete.js | 4 ++ entity/Product_entity/Product_entity.aod | 1 + entity/Product_entity/onDBDelete.js | 7 ++++ .../Productprice_entity.aod | 4 +- entity/Stock_entity/Stock_entity.aod | 1 + entity/Stock_entity/orderClauseProcess.js | 3 ++ .../_____LANGUAGE_EXTRA.aod | 25 +----------- .../_____LANGUAGE_de/_____LANGUAGE_de.aod | 28 ++----------- .../_____LANGUAGE_en/_____LANGUAGE_en.aod | 27 ++----------- .../data/example_product/PRODUCT_42154311.xml | 40 +++++++++++++++++++ process/Util_lib/process.js | 3 -- 12 files changed, 68 insertions(+), 76 deletions(-) create mode 100644 entity/Offer_entity/onDBDelete.js create mode 100644 entity/Product_entity/onDBDelete.js create mode 100644 entity/Stock_entity/orderClauseProcess.js diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 1ff7742f78b..80b0a931de7 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -9,6 +9,7 @@ <caption>Offer</caption> <alias>Data_alias</alias> <conditionProcess>%aditoprj%/entity/Offer_entity/conditionProcess.js</conditionProcess> + <onDBDelete>%aditoprj%/entity/Offer_entity/onDBDelete.js</onDBDelete> <entityFields> <entityIncomingField> <name>#INCOMING</name> diff --git a/entity/Offer_entity/onDBDelete.js b/entity/Offer_entity/onDBDelete.js new file mode 100644 index 00000000000..c69fde6a928 --- /dev/null +++ b/entity/Offer_entity/onDBDelete.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.db"); + +db.deleteData("OFFERITEM", "OFFERITEM.OFFER_ID = '" + vars.getString("$field.OFFERID") + "'"); \ No newline at end of file diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index 62ca2933058..fe1c17de711 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -8,6 +8,7 @@ <iconId>VAADIN:HAMMER</iconId> <alias>Data_alias</alias> <orderClauseProcess>%aditoprj%/entity/Product_entity/orderClauseProcess.js</orderClauseProcess> + <onDBDelete>%aditoprj%/entity/Product_entity/onDBDelete.js</onDBDelete> <jDitoRecordAlias>Data_alias</jDitoRecordAlias> <entityFields> <entityField> diff --git a/entity/Product_entity/onDBDelete.js b/entity/Product_entity/onDBDelete.js new file mode 100644 index 00000000000..f27a5d2007b --- /dev/null +++ b/entity/Product_entity/onDBDelete.js @@ -0,0 +1,7 @@ +import("system.vars"); +import("system.db"); + +db.deleteData("PROD2PROD", "PROD2PROD.DEST_ID = '" + vars.getString("$field.PRODUCTID") + "'"); +db.deleteData("PROD2PROD", "PROD2PROD.SOURCE_ID = '" + vars.getString("$field.PRODUCTID") + "'"); +db.deleteData("PRODUCTPRICE", "PRODUCTPRICE.PRODUCT_ID = '" + vars.getString("$field.PRODUCTID") + "'"); +db.deleteData("STOCK", "STOCK.PRODUCT_ID = '" + vars.getString("$field.PRODUCTID") + "'"); \ No newline at end of file diff --git a/entity/Productprice_entity/Productprice_entity.aod b/entity/Productprice_entity/Productprice_entity.aod index faa99beeea5..3a214314d28 100644 --- a/entity/Productprice_entity/Productprice_entity.aod +++ b/entity/Productprice_entity/Productprice_entity.aod @@ -240,8 +240,8 @@ </entityField> <entityField> <name>currentPurchasePrice</name> - <title>Curr. sales price</title> - <caption>Curr. sales price</caption> + <title>Curr. purchase price</title> + <caption>Curr. purchase price</caption> <contentType>NUMBER</contentType> <outputFormat>#,##0.00 €</outputFormat> <valueProcess>%aditoprj%/entity/Productprice_entity/entityfields/currentpurchaseprice/valueProcess.js</valueProcess> diff --git a/entity/Stock_entity/Stock_entity.aod b/entity/Stock_entity/Stock_entity.aod index a1f4c5785cf..969b97e4ddb 100644 --- a/entity/Stock_entity/Stock_entity.aod +++ b/entity/Stock_entity/Stock_entity.aod @@ -7,6 +7,7 @@ <caption>Stock</caption> <alias>Data_alias</alias> <conditionProcess>%aditoprj%/entity/Stock_entity/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/Stock_entity/orderClauseProcess.js</orderClauseProcess> <entityFields> <entityField> <name>DATE_EDIT</name> diff --git a/entity/Stock_entity/orderClauseProcess.js b/entity/Stock_entity/orderClauseProcess.js new file mode 100644 index 00000000000..ec31c7395e9 --- /dev/null +++ b/entity/Stock_entity/orderClauseProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.object( {"STOCK.ENTRYDATE": "down"} ); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 0c9e0958816..87070add17b 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -948,21 +948,9 @@ <entry> <key>A reason is only possible if a date is given.</key> </entry> - <entry> - <key>Document</key> - </entry> <entry> <key>New offer version</key> </entry> - <entry> - <key>Dateiname</key> - </entry> - <entry> - <key>Dokumente</key> - </entry> - <entry> - <key>Dateityp</key> - </entry> <entry> <key>Copy offer</key> </entry> @@ -970,19 +958,10 @@ <key>Documents</key> </entry> <entry> - <key>Datum</key> - </entry> - <entry> - <key>Vorschau</key> - </entry> - <entry> - <key>Datei</key> - </entry> - <entry> - <key>Dateigröße</key> + <key>Vers. no.</key> </entry> <entry> - <key>Vers. no.</key> + <key>Curr. purchase price</key> </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index a2ce4fb8627..8ee67a8d325 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -1222,22 +1222,10 @@ <key>A reason is only possible if a date is given.</key> <value>Begründung nur bei Ausgeschiedenen Mitbewerbern erlaubt.</value> </entry> - <entry> - <key>Document</key> - </entry> <entry> <key>New offer version</key> <value>Neue Angebotsversion</value> </entry> - <entry> - <key>Dateiname</key> - </entry> - <entry> - <key>Dokumente</key> - </entry> - <entry> - <key>Dateityp</key> - </entry> <entry> <key>Copy offer</key> <value>Angebot kopieren</value> @@ -1245,22 +1233,14 @@ <entry> <key>Documents</key> </entry> - <entry> - <key>Datum</key> - </entry> - <entry> - <key>Vorschau</key> - </entry> - <entry> - <key>Datei</key> - </entry> - <entry> - <key>Dateigröße</key> - </entry> <entry> <key>Vers. no.</key> <value>Vers.-Nr.</value> </entry> + <entry> + <key>Curr. purchase price</key> + <value>akt. EK-Preis</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index bc542ae28fe..84522de963f 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -954,36 +954,12 @@ <entry> <key>Vers. no.</key> </entry> - <entry> - <key>Document</key> - </entry> - <entry> - <key>Dateiname</key> - </entry> - <entry> - <key>Dokumente</key> - </entry> - <entry> - <key>Dateityp</key> - </entry> <entry> <key>Competition</key> </entry> - <entry> - <key>Datum</key> - </entry> <entry> <key>Forecast</key> </entry> - <entry> - <key>Vorschau</key> - </entry> - <entry> - <key>Datei</key> - </entry> - <entry> - <key>Dateigröße</key> - </entry> <entry> <key>Project member</key> </entry> @@ -993,6 +969,9 @@ <entry> <key>A reason is only possible if a date is given.</key> </entry> + <entry> + <key>Curr. purchase price</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/others/db_changes/data/example_product/PRODUCT_42154311.xml b/others/db_changes/data/example_product/PRODUCT_42154311.xml index 07a294aea5a..b64161fe6a3 100644 --- a/others/db_changes/data/example_product/PRODUCT_42154311.xml +++ b/others/db_changes/data/example_product/PRODUCT_42154311.xml @@ -232,6 +232,46 @@ <column name="DATE_NEW" valueDate="2018-11-12T14:35:59"/> </insert> + <insert tableName="STOCK"> + <column name="STOCKID" value="f09201f8-85f3-4715-8d44-5cec7b8f437b"/> + <column name="IN_OUT" valueNumeric="1"/> + <column name="QUANTITY" valueNumeric="30"/> + <column name="PRODUCT_ID" value="P101 "/> + <column name="ENTRYDATE" valueDate="2018-11-22T00:00:00"/> + <column name="WAREHOUSE" valueNumeric="1"/> + <column name="USER_NEW" value="Admin"/> + <column name="DATE_NEW" valueDate="2018-11-22T11:35:59"/> + </insert> + <insert tableName="STOCK"> + <column name="STOCKID" value="a90a8aba-76bb-40b1-a4ab-ef39508296cb"/> + <column name="IN_OUT" valueNumeric="1"/> + <column name="QUANTITY" valueNumeric="25"/> + <column name="PRODUCT_ID" value="P101 "/> + <column name="ENTRYDATE" valueDate="2018-11-15T00:00:00"/> + <column name="WAREHOUSE" valueNumeric="1"/> + <column name="USER_NEW" value="Admin"/> + <column name="DATE_NEW" valueDate="2018-11-22T11:36:04"/> + </insert> + <insert tableName="STOCK"> + <column name="STOCKID" value="bd4c1a16-1b80-4b3e-aa67-306f387a62df"/> + <column name="IN_OUT" valueNumeric="-1"/> + <column name="QUANTITY" valueNumeric="23"/> + <column name="PRODUCT_ID" value="P101 "/> + <column name="ENTRYDATE" valueDate="2018-11-22T00:00:00"/> + <column name="WAREHOUSE" valueNumeric="1"/> + <column name="USER_NEW" value="Admin"/> + <column name="DATE_NEW" valueDate="2018-11-22T11:36:07"/> + </insert> + <insert tableName="STOCK"> + <column name="STOCKID" value="3caba278-9d38-485c-9d78-11ea969b832c"/> + <column name="IN_OUT" valueNumeric="-1"/> + <column name="QUANTITY" valueNumeric="17"/> + <column name="PRODUCT_ID" value="P101 "/> + <column name="ENTRYDATE" valueDate="2018-11-15T00:00:00"/> + <column name="WAREHOUSE" valueNumeric="1"/> + <column name="USER_NEW" value="Admin"/> + <column name="DATE_NEW" valueDate="2018-11-22T11:36:09"/> + </insert> </changeSet> </databaseChangeLog> \ No newline at end of file diff --git a/process/Util_lib/process.js b/process/Util_lib/process.js index ac78b94268e..9772443a043 100644 --- a/process/Util_lib/process.js +++ b/process/Util_lib/process.js @@ -1339,10 +1339,7 @@ function CopyModuleUtils() case "OFFER": { //andere Values setzen - //var offUtils = new OfferUtils(); var dtUtils = new DateUtils(); - - //ModuleRowMapping.ColumnMapping["OFFERCODE"].newValue = offUtils.getNextOfferNumber(); ModuleRowMapping.ColumnMapping["OFFERDATE"].newValue = dtUtils.getTodayUTC(); } break; -- GitLab